#pragma once #include #include #include #include #include #include "Utility.hpp" #include "Event.hpp" #include "Gal.hpp" class Gbuffer; class TextureFbCopy; class RendererWorld; class RmlRenderInterface; class RmlSystemInterface; class RmlFileInterface; namespace Rml { class Context; } class Render { SDL_Window *window; SDL_GLContext glContext; bool renderGui = false; bool isMouseCaptured = false; int prevMouseX=0, prevMouseY=0; float mouseXDelta=0.0f, mouseYDelta=0.0f; std::unique_ptr world; bool renderWorld = false; size_t windowWidth, windowHeight; std::map isKeyPressed; bool HasFocus=true; float sensetivity = 0.1f; bool isWireframe = false; std::unique_ptr resizeTextureCopy; std::unique_ptr fbTextureCopy; std::shared_ptr fbTextureColor; std::shared_ptr fbTextureDepthStencil; std::shared_ptr fbTarget; std::unique_ptr gbuffer; EventListener listener; std::string stateString; std::unique_ptr rmlRender; std::unique_ptr rmlSystem; std::unique_ptr rmlFile; Rml::Context* rmlContext; unsigned short sdlKeyMods = 0; bool hideRml = false; size_t renderBuff = 0; void SetMouseCapture(bool IsCaptured); void HandleMouseCapture(); void HandleEvents(); void InitSdl(unsigned int WinWidth, unsigned int WinHeight, std::string WinTitle); void InitGlew(); void RenderFrame(); void PrepareToRendering(); void UpdateKeyboard(); void RenderGui(); void InitEvents(); void InitRml(); public: Render(unsigned int width, unsigned int height, std::string title); ~Render(); void Update(); };