summaryrefslogtreecommitdiffstats
path: root/src/Render.hpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-08-29 17:25:30 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-01-13 03:39:31 +0100
commita0d5862d99186f317a0f7364e8b6cd3cfeccfdf1 (patch)
tree7bf54f8141c513650130e8d3cc6bd8ce3f71b1fe /src/Render.hpp
parent2017-08-27 (diff)
downloadAltCraft-a0d5862d99186f317a0f7364e8b6cd3cfeccfdf1.tar
AltCraft-a0d5862d99186f317a0f7364e8b6cd3cfeccfdf1.tar.gz
AltCraft-a0d5862d99186f317a0f7364e8b6cd3cfeccfdf1.tar.bz2
AltCraft-a0d5862d99186f317a0f7364e8b6cd3cfeccfdf1.tar.lz
AltCraft-a0d5862d99186f317a0f7364e8b6cd3cfeccfdf1.tar.xz
AltCraft-a0d5862d99186f317a0f7364e8b6cd3cfeccfdf1.tar.zst
AltCraft-a0d5862d99186f317a0f7364e8b6cd3cfeccfdf1.zip
Diffstat (limited to '')
-rw-r--r--src/Render.hpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/Render.hpp b/src/Render.hpp
index b7d12d0..0b67218 100644
--- a/src/Render.hpp
+++ b/src/Render.hpp
@@ -1,21 +1,35 @@
#pragma once
-#include <SFML/Window.hpp>
+#include <SDL.h>
#include "Shader.hpp"
#include "RendererWorld.hpp"
-#include "RendererWidget.hpp"
class Render {
- sf::Window *window;
+ SDL_Window *window;
+ SDL_GLContext glContext;
+
+ bool renderGui = false;
bool isRunning = true;
bool isMouseCaptured = false;
+ int prevMouseX, prevMouseY;
float mouseXDelta, mouseYDelta;
std::unique_ptr<RendererWorld> world;
bool renderWorld = false;
RenderState renderState;
LoopExecutionTimeController timer;
- std::map<sf::Keyboard::Key, bool> isKeyPressed;
+ std::map<SDL_Scancode, bool> isKeyPressed;
+ bool HasFocus=true;
+ float sensetivity = 0.1f;
+
+ enum GlobalState {
+ InitialLoading,
+ MainMenu,
+ Loading,
+ Playing,
+ Paused,
+ } state = InitialLoading;
+ std::string stateString;
void SetMouseCapture(bool IsCaptured);
@@ -32,6 +46,8 @@ class Render {
void PrepareToRendering();
void UpdateKeyboard();
+
+ void RenderGui();
public:
Render(unsigned int windowWidth, unsigned int windowHeight, std::string windowTitle);
~Render();