#ifndef ENGINE_H #define ENGINE_H #include #include #include "ShaderProgram.h" #include "Texture2D.h" #include #include #include #define NBCALLBACKS 1 typedef void (*KeyCallback)(GLFWwindow* window, int key, int scancode, int action, int mods); struct Object3D { Texture2D texture; GLuint VBO; GLuint VAO; }; typedef std::map Objects3D; static bool gWireframe = false; namespace djalim { class OpenGlEngine{ public: void start(); OpenGlEngine( const char* title, int width, int height); ~OpenGlEngine(); GLFWwindow* window; double previousSeconds = 0.0; double elapsedSeconds; int frameCount = 0; std::map textures; ShaderProgram shaderProgram; Objects3D objects; unsigned int VBO; unsigned int VAO; bool gWireframe = false; void onUpdate(); void loadHints(); void createObject(std::string name, std::string textures, std::vector& vertices); void loadCallbacks(); void showFps(); void onCreate(); void onDestroy(); }; } #endif // ENGINE_H