OpenGL 3.0 support in SDL 1.3?

Hi all,

I was just wondering what the plans are for OpenGL 3.0 support in SDL
now that Creating a GL3 context involves a few more steps than a
1.x/2.x one? NVIDIA has GL 3.0 drivers available for Windows and Linux
and also that the wglCreateContextAttribsARB() and
glxCreateContextAttribsARB() functions are available, will we see GL3
context creation in SVN soon?

Luke.

i didnt think that many cards supported opengl 1.3 yet.On Oct 25, 2008, at 2:52 PM, Luke Benstead wrote:

Hi all,

I was just wondering what the plans are for OpenGL 3.0 support in SDL
now that Creating a GL3 context involves a few more steps than a
1.x/2.x one? NVIDIA has GL 3.0 drivers available for Windows and Linux
and also that the wglCreateContextAttribsARB() and
glxCreateContextAttribsARB() functions are available, will we see GL3
context creation in SVN soon?

Luke.


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

I was just wondering what the plans are for OpenGL 3.0 support in SDL
now that Creating a GL3 context involves a few more steps than a
1.x/2.x one? NVIDIA has GL 3.0 drivers available for Windows and Linux
and also that the wglCreateContextAttribsARB() and
glxCreateContextAttribsARB() functions are available, will we see GL3
context creation in SVN soon?

Yes? I haven’t been paying much attention, but I’ll take a look for SDL 1.3.

Ryan, what’s your opinion?

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment

I to would like to see GL3.0 context support also, as I plan on moving to it
ASAP with SDL.

Thanks> ----- Original Message -----

From: slouken@devolution.com (Sam Lantinga)
To: "A list for developers using the SDL library. (includes SDL-announce)"

Sent: Saturday, October 25, 2008 11:23 PM
Subject: Re: [SDL] OpenGL 3.0 support in SDL 1.3?

I was just wondering what the plans are for OpenGL 3.0 support in SDL
now that Creating a GL3 context involves a few more steps than a
1.x/2.x one? NVIDIA has GL 3.0 drivers available for Windows and Linux
and also that the wglCreateContextAttribsARB() and
glxCreateContextAttribsARB() functions are available, will we see GL3
context creation in SVN soon?

Yes? I haven’t been paying much attention, but I’ll take a look for SDL
1.3.

Ryan, what’s your opinion?

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment


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

Yes? I haven’t been paying much attention, but I’ll take a look for SDL 1.3.

Ryan, what’s your opinion?

I didn’t know there were extra steps to making a GL3 context, so I guess
I wasn’t paying attention either.

I’ll research it.

–ryan.

Basically the idea is (on windows permanently, and for the moment linux):

  1. Create a standard GL 2.1 context
  2. Use wglGetProcAddress or glxGetProcAddress to get a pointer to
    wglCreateContextAttribsARB and glxCreateContextAttribsARB respectively
  3. Create the GL3 context with the new function
  4. Destroy the GL2 one

The other co-maintainer of NeHe (besides me) has written a GLX and
Win32 basecode which creates a GL3 context if you want a reference.
You can find it at:

Luke.

2008/10/28 Ryan C. Gordon :>

Yes? I haven’t been paying much attention, but I’ll take a look for SDL
1.3.

Ryan, what’s your opinion?

I didn’t know there were extra steps to making a GL3 context, so I guess I
wasn’t paying attention either.

I’ll research it.

–ryan.


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

  1. Create a standard GL 2.1 context
  2. Use wglGetProcAddress or glxGetProcAddress to get a pointer to
    wglCreateContextAttribsARB and glxCreateContextAttribsARB respectively
  3. Create the GL3 context with the new function
  4. Destroy the GL2 one

mmm…is that because glXGetProcAddress() needs a valid, current context?

–ryan.

Yeh, that’s the reason. I’m guessing that one day
glxCreateContextAttribs will become core and so we won’t need to use
glXGetProcAddress() to access it. But on Windows that’s not gonna
happen with wglCreateContextAttribsARB… unless Microsoft suddenly
decides that it will start supporting OpenGL properly of course :wink:

Luke.

2008/10/30 Ryan C. Gordon :>

  1. Create a standard GL 2.1 context
  2. Use wglGetProcAddress or glxGetProcAddress to get a pointer to
    wglCreateContextAttribsARB and glxCreateContextAttribsARB respectively
  3. Create the GL3 context with the new function
  4. Destroy the GL2 one

mmm…is that because glXGetProcAddress() needs a valid, current context?

–ryan.


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

The other co-maintainer of NeHe (besides me) has written a GLX and
Win32 basecode which creates a GL3 context if you want a reference.
You can find it at:
http://www.gamedev.net/community/forums/topic.asp?topic_id=512890

