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 3 of 3 FirstFirst 123
Results 21 to 27 of 27

Thread: SDL 1.3 and GLEW

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

    Re: SDL 1.3 and GLEW

    @Fugitive: A little tutorial is available here. I just update this wiki page and add a link on the doxygen documentation.

    I plan to write an example using SDL/glut and of course expand the documentation.

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

    Re: SDL 1.3 and GLEW

    It won't run on C++ Builder 2010 Trial Version.
    Code :
    Error: Declaration syntax error
     
    in gl.h:
    WINGDIAPI void APIENTRY glAccum (GLenum op, GLfloat value);

    When doing it manually (without glew, gle etc), the last time I had that conflict was when I tried to include both gl3.h and gl.h at the same time...

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

    Re: SDL 1.3 and GLEW

    This errror is typical when windows.h file is not included before the gl headers (for the symbol WINGDIAPI and APIENTRY).

    In the beginning of gle/gle.hpp (included by gle/gl.h), you can find :
    #ifdef WIN32

    * * * * #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
    * * * * #define WIN32_LEAN_AND_MEAN 1
    * * * * #ifndef NOMINMAX
    * * * * #define NOMINMAX
    * * * * #endif
    * * * * #include <windows.h> // contains all WGL Functions.
    * * * * #endif

    * * * * #include <GL/gl.h>
    * * * * #include <GL/glext.h>
    * * * * #include <GL/wglext.h>
    * * * * //#include <GL/glu.h>

    #elif __MACOSX__

    * * * * #define WINGDIAPI
    * * * * #define APIENTRY
    * * * * #include <GL/gl.h>
    * * * * #include <GL/glext.h>
    * * * * //#include <GL/glu.h>

    * * * * //#include <OpenGL/gl.h>
    * * * * //#include <OpenGL/glext.h>
    * * * * //#include <OpenGL/glu.h>
    * * * *
    #else // POSIX

    * * * * #define __STDC_VERSION__ * * * *199901L
    * * * * #include <GL/gl.h>
    * * * * #include <GL/glext.h>
    * * * * //#include <GL/glx.h>
    * * * * //#include <GL/glxext.h>
    * * * * //#include <GL/glu.h>

    #endif
    So I suspect that the symbol WIN32 is not defined by Turbo C++. Try to add it to the project settings to fix this problem.

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

    Re: SDL 1.3 and GLEW

    ^I thought that I wouldnt have to re-include windows.h since it was already included as you pointed out. Anyhow, I did include it at the top, so thats fine.

    It still doesnt recognize the class functions though. It could be that it doesnt recognize the dll that I converted to Borland format via implib, though I have not had much problems with doing that in the past.

    Code :
    gle::OpenGLExtensionsGen gleContext(std::cout); <== problem
    gleContext.initialize();
    gle::gleSetCurrent( gleContext );
    [BCC32 Error] tutorialMain.cpp(109): E2285 Could not find a match for 'gle::OpenGLExtensionsGen::OpenGLExtensionsGen(ost ream)'

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

    Re: SDL 1.3 and GLEW

    It still doesnt recognize the class functions though. It could be that it doesnt recognize the dll that I converted to Borland format via implib, though I have not had much problems with doing that in the past.
    This is a problem at compilation stage and not at the linking stage. So the dll produced by implib has no influence.
    Have you included the file OpenGLExtensionsGen.hpp using #include <gle/OpenGLExtensionsGen.hpp> ?

  6. #26
    Junior Member Newbie
    Join Date
    May 2010
    Posts
    6

    Re: SDL 1.3 and GLEW

    Hi,

    SDL and glew work fine together. You just have to specify which version of OpenGL you want to use before calling SDL_Init.

    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
    SDL_Init(SDL_INIT_VIDEO);
    ..
    SDL_CreateWindow();
    SDL_GL_CreateContext();
    ..
    glewInit();


    The tutorial (http://www.opengl.org/wiki/Tutorial2..._%28C_/_SDL%29) does not work because it creates a 2.1 OpenGL context and not a 3.2 as planned.

  7. #27
    Junior Member Newbie
    Join Date
    Feb 2011
    Posts
    20

    Re: SDL 1.3 and GLEW

    How exactly glew works?
    After idwakest code, will I get only opengl 3.2 set of functions? Or all supported by driver?

    Eg. how to get OGL4.1 (Core Profile if possible), with SDL and with glew.

Posting Permissions

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