Hi all,

I am trying so use GLEW with in an fltk window...
it works fine under windows, but underlinux, I don't know for which reason, it 
just doesn't work...

does anyone have any experience of FLTK+GLEW ?
should I use GLEW_MX preprocessor command to tell glew that I may have 
different opengl context?


here is the code I've placed just after the
        void draw(){
                if ( !valid() ) {
                        valid(1);
                        Fl::gl_visual(FL_RGB|FL_DOUBLE|FL_DEPTH);



                        GLenum err = glewInit();
                        if (GLEW_OK != err){
                                fprintf(stderr, "Problem with GLEW 
Initialisation:\n");
                                fprintf(stderr, "Error: %s\n", 
glewGetErrorString(err));
                        }

                        if(GL_ARB_vertex_buffer_object){
                           fprintf(stdout,"VBO SUPPORTED\n");
                        }

                        if (glewGetExtension("glGenBuffersARB")!=GL_TRUE){
                            std::cout<<"GetExtension:glGenBuffersARB failed\n";
                        }


                        #ifdef linux
                        if(!glGenBuffersARB   ){glGenBuffersARB    = 
(PFNGLGENBUFFERSARBPROC   )glXGetProcAddress((const 
GLubyte*)"glGenBuffersARB");      std::cout<<"glew failed\n";}
                        if(!glBindBufferARB   ){glBindBufferARB    = 
(PFNGLBINDBUFFERARBPROC   )glXGetProcAddress((const 
GLubyte*)"glBindBufferARB");      std::cout<<"glew failed\n";}
                        if(!glBufferDataARB   ){glBufferDataARB    = 
(PFNGLBUFFERDATAARBPROC   )glXGetProcAddress((const GLubyte*)"glBufferDataARB 
");     std::cout<<"glew failed\n";}
                        if(!glDeleteBuffersARB){glDeleteBuffersARB = 
(PFNGLDELETEBUFFERSARBPROC)glXGetProcAddress((const 
GLubyte*)"glDeleteBuffersARB");   std::cout<<"glew failed\n";}
                        #endif


                        if(!glGenBuffersARB   )std::cout << "glGenBuffersARB    
is not well loaded\n";
                        if(!glBindBufferARB   )std::cout << "glBindBufferARB    
is not well loaded\n";
                        if(!glBufferDataARB   )std::cout << "glBufferDataARB    
is not well loaded\n";
                        if(!glDeleteBuffersARB)std::cout << "glDeleteBuffersARB 
is not well loaded\n";


...


}

as you can see from this code, I've made many tests,the printout of these is:
VBO SUPPORTED
GetExtension:glGenBuffersARB failed
glew failed
glew failed
glew failed
glew failed

which seems to indicate that when I use the simple glXGetProcAddress, I am able 
to get the pointer of the function...
but not when using glew's API

any idea?

thanks a lot for help,
Loic





_______________________________________________
fltk-opengl mailing list
fltk-opengl@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-opengl

Reply via email to