I don’t suppose that Mac OS X has OpenGL 3.0 drivers coming anytime soon?

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment

The other co-maintainer of NeHe (besides me) has written a GLX and
Win32 basecode which creates a GL3 context if you want a reference.
You can find it at:
http://www.gamedev.net/community/forums/topic.asp?topic_id=512890

I don’t suppose that Mac OS X has OpenGL 3.0 drivers coming anytime soon?

It looks like it’s going to be about a year on Mac OS X.

I went ahead and updated SDL 1.3 with the latest glext.h that has all
the OpenGL 3.0 extensions, and I or Ryan will be adding 3.0 context
support soon.

I imagine that we’ll probably automatically upgrade the context to 3.0
(with deprecated functionality enabled) whenever it is supported. Can
anyone think of a reason we shouldn’t do that?

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment

I can’t think any reason for OpenGL 3.0, but after they will start to
deprecate funtionalities from the OpenGL version say 3.1 or something
it will matter. So the mechanism should be in place allready.

I think it would also make sense to allow EXCLUDING the deprecated
functionality when creating OpenGL 3.0 and higher contexts.On Tuesday 25 November 2008, Sam Lantinga wrote:

The other co-maintainer of NeHe (besides me) has written a GLX
and Win32 basecode which creates a GL3 context if you want a
reference. You can find it at:
http://www.gamedev.net/community/forums/topic.asp?topic_id=512890

I don’t suppose that Mac OS X has OpenGL 3.0 drivers coming anytime
soon?

It looks like it’s going to be about a year on Mac OS X.

I went ahead and updated SDL 1.3 with the latest glext.h that has all
the OpenGL 3.0 extensions, and I or Ryan will be adding 3.0 context
support soon.

I imagine that we’ll probably automatically upgrade the context to
3.0 (with deprecated functionality enabled) whenever it is supported.
Can anyone think of a reason we shouldn’t do that?

"Can anyone think of a reason we shouldn’t do that?"
What is the current status of the ATI drivers I know they started to
add 3.0 features with there 8.9 release but do not know what stage
they are at.

2008/11/25 Sami N??t?nen <sn.ml at keijukammari.fi>:> On Tuesday 25 November 2008, Sam Lantinga wrote:

The other co-maintainer of NeHe (besides me) has written a GLX
and Win32 basecode which creates a GL3 context if you want a
reference. You can find it at:
http://www.gamedev.net/community/forums/topic.asp?topic_id=512890

I don’t suppose that Mac OS X has OpenGL 3.0 drivers coming anytime
soon?

It looks like it’s going to be about a year on Mac OS X.

I went ahead and updated SDL 1.3 with the latest glext.h that has all
the OpenGL 3.0 extensions, and I or Ryan will be adding 3.0 context
support soon.

I imagine that we’ll probably automatically upgrade the context to
3.0 (with deprecated functionality enabled) whenever it is supported.
Can anyone think of a reason we shouldn’t do that?

I can’t think any reason for OpenGL 3.0, but after they will start to
deprecate funtionalities from the OpenGL version say 3.1 or something
it will matter. So the mechanism should be in place allready.

I think it would also make sense to allow EXCLUDING the deprecated
functionality when creating OpenGL 3.0 and higher contexts.


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

Hello !

"Can anyone think of a reason we shouldn’t do that?"
What is the current status of the ATI drivers I know they started to
add 3.0 features with there 8.9 release but do not know what stage
they are at.

What about older Laptops, they often have
3D cards, but maybe the drivers will not be updated ?

Isn’t there any way to include support for OpenGL 1.3,
2.0 and 3.0 in SDL ?

I don’t think we need a complete driver for 1.3, 2.0 and
3.0 as they all have the basic things like texture blitting, …

Maybe a little include magic is all that is needed ?

CU

Hi Sam,

I guess not. The only company that so far released drivers was NVidia, and
just for Windows/Linux.

Now that the new Macs are using NVidia cards, they might care a bit more and
release OpenGL 3.0
drivers for the Mac as well.

As for ATI, lets see if they fullfill their promisse of having the drivers
available at the begining of the next
year.

Cheers,
PauloOn Tue, Nov 25, 2008 at 9:14 AM, Sam Lantinga wrote:

The other co-maintainer of NeHe (besides me) has written a GLX and
Win32 basecode which creates a GL3 context if you want a reference.
You can find it at:
http://www.gamedev.net/community/forums/topic.asp?topic_id=512890

I don’t suppose that Mac OS X has OpenGL 3.0 drivers coming anytime soon?

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment


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

