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.