Browse Source

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?
pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
ef75989178
  1. 7
      src/Platform/GlutApplication.h
  2. 6
      src/Platform/GlxApplication.h
  3. 6
      src/Platform/GlxContextHandler.cpp
  4. 6
      src/Platform/GlxContextHandler.h
  5. 5
      src/Platform/NaClApplication.h
  6. 5
      src/Platform/XEglApplication.h

7
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));

6
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) {}
};

6
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,

6
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<Display*, VisualID, Window> {
public:

5
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));

5
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) {}
};

Loading…
Cancel
Save