GL 3.x

Does anyone know why SDL 2 might say that OpenGL 3.x isn’t supported? All my drivers are up to date, and my graphics card is a fairly recent model.

That error message is triggered when SDL cannot find the {WGL/GLX}_ARB_create_context_attrib or extension. Any driver that supports OpenGL 3.x should have that extension, but on Windows there’s also a fallback software OpenGL 1.1 driver which is used when you choose a pixel format not supported by your “real” driver.

I guess that’s the reason why you get this error.

Dumb question, but does your card really support OpenGL 3.x? If it does,
can you demonstrate a program that makes use of it? I think the “OpenGL
Extensions Viewer” could fill this role. If you can’t get that to work,
then I’d sooner believe the issue was with drivers/card than with anything
SDL related. Just eliminating variables…it might very well be that SDL2’s
Win32 support is less than awesome, in which I wouldn’t mind looking into
it since I’m fairly familiar with “wgl” code.

PatrickOn Tue, Jun 5, 2012 at 11:00 PM, Ben Merritt wrote:

Does anyone know why SDL 2 might say that OpenGL 3.x isn’t supported? All
my drivers are up to date, and my graphics card is a fairly recent model.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

What people might not realize when talking about OpenGL drivers on Windows
is that Windows Device Manager can’t be relied on to get the real drivers.
You must go to the video card manufacturer website and install the driver
program specific to your video card from there.On Wed, Jun 6, 2012 at 10:42 AM, Patrick Baggett <baggett.patrick at gmail.com>wrote:

Dumb question, but does your card really support OpenGL 3.x? If it does,
can you demonstrate a program that makes use of it? I think the “OpenGL
Extensions Viewer” could fill this role. If you can’t get that to work,
then I’d sooner believe the issue was with drivers/card than with anything
SDL related. Just eliminating variables…it might very well be that SDL2’s
Win32 support is less than awesome, in which I wouldn’t mind looking into
it since I’m fairly familiar with “wgl” code.

Patrick

On Tue, Jun 5, 2012 at 11:00 PM, Ben Merritt wrote:

Does anyone know why SDL 2 might say that OpenGL 3.x isn’t supported? All
my drivers are up to date, and my graphics card is a fairly recent model.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

That’s more-so true for desktops, but not necessarily laptops. Most
laptops use specially signed drivers from their individual manufacturers
which are usually available via windows update.
Even with said, there are some good alternate graphics drivers for most
Ati/Amd and nVidia cards that should work on laptops that usually give you
the best opengl version available (since some cards are limited by their
software implementation/driver).

I’d recommend creating a minimal OpenGL 3.x context, 800x600, r/g/b size 8,
and minimal options. As previously suggested, it may be that your card
does support OpenGL 3.x, but the settings you’re requesting are beyond your
hardware.

Also something worth noting is that some graphics drivers will give a
higher version number than what is requested. For instance, on my laptop
with an AMD Radeon HD 6650M, if I ask for a simple OpenGL 1.1 context, when
I check the version using glGetString(GL_VERSION), and it says I’m using a
4.x compatibility context.

If you think this is an issue with SDL, you should try using GLEW
http://glew.sourceforge.net/ or
GLee http://elf-stone.com/glee.php. If those give you the appropriate
context version, then it’s possible that SDL isn’t accessing wgl properly,
but I have my suspicion that it’s more likely a hardware issue or badly
structured code on your end (don’t worry, it happens to the best of us :D).

Hopefully that gives you some options to explore.
-AlexOn Wed, Jun 6, 2012 at 1:39 PM, Chris Bush wrote:

What people might not realize when talking about OpenGL drivers on Windows
is that Windows Device Manager can’t be relied on to get the real drivers.
You must go to the video card manufacturer website and install the driver
program specific to your video card from there.

On Wed, Jun 6, 2012 at 10:42 AM, Patrick Baggett < baggett.patrick at gmail.com> wrote:

Dumb question, but does your card really support OpenGL 3.x? If it does,
can you demonstrate a program that makes use of it? I think the “OpenGL
Extensions Viewer” could fill this role. If you can’t get that to work,
then I’d sooner believe the issue was with drivers/card than with anything
SDL related. Just eliminating variables…it might very well be that SDL2’s
Win32 support is less than awesome, in which I wouldn’t mind looking into
it since I’m fairly familiar with “wgl” code.

Patrick

On Tue, Jun 5, 2012 at 11:00 PM, Ben Merritt wrote:

Does anyone know why SDL 2 might say that OpenGL 3.x isn’t supported?
All my drivers are up to date, and my graphics card is a fairly recent
model.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Looks like it was my pixel format. I didn’t realize how picky drivers can be about that. It seems to be working now. I hope this is the last time I break my code in such a simple yet subtle way… Probably not.

MrOzBarry wrote:

Also something worth noting is that some graphics drivers will give a higher version number than what is requested. ?For instance, on my laptop with an AMD Radeon HD 6650M, if I ask for a simple OpenGL 1.1 context, when I check the version using?glGetString(GL_VERSION), and it says I’m using a 4.x compatibility context.

The OpenGL Specs say that the OpenGL server (i.e. the driver) should always create a context of the highest version that it supports and that is also upward compatible to the version requested by the client. All OpenGL version so far are upward compatible to their predecessors (if they support the compatibility profile).

That also means it is legal to request e.g. a 1.1 context, check the returned GL_VERSION string and if it’s 4.0 or higher, use the tesselation shader functions defined in version 4.0. You don’t need to create a new context with requested version 4.0 for that !