diff --git a/src/game/console.cpp b/src/game/console.cpp index c4117e7c..fb70a9fb 100644 --- a/src/game/console.cpp +++ b/src/game/console.cpp @@ -304,7 +304,7 @@ void Console::drawBackground() { transform = glm::scale(transform, glm::vec3(_opts.width, height, 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); uniforms.combined.general.color = glm::vec4(0.0f, 0.0f, 0.0f, 1.0f); uniforms.combined.general.alpha = 0.5f; diff --git a/src/game/game.cpp b/src/game/game.cpp index 5ae36b50..b26bff41 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -96,7 +96,7 @@ int Game::run() { } else { playVideo("legal"); } - RenderWindow::instance().show(); + Window::instance().show(); runMainLoop(); deinitSubsystems(); @@ -108,7 +108,7 @@ void Game::initSubsystems() { initResourceProviders(); loadModuleNames(); - RenderWindow::instance().init(_options.graphics, this); + Window::instance().init(_options.graphics, this); Strings::instance().init(_path); Meshes::instance().init(); Textures::instance().init(); @@ -155,9 +155,9 @@ void Game::loadModuleNames() { void Game::setCursorType(CursorType type) { if (_cursorType != type) { if (type == CursorType::None) { - RenderWindow::instance().setCursor(nullptr); + Window::instance().setCursor(nullptr); } else { - RenderWindow::instance().setCursor(Cursors::instance().get(type)); + Window::instance().setCursor(Cursors::instance().get(type)); } _cursorType = type; } @@ -327,19 +327,19 @@ void Game::drawAll() { // Compute derived PBR IBL textures from queued environment maps PBRIBL::instance().refresh(); - RenderWindow::instance().clear(); + Window::instance().clear(); if (_video) { _video->draw(); } else { drawWorld(); drawGUI(); - RenderWindow::instance().drawCursor(); + Window::instance().drawCursor(); } _profileOverlay.draw(); - RenderWindow::instance().swapBuffers(); + Window::instance().swapBuffers(); } void Game::drawWorld() { @@ -502,7 +502,7 @@ void Game::runMainLoop() { _ticks = SDL_GetTicks(); while (!_quit) { - RenderWindow::instance().processEvents(_quit); + Window::instance().processEvents(_quit); update(); drawAll(); @@ -592,7 +592,7 @@ void Game::loadCharacterGeneration() { void Game::deinitSubsystems() { AudioPlayer::instance().deinit(); - RenderWindow::instance().deinit(); + Window::instance().deinit(); } void Game::startCharacterGeneration() { @@ -904,7 +904,7 @@ void Game::setPaused(bool paused) { } void Game::setRelativeMouseMode(bool relative) { - RenderWindow::instance().setRelativeMouseMode(relative); + Window::instance().setRelativeMouseMode(relative); } } // namespace game diff --git a/src/game/gui/hud.cpp b/src/game/gui/hud.cpp index b949ac24..033d8fd6 100644 --- a/src/game/gui/hud.cpp +++ b/src/game/gui/hud.cpp @@ -245,7 +245,7 @@ void HUD::drawHealth(int memberIndex) { transform = glm::scale(transform, glm::vec3(w, h, 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); uniforms.combined.general.color = glm::vec4(1.0f, 0.0f, 0.0f, 1.0f); diff --git a/src/game/gui/profileoverlay.cpp b/src/game/gui/profileoverlay.cpp index 72551113..1548e2c8 100644 --- a/src/game/gui/profileoverlay.cpp +++ b/src/game/gui/profileoverlay.cpp @@ -114,7 +114,7 @@ void ProfileOverlay::drawBackground() { transform = glm::scale(transform, glm::vec3(kFrameWidth, 2.0f * _font->height(), 1.0f)); ShaderUniforms uniforms(Shaders::instance().defaultUniforms()); - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); uniforms.combined.general.color = glm::vec4(0.0f, 0.0f, 0.0f, 1.0f); uniforms.combined.general.alpha = 0.5f; diff --git a/src/game/gui/selectoverlay.cpp b/src/game/gui/selectoverlay.cpp index 3663117b..856c128b 100644 --- a/src/game/gui/selectoverlay.cpp +++ b/src/game/gui/selectoverlay.cpp @@ -210,7 +210,7 @@ void SelectionOverlay::drawReticle(Texture &texture, const glm::vec3 &screenCoor transform = glm::scale(transform, glm::vec3(width, height, 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); Shaders::instance().activate(ShaderProgram::SimpleGUI, uniforms); @@ -234,7 +234,7 @@ void SelectionOverlay::drawTitleBar() { transform = glm::scale(transform, glm::vec3(kTitleBarWidth, barHeight, 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); uniforms.combined.general.color = glm::vec4(0.0f, 0.0f, 0.0f, 1.0f); uniforms.combined.general.alpha = 0.5f; @@ -267,7 +267,7 @@ void SelectionOverlay::drawHealthBar() { transform = glm::scale(transform, glm::vec3(w, kHealthBarHeight, 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); uniforms.combined.general.color = glm::vec4(getColorFromSelectedObject(), 1.0f); @@ -298,7 +298,7 @@ void SelectionOverlay::drawActionBar() { transform = glm::scale(transform, glm::vec3(kActionWidth, kActionHeight, 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); Shaders::instance().activate(ShaderProgram::SimpleGUI, uniforms); @@ -319,7 +319,7 @@ void SelectionOverlay::drawActionBar() { transform = glm::scale(transform, glm::vec3(kActionWidth, kActionWidth, 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); Shaders::instance().activate(ShaderProgram::SimpleGUI, uniforms); diff --git a/src/game/map.cpp b/src/game/map.cpp index 7a16d339..8b3af01c 100644 --- a/src/game/map.cpp +++ b/src/game/map.cpp @@ -114,7 +114,7 @@ void Map::drawArea(Mode mode, const glm::vec4 &bounds) { transform = glm::scale(transform, glm::vec3(_areaTexture->width(), _areaTexture->height(), 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = transform; Shaders::instance().activate(ShaderProgram::SimpleGUI, uniforms); @@ -131,7 +131,7 @@ void Map::drawArea(Mode mode, const glm::vec4 &bounds) { transform = glm::scale(transform, glm::vec3(bounds[2], bounds[3], 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); Shaders::instance().activate(ShaderProgram::SimpleGUI, uniforms); @@ -165,7 +165,7 @@ void Map::drawNotes(Mode mode, const glm::vec4 &bounds) { transform = glm::scale(transform, glm::vec3(noteSize, noteSize, 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = transform; uniforms.combined.general.color = glm::vec4(selected ? getHilightColor(_game->gameId()) : getBaseColor(_game->gameId()), 1.0f); @@ -247,7 +247,7 @@ void Map::drawPartyLeader(Mode mode, const glm::vec4 &bounds) { transform = glm::scale(transform, glm::vec3(kArrowSize, kArrowSize, 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); Shaders::instance().activate(ShaderProgram::SimpleGUI, uniforms); diff --git a/src/gui/control/control.cpp b/src/gui/control/control.cpp index b57258cb..3df10440 100644 --- a/src/gui/control/control.cpp +++ b/src/gui/control/control.cpp @@ -259,7 +259,7 @@ void Control::drawBorder(const Border &border, const glm::ivec2 &offset, const g ShaderUniforms uniforms; uniforms.combined.featureMask |= _discardEnabled ? UniformFeatureFlags::discard : 0; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); uniforms.combined.general.discardColor = glm::vec4(_discardColor, 1.0f); Shaders::instance().activate(ShaderProgram::SimpleGUI, uniforms); @@ -297,7 +297,7 @@ void Control::drawBorder(const Border &border, const glm::ivec2 &offset, const g transform = glm::rotate(transform, glm::pi(), glm::vec3(1.0f, 0.0f, 0.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); uniforms.combined.general.color = glm::vec4(color, 1.0f); @@ -313,7 +313,7 @@ void Control::drawBorder(const Border &border, const glm::ivec2 &offset, const g transform = glm::rotate(transform, glm::half_pi(), glm::vec3(0.0f, 0.0f, 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); uniforms.combined.general.color = glm::vec4(color, 1.0f); @@ -333,7 +333,7 @@ void Control::drawBorder(const Border &border, const glm::ivec2 &offset, const g transform = glm::scale(transform, glm::vec3(width, border.dimension, 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); uniforms.combined.general.color = glm::vec4(color, 1.0f); @@ -348,7 +348,7 @@ void Control::drawBorder(const Border &border, const glm::ivec2 &offset, const g transform = glm::scale(transform, glm::vec3(width, border.dimension, 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); uniforms.combined.general.color = glm::vec4(color, 1.0f); @@ -371,7 +371,7 @@ void Control::drawBorder(const Border &border, const glm::ivec2 &offset, const g transform = glm::scale(transform, glm::vec3(border.dimension, border.dimension, 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); uniforms.combined.general.color = glm::vec4(color, 1.0f); @@ -386,7 +386,7 @@ void Control::drawBorder(const Border &border, const glm::ivec2 &offset, const g transform = glm::scale(transform, glm::vec3(border.dimension, border.dimension, 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); uniforms.combined.general.color = glm::vec4(color, 1.0f); @@ -401,7 +401,7 @@ void Control::drawBorder(const Border &border, const glm::ivec2 &offset, const g transform = glm::scale(transform, glm::vec3(border.dimension, border.dimension, 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); uniforms.combined.general.color = glm::vec4(color, 1.0f); @@ -416,7 +416,7 @@ void Control::drawBorder(const Border &border, const glm::ivec2 &offset, const g transform = glm::scale(transform, glm::vec3(border.dimension, border.dimension, 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); uniforms.combined.general.color = glm::vec4(color, 1.0f); diff --git a/src/gui/control/imagebutton.cpp b/src/gui/control/imagebutton.cpp index 9d285f93..b31ce0e0 100644 --- a/src/gui/control/imagebutton.cpp +++ b/src/gui/control/imagebutton.cpp @@ -93,7 +93,7 @@ void ImageButton::drawIcon( transform = glm::scale(transform, glm::vec3(_extent.height, _extent.height, 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); uniforms.combined.general.color = glm::vec4(color, 1.0f); @@ -110,7 +110,7 @@ void ImageButton::drawIcon( transform = glm::scale(transform, glm::vec3(_extent.height, _extent.height, 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); uniforms.combined.general.color = glm::vec4(1.0f); diff --git a/src/gui/control/progressbar.cpp b/src/gui/control/progressbar.cpp index 8d47ea2a..39ea7869 100644 --- a/src/gui/control/progressbar.cpp +++ b/src/gui/control/progressbar.cpp @@ -57,7 +57,7 @@ void ProgressBar::draw(const glm::ivec2 &offset, const vector &text) { transform = glm::scale(transform, glm::vec3(w, _extent.height, 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); Shaders::instance().activate(ShaderProgram::SimpleGUI, uniforms); diff --git a/src/gui/control/scrollbar.cpp b/src/gui/control/scrollbar.cpp index 8d18dcf8..36b04aab 100644 --- a/src/gui/control/scrollbar.cpp +++ b/src/gui/control/scrollbar.cpp @@ -64,7 +64,7 @@ void ScrollBar::drawThumb(const glm::ivec2 &offset) { _thumb.image->bind(); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); // Top edge uniforms.combined.general.model = glm::translate(glm::mat4(1.0f), glm::vec3(_extent.left + offset.x, _extent.top + _extent.width + offset.y, 0.0f)); @@ -124,7 +124,7 @@ void ScrollBar::drawUpArrow(const glm::ivec2 &offset) { transform = glm::scale(transform, glm::vec3(_extent.width, _extent.width, 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); Shaders::instance().activate(ShaderProgram::SimpleGUI, uniforms); @@ -138,7 +138,7 @@ void ScrollBar::drawDownArrow(const glm::ivec2 &offset) { transform = glm::rotate(transform, glm::pi(), glm::vec3(1.0f, 0.0f, 0.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); Shaders::instance().activate(ShaderProgram::SimpleGUI, uniforms); diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index d6568c38..a3c7fe81 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -258,7 +258,7 @@ void GUI::drawBackground() { transform = glm::scale(transform, glm::vec3(_gfxOpts.width, _gfxOpts.height, 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); Shaders::instance().activate(ShaderProgram::SimpleGUI, uniforms); diff --git a/src/render/cursor.cpp b/src/render/cursor.cpp index faa0387a..22679258 100644 --- a/src/render/cursor.cpp +++ b/src/render/cursor.cpp @@ -53,7 +53,7 @@ void Cursor::draw() { transform = glm::scale(transform, glm::vec3(texture->width(), texture->height(), 1.0f)); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); Shaders::instance().activate(ShaderProgram::SimpleGUI, uniforms); diff --git a/src/render/font.cpp b/src/render/font.cpp index 96cd562e..203f413c 100644 --- a/src/render/font.cpp +++ b/src/render/font.cpp @@ -72,7 +72,7 @@ void Font::draw(const string &text, const glm::vec3 &position, const glm::vec3 & ShaderUniforms uniforms(Shaders::instance().defaultUniforms()); uniforms.combined.featureMask |= UniformFeatureFlags::text; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.color = glm::vec4(color, 1.0f); int numBlocks = static_cast(text.size()) / kMaxCharacters; diff --git a/src/render/window.cpp b/src/render/window.cpp index e39f0381..a3986f9f 100644 --- a/src/render/window.cpp +++ b/src/render/window.cpp @@ -34,12 +34,12 @@ namespace reone { namespace render { -RenderWindow &RenderWindow::instance() { - static RenderWindow instance; +Window &Window::instance() { + static Window instance; return instance; } -void RenderWindow::init(GraphicsOptions options, IEventHandler *eventHandler) { +void Window::init(GraphicsOptions options, IEventHandler *eventHandler) { if (!eventHandler) { throw invalid_argument("eventHandler must not be null"); } @@ -55,7 +55,7 @@ void RenderWindow::init(GraphicsOptions options, IEventHandler *eventHandler) { _inited = true; } -void RenderWindow::initSDL() { +void Window::initSDL() { SDL_Init(SDL_INIT_VIDEO); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3); @@ -82,7 +82,7 @@ void RenderWindow::initSDL() { SDL_GL_SetSwapInterval(0); } -int RenderWindow::getWindowFlags() const { +int Window::getWindowFlags() const { int flags = SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN; if (_options.fullscreen) { flags |= SDL_WINDOW_FULLSCREEN; @@ -90,7 +90,7 @@ int RenderWindow::getWindowFlags() const { return flags; } -void RenderWindow::initGL() { +void Window::initGL() { glewInit(); glEnable(GL_BLEND); @@ -99,11 +99,11 @@ void RenderWindow::initGL() { glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS); } -RenderWindow::~RenderWindow() { +Window::~Window() { deinit(); } -void RenderWindow::deinit() { +void Window::deinit() { if (_inited) { SDL_GL_DeleteContext(_context); SDL_DestroyWindow(_window); @@ -112,11 +112,11 @@ void RenderWindow::deinit() { } } -void RenderWindow::show() { +void Window::show() { SDL_ShowWindow(_window); } -void RenderWindow::processEvents(bool &quit) { +void Window::processEvents(bool &quit) { if (!_inited) return; SDL_Event event; @@ -127,7 +127,7 @@ void RenderWindow::processEvents(bool &quit) { } } -bool RenderWindow::handleEvent(const SDL_Event &event, bool &quit) { +bool Window::handleEvent(const SDL_Event &event, bool &quit) { switch (event.type) { case SDL_QUIT: quit = true; @@ -141,7 +141,7 @@ bool RenderWindow::handleEvent(const SDL_Event &event, bool &quit) { } } -bool RenderWindow::handleKeyDownEvent(const SDL_KeyboardEvent &event, bool &quit) { +bool Window::handleKeyDownEvent(const SDL_KeyboardEvent &event, bool &quit) { switch (event.keysym.scancode) { case SDL_SCANCODE_C: if (event.keysym.mod & KMOD_CTRL) { @@ -155,11 +155,11 @@ bool RenderWindow::handleKeyDownEvent(const SDL_KeyboardEvent &event, bool &quit } } -void RenderWindow::clear() const { +void Window::clear() const { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); } -void RenderWindow::drawCursor() const { +void Window::drawCursor() const { if (_relativeMouseMode) return; int x, y; @@ -171,22 +171,22 @@ void RenderWindow::drawCursor() const { _cursor->draw(); } -void RenderWindow::swapBuffers() const { +void Window::swapBuffers() const { if (_inited) { SDL_GL_SwapWindow(_window); } } -glm::mat4 RenderWindow::getOrthoProjection(float near, float far) const { +glm::mat4 Window::getOrthoProjection(float near, float far) const { return glm::ortho(0.0f, static_cast(_options.width), static_cast(_options.height), 0.0f, near, far); } -void RenderWindow::setRelativeMouseMode(bool enabled) { +void Window::setRelativeMouseMode(bool enabled) { SDL_SetRelativeMouseMode(enabled ? SDL_TRUE : SDL_FALSE); _relativeMouseMode = enabled; } -void RenderWindow::setCursor(const shared_ptr &cursor) { +void Window::setCursor(const shared_ptr &cursor) { _cursor = cursor; SDL_ShowCursor(!static_cast(cursor)); } diff --git a/src/render/window.h b/src/render/window.h index f606b21d..2e85cac8 100644 --- a/src/render/window.h +++ b/src/render/window.h @@ -32,11 +32,11 @@ namespace reone { namespace render { -class RenderWindow : boost::noncopyable { +class Window : boost::noncopyable { public: - static RenderWindow &instance(); + static Window &instance(); - ~RenderWindow(); + ~Window(); void init(GraphicsOptions options, IEventHandler *eventHandler = nullptr); void deinit(); @@ -62,7 +62,7 @@ private: bool _relativeMouseMode { false }; std::shared_ptr _cursor; - RenderWindow() = default; + Window() = default; void initSDL(); void initGL(); diff --git a/src/scene/pipeline/world.cpp b/src/scene/pipeline/world.cpp index d4151388..4102790b 100644 --- a/src/scene/pipeline/world.cpp +++ b/src/scene/pipeline/world.cpp @@ -232,7 +232,7 @@ void WorldRenderPipeline::applyHorizontalBlur() { ShaderUniforms uniforms; uniforms.combined.featureMask |= UniformFeatureFlags::blur; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); uniforms.combined.blur.resolution = glm::vec2(w, h); uniforms.combined.blur.direction = glm::vec2(1.0f, 0.0f); @@ -260,7 +260,7 @@ void WorldRenderPipeline::applyVerticalBlur() { ShaderUniforms uniforms; uniforms.combined.featureMask |= UniformFeatureFlags::blur; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); uniforms.combined.blur.resolution = glm::vec2(_opts.width, _opts.height); uniforms.combined.blur.direction = glm::vec2(0.0f, 1.0f); @@ -293,7 +293,7 @@ void WorldRenderPipeline::drawResult() { //_shadowsDepth->bind(); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); Shaders::instance().activate(ShaderProgram::SimpleDebugCubeMap, uniforms); @@ -307,7 +307,7 @@ void WorldRenderPipeline::drawResult() { _verticalBlurColor->bind(); ShaderUniforms uniforms; - uniforms.combined.general.projection = RenderWindow::instance().getOrthoProjection(); + uniforms.combined.general.projection = Window::instance().getOrthoProjection(); uniforms.combined.general.model = move(transform); Shaders::instance().activate(ShaderProgram::SimplePresentWorld, uniforms);