Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: SDL 1.3 and GLEW

  1. #1
    Junior Member Regular Contributor
    Join Date
    Aug 2009
    Posts
    130

    SDL 1.3 and GLEW

    Hi,

    I just installed SDL 1.3, and it runs fine with non-deprecated old-school OpenGL functions. The new functions give an error.

    Does that mean we still need GLEW etc to do extension handling for us?

    I used to do this manually like this in the past:
    Code :
    PFNGLCREATESHADERPROC glCreateShader;
    glCreateShader = (PFNGLCREATESHADERPROC) wglGetProcAddress("glCreateShader");

    but that doesnt work with the GL3.h header so I'm guessing the function pointer return-types have changed.

    I thought SDL 1.3 would make that ugly platform specific code obsolete, but it looks like not...

    Kind regards,
    Fugi

  2. #2
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    936

    Re: SDL 1.3 and GLEW

    SDL 1.3 is not going to fix this ugly platform specific code obsolete ... unfortunately!

    GLEW is quite unmaintained so in anyway we are quite struggling here...

    The best I get by now is SDL + GLEW to load OpenGL 2.1 functions. for the rest, I do it myself.

    When creating an OpenGL 3.2 context on nVidia, the OpenGL 3.0 functions are not loaded... When creating an OpenGL 3.1 context on nVidia, the OpenGL 3.1 functions are loaded. Works fine on ATI, I don't know about S3.

    It would be nice to have a official library or one developed by AMD or nVidia.

    I plan to make one but that's some more do to!

  3. #3
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: SDL 1.3 and GLEW

    Quote Originally Posted by Groovounet
    GLEW is quite unmaintained so in anyway we are quite struggling here...
    What do you mean ?
    There is GL 3.2 support on glew, last version updated end of february, so I wonder what would be something more maintained ?
    http://glew.sourceforge.net/

  4. #4
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    936

    Re: SDL 1.3 and GLEW

    Something that works for example?

    I tried as soon as I could GLEW 1.5.3 to see if it fix the nVidia OpenGL 3.2 context problem but it doesn't.

    nVidia OpenGL 3.2 context => glGetError() != GL_NO_ERROR after glewInit() => OpenGL 2.1 functions loaded only.

    What went wrong? I think I explicitly ask SDL for an OpenGL 3.2 context instead of letting it find one. Why? Because according to a guy, who work on Wine that report the problem to me using one of why project for testing, creating an OpenGL context using the higher OpenGL version it's a standard, just a use of nVidia but there is somewhere (yes I forgot where...) it's specify that this default context should be OpenGL 2.1...

    Nightmare nightmare nightmare
    --SDL--+--GLEW--+--Drivers--

    I suspect the problem come from GLEW as GLEW generate an error. However, I actually start to have this issue after an update of my nVidia drivers. SDL is not so maintained either so maybe?

    Basically, GLEW is maintained by one guy called Nigel and I really thank him for that. This guy just used to fix GLEW bugs and as nobody else taking care of GLEW, he quiet manage it now. I submit files to support OpenGL 3.1 and 3.2 months before GLEW 1.5.2 get released and he end up to do the work. A trouble with GLEW is that it can't generate the source files on a platform different than Linux (probably with a specific setup). I tried with MSys, Cygwin, MacOS X... it didn't worked. Unfortunate as GLEW mainly aim Windows.

    I'm still using it but I would be glade to have an alternative.

  5. #5
    Junior Member Newbie
    Join Date
    Oct 2009
    Posts
    15

    Re: SDL 1.3 and GLEW

    There is another library to manage extensions, GLee.

    http://elf-stone.com/glee.php

  6. #6
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    936

    Re: SDL 1.3 and GLEW

    OpenGL 3.0... Unmaintained...

  7. #7
    Junior Member Regular Contributor
    Join Date
    Aug 2009
    Posts
    130

    Re: SDL 1.3 and GLEW

    So, how would you do it manually?

    As I said, I did it manually without SDL using the wglGetProcAddress but SDL doesnt like it. I suppose I should be using SDL_GL_GetProcAddress like mentioned here: http://sdl.beuc.net/sdl.wiki/SDL_GL_GetProcAddress

    But that requires using a variable with a 'different' name than the original function, so something like glCreateShader would have to be named glCreateShader_ptr.

    Could someone outline some simple steps for how they load the extensions manually, using original function names as defined in GL3.h?

    Kind regards,
    Fugi

  8. #8
    Junior Member Regular Contributor
    Join Date
    Aug 2009
    Posts
    130

    Re: SDL 1.3 and GLEW

    BTW, Glee is not unmaintained. It was updated only a few months ago. OpenGL is changing faster than anyone can keep up unfortunately.

  9. #9
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    936

    Re: SDL 1.3 and GLEW

    What I do with GLEW is:
    glCreateShader = (PFNGLCREATESHADERPROC)wglGetProcAddress ("glCreateShader");

    Directly because most of the function pointers are declared, just null sometimes when they should not.

    Sometimes, pointers are declared and I get an error "glCreateShader unknowned identifier" so I declare them:
    PFNGLCREATESHADERPROC glCreateShader = 0;

    That's pretty much it.

  10. #10
    Junior Member Newbie
    Join Date
    Aug 2009
    Location
    France
    Posts
    11

    Re: SDL 1.3 and GLEW

    I maintain a library named gle that seems quite similar to GLEW, glee...
    Ready to use package for developer is not actually provided. But, i can do it at least for Visual C++ 2008 quickly.
    Or i can write the documentation explaining how to build the library if needed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •