Using GLEW to use OpenGL extensions under Windows

后端 未结 3 1068
日久生厌
日久生厌 2020-11-30 00:40

I\'ve been using OpenGL extensions on Windows the painful way. Is GLEW the easier way to go? How do I get started with it?

3条回答
  •  猫巷女王i
    2020-11-30 01:16

    Personally I wouldn't use an exit command.

    I would throw an exception so you can clear any other initialisation up at the end of the function.

    ie:

    try
    {
        // init opengl/directx
        // init directaudio
        // init directinput
    
        if (GLEW_OK != glewInit())
        {
            throw std::exception("glewInit failed");
        }
    }
    catch ( const std::exception& ex )
    {
        // message to screen using ex.what()
        // clear up
    }
    

    And I agree with OJ - if you want to write tutorials for others, then this is really the wrong place for it. There are already a load of good places for opengl tutorials. Try this one for instance.

提交回复
热议问题