From ceb3e180fee15ba3d6e7b17e8f88261b35d4ae92 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Sat, 11 Mar 2017 11:56:02 +0000 Subject: [PATCH] Revert "Add methods to create additional renderers." This reverts commit 012daa47d7b306c63ded9e9be46382cd8e1ffc01. --- src/cloonelgraphics/sdlmain.cpp | 46 --------------------------------- src/cloonelgraphics/sdlmain.hpp | 4 --- 2 files changed, 50 deletions(-) diff --git a/src/cloonelgraphics/sdlmain.cpp b/src/cloonelgraphics/sdlmain.cpp index a7c4e7a..2e00bd1 100644 --- a/src/cloonelgraphics/sdlmain.cpp +++ b/src/cloonelgraphics/sdlmain.cpp @@ -27,8 +27,6 @@ #include #include #include -#include -#include #if defined(RASPBERRY_PI) #include @@ -75,7 +73,6 @@ namespace cloonel { } //unnamed namespace struct SDLMain::LocalData { - std::vector customRenderers; SDL_Window* window; SDL_Renderer* renderer; SizeRatio sizeratio; @@ -153,10 +150,6 @@ namespace cloonel { ///------------------------------------------------------------------------ ///------------------------------------------------------------------------ void SDLMain::ClearIFN (LocalData& parInitSDL) noexcept { - for (auto* renderer : m_localData->customRenderers) { - SDL_DestroyRenderer(renderer); - } - m_localData->customRenderers.clear(); if (parInitSDL.renderer) SDL_DestroyRenderer(parInitSDL.renderer); if (parInitSDL.window) @@ -182,45 +175,6 @@ namespace cloonel { return nullptr; } - ///------------------------------------------------------------------------ - ///------------------------------------------------------------------------ - SDL_Renderer* SDLMain::CreateRenderer() { - if (not m_localData->initialized) - return nullptr; - - const auto rendererDriver = GetRenderingDriver(); - SDL_Renderer* const new_renderer = SDL_CreateRenderer(m_localData->window, rendererDriver.first, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC); - if (new_renderer) { - m_localData->customRenderers.push_back(new_renderer); - } - return new_renderer; - } - - ///------------------------------------------------------------------------ - ///------------------------------------------------------------------------ - void SDLMain::DestroyRenderer (SDL_Renderer* parRenderer) { - if (not parRenderer) - return; - - auto it_dele = std::find(m_localData->customRenderers.begin(), m_localData->customRenderers.end(), parRenderer); - if (m_localData->customRenderers.end() != it_dele) - m_localData->customRenderers.erase(it_dele); - SDL_DestroyRenderer(parRenderer); - } - - ///------------------------------------------------------------------------ - ///------------------------------------------------------------------------ - unsigned int SDLMain::CustomRenderersCount() const { - return static_cast(m_localData->customRenderers.size()); - } - - ///------------------------------------------------------------------------ - ///------------------------------------------------------------------------ - SDL_Renderer* SDLMain::GetCustomRenderer (unsigned int parIndex) const { - assert(parIndex < static_cast(m_localData->customRenderers.size())); - return m_localData->customRenderers[parIndex]; - } - ///------------------------------------------------------------------------ ///------------------------------------------------------------------------ void SDLMain::SetResolution (ushort2 parRes) { diff --git a/src/cloonelgraphics/sdlmain.hpp b/src/cloonelgraphics/sdlmain.hpp index cbb3f07..4cd56ee 100644 --- a/src/cloonelgraphics/sdlmain.hpp +++ b/src/cloonelgraphics/sdlmain.hpp @@ -36,10 +36,6 @@ namespace cloonel { void Init ( void ); SDL_Renderer* GetRenderer ( void ); - SDL_Renderer* CreateRenderer ( void ); - unsigned int CustomRenderersCount ( void ) const; - SDL_Renderer* GetCustomRenderer ( unsigned int parIndex ) const; - void DestroyRenderer ( SDL_Renderer* parRenderer ); ushort2 WidthHeight ( void ) const noexcept; void SetResolution ( ushort2 parRes );