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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"...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..."
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
I'm not sure if you are supposed to call glfwInit multiple times?
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..."