From ffc064eca2882e99d9ed509fddd395957e5bbe19 Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Wed, 5 Jul 2017 16:12:54 +1100 Subject: [PATCH] SDL/Window: throw exception if render-to-texture is not enabled NOTE: for some reason, if I remove the `SDL_RENDERER_TARGETTEXTURE` flag from sdl::window's ctor render_flags argument, this assertion still doesn't throw. Not sure if that means by GPU supports it by default, or what. --- src/sdl/window.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sdl/window.cpp b/src/sdl/window.cpp index c9239a82dda0..6240829f4055 100644 --- a/src/sdl/window.cpp +++ b/src/sdl/window.cpp @@ -50,6 +50,10 @@ window::window(const std::string& title, false); } + if(!(info_.flags & SDL_RENDERER_TARGETTEXTURE)) { + throw exception("Render-to-texture not supported or enabled!", false); + } + // Set default blend mode to blend. SDL_SetRenderDrawBlendMode(*this, SDL_BLENDMODE_BLEND);