-
OpenGL Framework C++
Apologies if this is really obvious but I have tried a google search for an answer but can't seem to find one.
What I essentially want to do is define a class say MainApp, which would control the program execution with a set of methods such as MainApp::draw(), MainApp::update() and MainApp::resize() which would draw and handle mouse and keyboard input and changes to the window. I've only ever set up OpenGL using the glutDisplayFunc(display), glutKeyboardFunc(keyboard), and glutReshapeFunc(reshape) functions in main() and don't know how to move these into class methods?
I did find some frameworks available but they seemed to be more functions to control OpenGL and not a class in their own right.
Any help would be much appreciated.
-
Not quite sure what you are getting at but i would offer FLTK - It provides a good context for openGL / GLUT with the ability to subclass the library's built in GL support, basically you can roll your own, check the docs to see if it is what you are looking for.
-
It sounds more like you need something like SFML, which you can see in action in this tutorial.
It's a 2D game engine, built over top of OpenGL.