diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-08-19 17:20:51 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-08-19 17:20:51 +0200 |
commit | f24107368fa47f911f4491f644ff3755525c91e1 (patch) | |
tree | 02dc3583ed82d81139b17191af9a9bfae40c45a9 /old/core/Core.hpp | |
parent | 2017-08-18 (diff) | |
download | AltCraft-f24107368fa47f911f4491f644ff3755525c91e1.tar AltCraft-f24107368fa47f911f4491f644ff3755525c91e1.tar.gz AltCraft-f24107368fa47f911f4491f644ff3755525c91e1.tar.bz2 AltCraft-f24107368fa47f911f4491f644ff3755525c91e1.tar.lz AltCraft-f24107368fa47f911f4491f644ff3755525c91e1.tar.xz AltCraft-f24107368fa47f911f4491f644ff3755525c91e1.tar.zst AltCraft-f24107368fa47f911f4491f644ff3755525c91e1.zip |
Diffstat (limited to 'old/core/Core.hpp')
-rw-r--r-- | old/core/Core.hpp | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/old/core/Core.hpp b/old/core/Core.hpp deleted file mode 100644 index aaa143f..0000000 --- a/old/core/Core.hpp +++ /dev/null @@ -1,95 +0,0 @@ -#pragma once - -#include <iomanip> -#include <tuple> - -#include <easylogging++.h> -#include <GL/glew.h> -#include <glm/gtc/type_ptr.hpp> -#include <SFML/Window.hpp> - -#include "../world/GameState.hpp" -#include "AssetManager.hpp" -#include "../graphics/Shader.hpp" -#include "../graphics/Gui.hpp" -#include "../graphics/RenderSection.hpp" -#include "../network/NetworkClient.hpp" - -struct MyMutex { - std::mutex mtx; - std::string str; - MyMutex(std::string name); - void lock(); - void unlock(); -}; - -class Core { - GameState *gameState; - NetworkClient *client; - sf::Window *window; - AssetManager *assetManager; - bool isMouseCaptured = false; - bool isRunning = true; - enum { - MainMenu, - Loading, - Playing, - PauseMenu, - } currentState = Playing; - float mouseXDelta, mouseYDelta; - float deltaTime; - float absTime; - - void RenderWorld(); - - void HandleMouseCapture(); - - void HandleEvents(); - - void InitSfml(unsigned int WinWidth, unsigned int WinHeight, std::string WinTitle); - - void InitGlew(); - - void SetMouseCapture(bool IsCaptured); - - void PrepareToRendering(); - - void RenderFrame(); - - unsigned int width(); - - unsigned int height(); - - void UpdateChunksToRender(); - - void UpdateGameState(); - - void UpdateSections(); - - std::thread gameStateLoopThread; - std::thread sectionUpdateLoopThread; - - Shader *shader; - //Cube verticies, Cube VAO, Cube UVs, TextureIndexes UboTextureIndexes, TextureData UboTextureIndexes, TextureData2 UboTextureIndexes, Blocks VBO, Models VBO, Line VAO, Lines VBO - bool isRendersShouldBeCreated=false; - std::condition_variable waitRendersCreated; - std::vector<Vector> renders; - std::mutex toRenderMutex; - std::vector<Vector> toRender; - std::map<Vector, RenderSection> availableChunks; - std::mutex availableChunksMutex; - - int ChunkDistance = 3; - - RenderState renderState; - - double tickRate = 0; - double sectionRate = 0; - -public: - Core(); - - ~Core(); - - void Exec(); -}; |