Revert "Add methods to create additional renderers."

This reverts commit 012daa47d7.
This commit is contained in:
King_DuckZ 2017-03-11 11:56:02 +00:00
parent 77e2bf539f
commit ceb3e180fe
2 changed files with 0 additions and 50 deletions

View file

@ -27,8 +27,6 @@
#include <ciso646>
#include <cstring>
#include <utility>
#include <vector>
#include <algorithm>
#if defined(RASPBERRY_PI)
#include <bcm_host.h>
@ -75,7 +73,6 @@ namespace cloonel {
} //unnamed namespace
struct SDLMain::LocalData {
std::vector<SDL_Renderer*> 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<unsigned int>(m_localData->customRenderers.size());
}
///------------------------------------------------------------------------
///------------------------------------------------------------------------
SDL_Renderer* SDLMain::GetCustomRenderer (unsigned int parIndex) const {
assert(parIndex < static_cast<unsigned int>(m_localData->customRenderers.size()));
return m_localData->customRenderers[parIndex];
}
///------------------------------------------------------------------------
///------------------------------------------------------------------------
void SDLMain::SetResolution (ushort2 parRes) {

View file

@ -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 );