SDL 1.3 with openGL 3.2 (Linux)

I submitted some full 3.2 support code a while back but still waiting for it to be integrated, which should at least allow the system to fall-back when 3.2 can’t be found.

Have you tried using the normal SDL_opengl.h as opposed to GL3.h? I don’t think this will be the cause of the issue but GL3.h can cause conflicts under certain situations and last time I checked it was still a draft header so may have other issues. It’s perhaps not time yet to adopt it.

The most likely issue is that SDL hasn’t picked up your openGL library, if you look in the wiki there’s commands that will allow you to load it in (SDL_GL_LoadLibrary).

By default in x11 SDL looks for the following:

#define DEFAULT_OPENGL “libGL.so
#elif defined(MACOSX)
#define DEFAULT_OPENGL “/usr/X11R6/lib/libGL.1.dylib”
#elif defined(QNXNTO)
#define DEFAULT_OPENGL “libGL.so.3”
#else
#define DEFAULT_OPENGL “libGL.so.1”
#endif

Cheers

orkaboy wrote:

Hello!

I have a problem with opening OpenGL context on my Linux box. I’m trying to get openGL 3.2 to work, using SDL 1.3 for context/window creation.

My system:
Ubuntu 9.04, 64bit
nVidia GeForce 9800 GTX

Part of glxinfo output:

OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce 9800 GTX/9800 GTX+/PCI/SSE2
OpenGL version string: 3.2.0 NVIDIA 190.42
OpenGL shading language version string: 1.50 NVIDIA via Cg compiler

(Indicating that the 3.2 enabled driver, 190.42, installed using nVidias own installer, works).

I have tried to make a openGL 3.2 context using GLX, which works without problems.
libGL.so points to the correct driver (libGL.so.190.42), so there should not be any parts of the old, Ubuntu-supplied nVidia drivers left on the system.

However, when I try to follow these instructions to test openGL using SDL 1.3 (installed from the newest svn), I run into problems:
http://www.opengl.org/wiki/Tutorial1:Creating_a_Cross_Platform_OpenGL_3.2_Context_in_SDL(C_/_SDL)”

The compilation works without warnings, but when I try to create a context, it fails, giving the following error:
Unable to create window: No OpenGL support in video driver
(Bold part is from SDL_GetError() )

I have tried to write the current SDL version using http://sdl.beuc.net/sdl.wiki/SDL_VERSION :

SDL compile-time version 1.3.0
SDL runtime version 1.3.0

…so there is no problem with my opengl installation, no apparent problem with my SDL installation… yet I get runtime errors, complaining on no driver support.

Any ideas? Using the nVidia drivers supplied in Ubuntu and SDL 1.2, I previously had no problems using opengl through SDL (but then I cant use 3.2).

The problem may be that SDL 1.3 (from subversion) will enable opengl support, during installation, if it finds these 3 includes
/usr/include/GL/gl.h
/usr/include/GL/glx.h
/usr/include/GL/glu.h
but the NVIDIA installer (the last stable is NVIDIA-Linux-x86_64-190.42-pkg2.run) do not put /usr/include/GL/glu.h so you have to supply one (obviously you should not use any glu function, unless you know what you are doing)
:smiley:

SDL includes glu.h in SDL_opengl.h for convenience. Maybe it should be
optional?On Mon, Nov 23, 2009 at 3:34 AM, consultit wrote:

orkaboy wrote:

Hello!

I have a problem with opening OpenGL context on my Linux box. I’m trying to
get openGL 3.2 to work, using SDL 1.3 for context/window creation.

My system:
Ubuntu 9.04, 64bit
nVidia GeForce 9800 GTX

Part of glxinfo output:

OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce 9800 GTX/9800 GTX+/PCI/SSE2
OpenGL version string: 3.2.0 NVIDIA 190.42
OpenGL shading language version string: 1.50 NVIDIA via Cg compiler

(Indicating that the 3.2 enabled driver, 190.42, installed using nVidias
own installer, works).

I have tried to make a openGL 3.2 context using GLX, which works without
problems.
libGL.so points to the correct driver (libGL.so.190.42), so there should
not be any parts of the old, Ubuntu-supplied nVidia drivers left on the
system.

However, when I try to follow these instructions to test openGL using SDL
1.3 (installed from the newest svn), I run into problems:

