Browse Source

Request OpenGL 3.2 rather than 3.3.

Not all 3.x drivers have the latest version, even if it is five years
old.
vectorfields
Vladimír Vondruš 14 years ago
parent
commit
2c0b75df8b
  1. 2
      src/Contexts/GlxContextHandler.cpp
  2. 2
      src/Contexts/GlxContextHandler.h
  3. 2
      src/Contexts/GlxWindowContext.h
  4. 4
      src/Contexts/Sdl2WindowContext.cpp
  5. 2
      src/Contexts/Sdl2WindowContext.h

2
src/Contexts/GlxContextHandler.cpp

@ -67,7 +67,7 @@ void GlxContextHandler::createContext(Window nativeWindow) {
GLint attributes[] = { GLint attributes[] = {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
GLX_CONTEXT_MAJOR_VERSION_ARB, 3, GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
GLX_CONTEXT_MINOR_VERSION_ARB, 3, GLX_CONTEXT_MINOR_VERSION_ARB, 2,
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB, GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
#else #else
GLX_CONTEXT_MAJOR_VERSION_ARB, 2, GLX_CONTEXT_MAJOR_VERSION_ARB, 2,

2
src/Contexts/GlxContextHandler.h

@ -32,7 +32,7 @@ namespace Magnum { namespace Contexts {
/** /**
@brief GLX interface @brief GLX interface
Creates OpenGL 3.3 core context or OpenGL ES 2.0 context, if targetting Creates OpenGL 3.2 core context or OpenGL ES 2.0 context, if targetting
OpenGL ES. OpenGL ES.
Used in GlxWindowContext. Used in GlxWindowContext.

2
src/Contexts/GlxWindowContext.h

@ -38,7 +38,7 @@ class GlxWindowContext: public AbstractXWindowContext {
* @param title Window title * @param title Window title
* @param size Window size * @param size Window size
* *
* Creates window with double-buffered OpenGL 3.3 core context or * Creates window with double-buffered OpenGL 3.2 core context or
* OpenGL ES 2.0 context, if targetting OpenGL ES. * OpenGL ES 2.0 context, if targetting OpenGL ES.
*/ */
inline GlxWindowContext(int& argc, char** argv, const std::string& title = "Magnum GLX window context", const Math::Vector2<GLsizei>& size = Math::Vector2<GLsizei>(800, 600)): AbstractXWindowContext(new GlxContextHandler, argc, argv, title, size) {} inline GlxWindowContext(int& argc, char** argv, const std::string& title = "Magnum GLX window context", const Math::Vector2<GLsizei>& size = Math::Vector2<GLsizei>(800, 600)): AbstractXWindowContext(new GlxContextHandler, argc, argv, title, size) {}

4
src/Contexts/Sdl2WindowContext.cpp

@ -26,9 +26,9 @@ Sdl2WindowContext::Sdl2WindowContext(int, char**, const std::string& name, const
exit(1); exit(1);
} }
/* Request OpenGL 3.3 */ /* Request OpenGL 3.2 */
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
/* Enable double buffering and 24bt depth buffer */ /* Enable double buffering and 24bt depth buffer */
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);

2
src/Contexts/Sdl2WindowContext.h

@ -52,7 +52,7 @@ class Sdl2WindowContext: public AbstractWindowContext {
* @param size Window size * @param size Window size
* *
* Creates centered non-resizable window with double-buffered * Creates centered non-resizable window with double-buffered
* OpenGL 3.3 context with 24bit depth buffer. * OpenGL 3.2 context with 24bit depth buffer.
*/ */
Sdl2WindowContext(int argc, char** argv, const std::string& title = "Magnum SDL2 window context", const Math::Vector2<GLsizei>& size = Math::Vector2<GLsizei>(800, 600)); Sdl2WindowContext(int argc, char** argv, const std::string& title = "Magnum SDL2 window context", const Math::Vector2<GLsizei>& size = Math::Vector2<GLsizei>(800, 600));

Loading…
Cancel
Save