Sam Lantinga-2 wrote:

The other co-maintainer of NeHe (besides me) has written a GLX and
Win32 basecode which creates a GL3 context if you want a reference.
You can find it at:
http://www.gamedev.net/community/forums/topic.asp?topic_id=512890

I don’t suppose that Mac OS X has OpenGL 3.0 drivers coming anytime soon?

It looks like it’s going to be about a year on Mac OS X.

I went ahead and updated SDL 1.3 with the latest glext.h that has all
the OpenGL 3.0 extensions, and I or Ryan will be adding 3.0 context
support soon.

I imagine that we’ll probably automatically upgrade the context to 3.0
(with deprecated functionality enabled) whenever it is supported. Can
anyone think of a reason we shouldn’t do that?

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment


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

Hello,

As far as I know, both NVidia and ATI support only backwards-compatible
(i.e. with deprecated features) context for the moment. Forward-compatible
(without deprecated features) and Debug contexts aren’t supported yet.

According to the spec
(http://www.opengl.org/registry/specs/ARB/wgl_create_context.txt) and to
summarize a bit :

  • Every flag that isn’t specifically set uses the default value
  • If WGL_CONTEXT_MAJOR_VERSION_ARB < 3, the context returned must support at
    least the version specified and no more than version 2.1, otherwise it must
    support the exact version specified
  • WGL_CONTEXT_FLAGS_ARB is used to specify the kinf of context you want :
    - if WGL_CONTEXT_DEBUG_BIT_ARB bit is set, then a debug context is
    created
    - if WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB bit is set, then a
    forward-compatible (which excludes deprecated functions) context is created
    - the default value for WGL_CONTEXT_FLAGS_ARB (0), creates a
    "normal", backwards-compatible context

Given that, calling :

    wglCreateContext(hDC);

is equivalent to :

    wglCreateContextAttribsARB(hDC, 0, NULL);

which should create a 2.1 context, and :

    int attribs []= {
	 WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
	 WGL_CONTEXT_MINOR_VERSION_ARB, 0, 0
            };
    HGLRC GL_context = wglCreateContextAttribsARB(hDC, 0, attribs);

should be enough to create a 3.0 backwards-compatible (with deprecated
functions enabled) context, and (finally) :

    int attribs []= {
	 WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
	 WGL_CONTEXT_MINOR_VERSION_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB, 0
            };
    HGLRC GL_context = wglCreateContextAttribsARB(hDC, 0, attribs);

should create a 3.0 forward-compatible (which excludes deprecated functions)
context.

Actually, reading back your sentence I realize that you’re asking why the
context shouldn’t be 3.0 by default when the video card’s driver in use
supports it … Hell, I’ve already written the above and it could be useful
for someone so I’ll keep it.

On the subject at hand, I can’t imagine why one would want an old version
context if it can use a 3.0+ backwards-compatible one. We only need a way to
ask for a forward-compatible context if we want one.

Hope that helps.
Trexmaster–
View this message in context: http://www.nabble.com/OpenGL-3.0-support-in-SDL-1.3--tp20167393p20701552.html
Sent from the SDL mailing list archive at Nabble.com.

The other co-maintainer of NeHe (besides me) has written a GLX and
Win32 basecode which creates a GL3 context if you want a reference.
You can find it at:
http://www.gamedev.net/community/forums/topic.asp?topic_id=512890

This looks pretty cool. Is there some 3.0 functionality that I can
plug into the rig and make sure everything is working properly?

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment

Actually I’ve just realized a quick test you could do…

In a GL 2.x context you get the extension string using
glGetString(GL_EXTENSIONS) but that’s been deprecated in GL 3.0 in
favour of glGetStringi(GL_EXTENSIONS, n); where n is a number between
0 and GL_NUM_EXTENSIONS - 1.

So something like:

vector<string> extensionList;

GLint numExtensions = 0;
glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions);     //Get the

extension count
for (int i = 0; i < numExtensions; ++i)
{
string extension = (const char*) glGetStringi(GL_EXTENSIONS, i);
extensionList.push_back(extension); //Add the extension to
the string list
}

Should do it, obviously that is C++ and not C, but you get the idea.
glGetStringi is an entirely new function, if you don’t have a GL 3.0
context, it won’t exist.

Luke.

2008/11/26 Sam Lantinga :>> The other co-maintainer of NeHe (besides me) has written a GLX and

Win32 basecode which creates a GL3 context if you want a reference.
You can find it at:
http://www.gamedev.net/community/forums/topic.asp?topic_id=512890

This looks pretty cool. Is there some 3.0 functionality that I can
plug into the rig and make sure everything is working properly?

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment


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