- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
Graphics::Graphics(const Window& window, int virtualWidth, int virtualHeight) :
sdlRenderer{[&window]{
SDL_Renderer* const sdlRenderer = ::SDL_CreateRenderer(const_cast<SDL_Window*>(window.getSdlWindow()),
-1, SDL_RENDERER_ACCELERATED);
if (!sdlRenderer)
throw std::runtime_error{::SDL_GetError()};
return sdlRenderer;
}(), ::SDL_DestroyRenderer}
{
if (::SDL_RenderSetLogicalSize(sdlRenderer.get(), virtualWidth, virtualHeight) < 0)
throw std::runtime_error{::SDL_GetError()};
}
1024-- 23.10.2016 07:02 # 0