Skip to content

Commit

Permalink
GUI2/Canvas: add error logging if canvas texture creation fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Jul 26, 2017
1 parent 9201811 commit fe6c000
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gui/core/canvas.cpp
Expand Up @@ -1438,7 +1438,10 @@ void canvas::draw(const bool force)
}

texture_ = SDL_CreateTexture(renderer_, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_TARGET, w_, h_);
assert(texture_);
if(!texture_) {
ERR_GUI_D << "Error when creating canvas texture: " << SDL_GetError() << std::endl;
return;
}

SDL_SetTextureBlendMode(texture_, SDL_BLENDMODE_BLEND);

Expand Down

0 comments on commit fe6c000

Please sign in to comment.