From ef75989178744f7c96a5a1f0a6b4db7bcb615400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 11 Dec 2012 17:20:32 +0100 Subject: [PATCH] Platform: don't require any specific OpenGL version. We still want to target old Intel machines with OpenGL 2.1. Also moved important information from constructor documentation to class documentation. Who would look into constructor documentation for that? --- src/Platform/GlutApplication.h | 7 +++---- src/Platform/GlxApplication.h | 6 ++---- src/Platform/GlxContextHandler.cpp | 6 +----- src/Platform/GlxContextHandler.h | 6 ++---- src/Platform/NaClApplication.h | 5 ++--- src/Platform/XEglApplication.h | 5 ++--- 6 files changed, 12 insertions(+), 23 deletions(-) diff --git a/src/Platform/GlutApplication.h b/src/Platform/GlutApplication.h index 9d7e65c6a..d2fcca1af 100644 --- a/src/Platform/GlutApplication.h +++ b/src/Platform/GlutApplication.h @@ -35,8 +35,9 @@ namespace Platform { /** @nosubgrouping @brief GLUT application -Supports keyboard handling for limited subset of keys, mouse handling with -support for changing cursor and mouse tracking and warping. +Creates double-buffered RGBA window with depth and stencil buffers. Supports +keyboard handling for limited subset of keys, mouse handling with support for +changing cursor and mouse tracking and warping. @section GlutApplication-usage Usage @@ -58,8 +59,6 @@ class GlutApplication { * @param argv Arguments of `main()` function * @param title Window title * @param size Window size - * - * Creates double-buffered RGBA window with depth and stencil buffers. */ GlutApplication(int& argc, char** argv, const std::string& title = "Magnum GLUT application", const Vector2i& size = Vector2i(800, 600)); diff --git a/src/Platform/GlxApplication.h b/src/Platform/GlxApplication.h index fec492946..603ea41ae 100644 --- a/src/Platform/GlxApplication.h +++ b/src/Platform/GlxApplication.h @@ -27,7 +27,8 @@ namespace Magnum { namespace Platform { /** @brief GLX application -Uses GlxContextHandler. +Creates window with double-buffered OpenGL or OpenGL ES 2.0 context, if +targetting OpenGL ES. Uses GlxContextHandler. @section GlxApplication-usage Usage @@ -49,9 +50,6 @@ class GlxApplication: public AbstractXApplication { * @param argv Arguments of `main()` function * @param title Window title * @param size Window size - * - * Creates window with double-buffered OpenGL 3.2 core context or - * OpenGL ES 2.0 context, if targetting OpenGL ES. */ inline GlxApplication(int& argc, char** argv, const std::string& title = "Magnum GLX application", const Vector2i& size = Vector2i(800, 600)): AbstractXApplication(new GlxContextHandler, argc, argv, title, size) {} }; diff --git a/src/Platform/GlxContextHandler.cpp b/src/Platform/GlxContextHandler.cpp index f7915e98e..a7e2b810d 100644 --- a/src/Platform/GlxContextHandler.cpp +++ b/src/Platform/GlxContextHandler.cpp @@ -65,11 +65,7 @@ void GlxContextHandler::createContext(Window nativeWindow) { window = nativeWindow; GLint attributes[] = { - #ifndef MAGNUM_TARGET_GLES - GLX_CONTEXT_MAJOR_VERSION_ARB, 3, - GLX_CONTEXT_MINOR_VERSION_ARB, 2, - GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB, - #else + #ifdef MAGNUM_TARGET_GLES GLX_CONTEXT_MAJOR_VERSION_ARB, 2, GLX_CONTEXT_MINOR_VERSION_ARB, 0, GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_ES2_PROFILE_BIT_EXT, diff --git a/src/Platform/GlxContextHandler.h b/src/Platform/GlxContextHandler.h index 8922f9bf5..136241466 100644 --- a/src/Platform/GlxContextHandler.h +++ b/src/Platform/GlxContextHandler.h @@ -34,10 +34,8 @@ namespace Magnum { namespace Platform { /** @brief GLX context -Creates OpenGL 3.2 core context or OpenGL ES 2.0 context, if targetting -OpenGL ES. - -Used in GlxApplication. +Creates OpenGL or OpenGL ES 2.0 context, if targetting OpenGL ES. Used in +GlxApplication. */ class GlxContextHandler: public AbstractContextHandler { public: diff --git a/src/Platform/NaClApplication.h b/src/Platform/NaClApplication.h index 81d670603..13ed6e09b 100644 --- a/src/Platform/NaClApplication.h +++ b/src/Platform/NaClApplication.h @@ -44,7 +44,8 @@ namespace Magnum { namespace Platform { @brief NaCl application Application running in [Google Chrome Native Client](https://developers.google.com/native-client/). -Supports keyboard and mouse handling. +Creates double-buffered RGBA canvas with depth and stencil buffers. Supports +keyboard and mouse handling. @section NaClApplication-usage Usage @@ -69,8 +70,6 @@ class NaClApplication: public pp::Instance, public pp::Graphics3DClient, public * @brief Constructor * @param instance Module instance * @param size Rendering size - * - * Creates double-buffered RGBA canvas with depth and stencil buffers. */ explicit NaClApplication(PP_Instance instance, const Vector2i& size = Vector2i(640, 480)); diff --git a/src/Platform/XEglApplication.h b/src/Platform/XEglApplication.h index c0a12317f..6ded61519 100644 --- a/src/Platform/XEglApplication.h +++ b/src/Platform/XEglApplication.h @@ -27,7 +27,8 @@ namespace Magnum { namespace Platform { /** @brief X/EGL application -Uses EglContextHandler. +Creates window with double-buffered OpenGL ES 2 context. Uses +EglContextHandler. @section XEglApplication-usage Usage @@ -49,8 +50,6 @@ class XEglApplication: public AbstractXApplication { * @param argv Arguments of `main()` function * @param title Window title * @param size Window size - * - * Creates window with double-buffered OpenGL ES 2 context. */ inline XEglApplication(int& argc, char** argv, const std::string& title = "Magnum X/EGL application", const Vector2i& size = Vector2i(800, 600)): AbstractXApplication(new EglContextHandler, argc, argv, title, size) {} };