Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #define GLEW_STATIC
- #include <vector>
- #include "GL/glew.h"
- #include "GLFW/glfw3.h"
- #include "utilities.h"
- static class Engine
- {
- public:
- int Initialize(int framerate = 30, int screenWidth = 640, int screenHeight = 480, std::string titleBarText = "My OpenStellar Game", bool fullscreen = false, bool resizable = false, Color splashcolor = Color(1.0f, 0.0f, 0.0f, 1.0f), bool shouldDrawSplash = true, GLuint glClearMode = GL_COLOR_BUFFER_BIT, int openGLVersionMajor = 3, int openGLVersionMinor = 3, GLuint profile = GLFW_OPENGL_CORE_PROFILE, GLuint compatiblity = GL_TRUE, int intervalToSwap = 0);
- void Start();
- void Stop();
- void setPause(bool pause);
- bool getIfPaused();
- void changeSplashColor(float r, float g, float b, float a);
- void changeSplashColor(Color splashColor);
- Color getSplashColor();
- float getRed();
- float getGreen();
- float getBlue();
- float getAlpha();
- void setShouldDrawSplashColor(bool drawOrNot);
- bool getShouldDrawSplashColor();
- bool addRoom(RoomInfo room);
- bool removeRoom(std::string name);
- Room* getCurrentRoom();
- bool addTexture(TextureInfo texture);
- TextureInfo* getTexture(std::string textureName);
- void setRoomLoadingOnDemand(Demand getRoomsOnDemand);
- Demand getRoomLoadingOnDemand();
- void setTextureLoadingOnDemand(Demand setTexturesOnDemand);
- Demand getTextureLoadingOnDemand();
- void setFrameRate(int fps);
- int getFrameRate();
- bool readyForFrame;
- void setSwapInterval(int interval);
- int getSwapInterval();
- double getDeltaTime();
- private:
- bool GLFWinitialize();
- std::vector<Room> refreshRoomRunOrder();
- int screenWidth;
- int screenHeight;
- std::string screenTitle;
- GLFWmonitor* screenFullscreen;
- GLuint screenResizable;
- Color screenSplashColor;
- GLuint screenClearMode;
- bool screenSplashColorShouldDraw;
- int screenGLVersionMajor;
- int screenGLVersionMinor;
- GLuint screenProfile;
- GLuint screenCompatability;
- int fps;
- bool pause;
- std::vector<RoomInfo> rooms;
- std::vector<TextureInfo> textures;
- bool roomsOnDemand;
- bool texturesOnDemand;
- int swapInterval;
- GLFWwindow* window;
- double deltaTime;
- double lastFrame;
- int curFrame;
- Demand textureLoadingOnDemand;
- Demand roomLoadingOnDemand;
- bool gameHasStarted;
- bool engineIsInitialized = false;
- int textureIdIncrement;
- int roomIdIncrement;
- Room currentRoom;
- protected:
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement