Skip to content

Commit

Permalink
SDL/Window: throw exception if render-to-texture is not enabled
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Vultraz committed Mar 18, 2018
1 parent 48d6161 commit ffc064e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/sdl/window.cpp
Expand Up @@ -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);

Expand Down

0 comments on commit ffc064e

Please sign in to comment.