summaryrefslogtreecommitdiffstats
path: root/include/Core.hpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-07-24 16:52:24 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-07-24 16:52:24 +0200
commit6a00886804c53883d919f008f6ec47a574d86607 (patch)
tree2dbe9fdb0a0d5f068770d49a3c960d36958f27d5 /include/Core.hpp
parent2017-07-21 (diff)
downloadAltCraft-6a00886804c53883d919f008f6ec47a574d86607.tar
AltCraft-6a00886804c53883d919f008f6ec47a574d86607.tar.gz
AltCraft-6a00886804c53883d919f008f6ec47a574d86607.tar.bz2
AltCraft-6a00886804c53883d919f008f6ec47a574d86607.tar.lz
AltCraft-6a00886804c53883d919f008f6ec47a574d86607.tar.xz
AltCraft-6a00886804c53883d919f008f6ec47a574d86607.tar.zst
AltCraft-6a00886804c53883d919f008f6ec47a574d86607.zip
Diffstat (limited to 'include/Core.hpp')
-rw-r--r--include/Core.hpp95
1 files changed, 0 insertions, 95 deletions
diff --git a/include/Core.hpp b/include/Core.hpp
deleted file mode 100644
index 8d60ff6..0000000
--- a/include/Core.hpp
+++ /dev/null
@@ -1,95 +0,0 @@
-#pragma once
-
-#include <iomanip>
-#include <tuple>
-
-#include <easylogging++.h>
-#include <SFML/Window.hpp>
-#include <GL/glew.h>
-#include <glm/gtc/type_ptr.hpp>
-
-#include <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 = 1;
-
- RenderState renderState;
-
- double tickRate = 0;
- double sectionRate = 0;
-
-public:
- Core();
-
- ~Core();
-
- void Exec();
-};