diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-05-21 16:07:50 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-05-21 16:07:50 +0200 |
commit | 305efbfdc5fb5c05c9b72aa0bee6a3ae1983de36 (patch) | |
tree | 53fb36abafba8712c66a23829a95e84b85c98c50 /src/core/Core.hpp | |
parent | 2017-05-18 (diff) | |
download | AltCraft-305efbfdc5fb5c05c9b72aa0bee6a3ae1983de36.tar AltCraft-305efbfdc5fb5c05c9b72aa0bee6a3ae1983de36.tar.gz AltCraft-305efbfdc5fb5c05c9b72aa0bee6a3ae1983de36.tar.bz2 AltCraft-305efbfdc5fb5c05c9b72aa0bee6a3ae1983de36.tar.lz AltCraft-305efbfdc5fb5c05c9b72aa0bee6a3ae1983de36.tar.xz AltCraft-305efbfdc5fb5c05c9b72aa0bee6a3ae1983de36.tar.zst AltCraft-305efbfdc5fb5c05c9b72aa0bee6a3ae1983de36.zip |
Diffstat (limited to 'src/core/Core.hpp')
-rw-r--r-- | src/core/Core.hpp | 59 |
1 files changed, 56 insertions, 3 deletions
diff --git a/src/core/Core.hpp b/src/core/Core.hpp index 5348e4e..a877613 100644 --- a/src/core/Core.hpp +++ b/src/core/Core.hpp @@ -1,16 +1,69 @@ #pragma once +#include <easylogging++.h> +#include <SFML/Window.hpp> +#include <GL/glew.h> +#include <iomanip> +#include <glm/gtc/type_ptr.hpp> #include "../gamestate/GameState.hpp" #include "../network/NetworkClient.hpp" -#include <easylogging++.h> - +#include "../gui/Gui.hpp" +#include "../graphics/Camera3D.hpp" +#include "../graphics/Shader.hpp" +#include "../graphics/AssetManager.hpp" class Core { GameState *gameState; NetworkClient *client; + sf::Window *window; + bool isMouseCaptured = false, isRunning = true; + enum { + MainMenu, + Loading, + Playing, + PauseMenu, + } currentState = Playing; + float mouseXDelta, mouseYDelta; + float deltaTime; + float absTime; + + void RenderWorld(World &Target); + + void RenderGui(Gui &Target); + + void HandleMouseCapture(); + + void HandleEvents(); + + void InitSfml(unsigned int WinWidth, unsigned int WinHeight, std::string WinTitle); + + void InitGlew(); + + void SetMouseCapture(bool IsCaptured); + + void PrepareToWorldRendering(); + + void RenderFrame(); + + unsigned int width(); + + unsigned int height(); + + void UpdateChunksToRender(); + + void UpdateGameState(); + + std::thread gameStateLoopThread; + + Camera3D camera; + Shader *shader; + GLuint VBO, VAO, VBO2; + std::vector<Vector> toRender; public: Core(); + ~Core(); - void MainLoop(); + + void Exec(); }; |