http://www.opengl.org/wiki/Tutorial1:Creating_a_Cross_Platform_OpenGL_3.2_Context_in_SDL(C_/_SDL)http://www.opengl.org/wiki/Tutorial1:_Creating_a_Cross_Platform_OpenGL_3.2_Context_in_SDL_(C_/_SDL)

The compilation works without warnings, but when I try to create a context,
it fails, giving the following error:
Unable to create window: No OpenGL support in video driver
(Bold part is from SDL_GetError() )

I have tried to write the current SDL version using
http://sdl.beuc.net/sdl.wiki/SDL_VERSION :

SDL compile-time version 1.3.0
SDL runtime version 1.3.0

…so there is no problem with my opengl installation, no apparent problem
with my SDL installation… yet I get runtime errors, complaining on no
driver support.

Any ideas? Using the nVidia drivers supplied in Ubuntu and SDL 1.2, I
previously had no problems using opengl through SDL (but then I cant use
3.2).

The problem may be that SDL 1.3 (from subversion) will enable opengl
support, during installation, if it finds these 3 includes
/usr/include/GL/gl.h
/usr/include/GL/glx.h
/usr/include/GL/glu.h
but the NVIDIA installer (the last stable is
NVIDIA-Linux-x86_64-190.42-pkg2.run) do not put /usr/include/GL/glu.h so you
have to supply one (obviously you should not use any glu function, unless
you know what you are doing)
[image: Very Happy]


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


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

[quote=“Sam Lantinga”]SDL includes glu.h in SDL_opengl.h for convenience.? Maybe it should be optional?

imho it would be better, because glu it is not a core library and it would be not always updated with gl and glx (or wgl) or provided by default (nvidia driver libraries seem not provide any glu function)On Mon, Nov 23, 2009 at 3:34 AM, consultit <@consultit (@consultit)> wrote:

[quote]

orkaboy wrote:


Hello!

I have a problem with opening OpenGL context on my Linux box. I’m trying to get openGL 3.2 to work, using SDL 1.3 for context/window creation.

My system:
Ubuntu 9.04, 64bit
nVidia GeForce 9800 GTX

Part of glxinfo output:

OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce 9800 GTX/9800 GTX+/PCI/SSE2
OpenGL version string: 3.2.0 NVIDIA 190.42
OpenGL shading language version string: 1.50 NVIDIA via Cg compiler

(Indicating that the 3.2 enabled driver, 190.42, installed using nVidias own installer, works).

I have tried to make a openGL 3.2 context using GLX, which works without problems.
libGL.so points to the correct driver (libGL.so.190.42), so there should not be any parts of the old, Ubuntu-supplied nVidia drivers left on the system.

However, when I try to follow these instructions to test openGL using SDL 1.3 (installed from the newest svn), I run into problems:
http://www.opengl.org/wiki/Tutorial1:Creating_a_Cross_Platform_OpenGL_3.2_Context_in_SDL(C_/SDL) (http://www.opengl.org/wiki/Tutorial1:Creating_a_Cross_Platform_OpenGL_3.2_Context_in_SDL%28C/_SDL%29)”

The compilation works without warnings, but when I try to create a context, it fails, giving the following error:
Unable to create window: No OpenGL support in video driver
(Bold part is from SDL_GetError() )

I have tried to write the current SDL version using http://sdl.beuc.net/sdl.wiki/SDL_VERSION (http://sdl.beuc.net/sdl.wiki/SDL_VERSION) :

SDL compile-time version 1.3.0
SDL runtime version 1.3.0

…so there is no problem with my opengl installation, no apparent problem with my SDL installation… yet I get runtime errors, complaining on no driver support.

Any ideas? Using the nVidia drivers supplied in Ubuntu and SDL 1.2, I previously had no problems using opengl through SDL (but then I cant use 3.2).

The problem may be that SDL 1.3 (from subversion) will enable opengl support, during installation, if it finds these 3 includes
/usr/include/GL/gl.h
/usr/include/GL/glx.h
/usr/include/GL/glu.h
but the NVIDIA installer (the last stable is NVIDIA-Linux-x86_64-190.42-pkg2.run) do not put /usr/include/GL/glu.h so you have to supply one (obviously you should not use any glu function, unless you know what you are doing)