Menu

LoadFunctions() causes Unhandled Exception

Problems
HunterAP
2013-11-06
2013-12-18
  • HunterAP

    HunterAP - 2013-11-06

    I just started using the OpenGL SDK, and have been running into an issue. Even with a basic project, I am getting an unhandled exception when the LoadFunctions() method is called.

    I have followed the debug trail to the ParseVersionFromString() method.

    The value for (const char*)_funcptr_glGetString(GL_VERSION)) is being passed in as NULL.

    A seemingly valid pointer is being returned from IntGetProcAddress("glGetString");
    _funcptr_glGetString 0x59a93ced {opengl32.dll!_glGetString@4} const unsigned char * (unsigned int) *

    I'm using Visual Studio 2012 on Windows 7 64 bit. I'm compiling the library as a 32bit static, and I've tried both release and debug configurations.

    Here's my source: (the includes are within < > blocks, but the code highlighting doesn't seem to like that)

    #include "glload\gl_3_3.hpp"
    #include "glload\gl_load.hpp"
    
    #pragma comment(lib, "opengl32.lib")
    #pragma comment(lib, "glloadD.lib")
    
    int main()
    {
        glload::LoadFunctions();
    };
    

    Any help would be appreciated.

     

    Last edit: HunterAP 2013-11-06
  • Wouter Saaltink

    Wouter Saaltink - 2013-12-18

    Not sure if you solved this already, but you need a OpenGL context for LoadFunctions() to work. So open a window for your platform, open a gl context for this window and then call glload::LoadFunctions();

    hope it helps,

    wouter

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.