GLeeGetExtensions access violation

When I run this block of code:


    glLineWidth(1.0f);
    glBegin(GL_LINES);
    
        glColor3ub(255, 0, 0);
        glVertex3d(0.0, 0.0, 0.0);
        glVertex3d(10.0, 0.0, 0.0);
        
        glColor3ub(0, 255, 0);
        glVertex3d(0.0, 0.0, 0.0);
        glVertex3d(0.0, 10.0, 0.0);
        
        glColor3ub(0, 0, 255);
        glVertex3d(0.0, 0.0, 0.0);
        glVertex3d(0.0, 0.0, 10.0);
    
    glEnd();
    
    glColor3ub(0, 0, 0);

I must include the glColor3ub() after the glEnd() before I get to a later glMultiDrawElements() call.

Otherwise, I get an access violation exception from the function GLeeGetExtensions() in GLee.c. I am using GLee version 5.4. In GLee documentation I found that a fix was added in version 5.32 to fix a potential access violation exception in GLeeGetExtensions(). The code appears to work if I keep the glColor3ub() call, however this is very unstable. Please help.

Thank you,
Robert

Please help.

Thank you,
Robert

Please help.

Thank you,
Robert

Please help.

Thank you,
Robert

I still don’t understand the problem I was having before. But I have since switched to using GLEW, and I know longer have the odd program crash. GLEW does not have lazy initialization, therefore I must call glewInit() each time I switch to a different rendering context. A call to glewInit() appears to take a long time to complete, which is not a surprise considering what it does. This lenghthy call should not be an issue as long as I don’t switch contexts very frequently.

Would someone please comment on GLEE vs GLEW? I would really appreciate a response.

I only used GLEW.

Like ZbuffeR i am used to GLEW, but if the last version of Glee is buggy you can try to use a previous one if possible. The ultimate solution is to make the effort to write your own extension loader and load only the extensions you need. It is not that bad.