#ifndef ENGINE_H #define ENGINE_H #include #include #include "Camera.h" #include "ShaderProgram.h" #include #include #include #include "Mesh3D.h" #include "Lighting.h" #include "Skybox.h" #include #include #include #include #include #define NBCALLBACKS 1 typedef void (*KeyCallback)(GLFWwindow* window, int key, int scancode, int action, int mods); typedef std::map> Objects3D; static bool gWireframe = false; namespace djalim { class OpenGlEngine{ public: void start(); OpenGlEngine(); OpenGlEngine( const char* title, int width, int height); ~OpenGlEngine(); GLFWwindow* window; int windowWidth; int windowHeight; const double ZOOM_SENSITIVITY = -3.0; const float MOVE_SPEED = 20.0; // units per second const float MOUSE_SENSITIVITY = 0.1f; double previousSeconds = 0.0; double elapsedSeconds; int frameCount = 0; ShaderProgram shaderProgram; ShaderProgram skyboxShaderProgram; FPSCamera Camera = FPSCamera(); glm::mat4 projection; Lighting lighting; Skybox* skybox; Objects3D objects; unsigned int VBO; unsigned int VAO; bool gWireframe = false; void onUpdate(); void loadHints(); void cameraUpdate(); void createObject(std::string name, std::string textures, std::string filepath,bool flip = false); void createObject(std::string name, std::string textures, std::string filepath, glm::vec3 position, glm::vec3 rotation, glm::vec3 scale,bool flip = false); void loadCallbacks(); void showFps(); void onCreate(); void onDestroy(); void draw(Mesh3D* object); }; } #endif // ENGINE_H