Menu

The GLFW LIbrary Is Not Initialized

Using GLFW
scooperly
2015-02-18
2015-03-17
  • scooperly

    scooperly - 2015-02-18

    I have supposedly initialized GLFW at the begging of my Main call, but when I try to do an OpenGL call from a separate class that I have passed the GFLWwindow context to it gives me "the glfw library is not initialized" error on every draw loop, even though at the beginning of each function I check for !glfwInit()

    Details:
    Using GLFW 3.0.4
    64-bit C++ Application
    Only using fixed function OpenGL calls

     
  • Bastiaan Olij

    Bastiaan Olij - 2015-03-14

    I'm not sure if you are supposed to call glfwInit multiple times?

     
  • arampl

    arampl - 2015-03-17

    Look here. My be your problem is this:

    https://www.opengl.org/wiki/Common_Mistakes (#2)

    Excerpt:

    "...Do not use constructors/destructors to initialize/destroy OpenGL objects. Instead, use member functions of these classes for these purposes. This violates RAII principles, so this is not the best course of action.
    Have your OpenGL object constructors throw an exception if a context has not been created yet. This requires an addition to your context creation functionality that tells your code when a context has been created and is active.
    Create a class that owns all other OpenGL related objects. This class should also be responsible for creating the context in its constructor..."