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 Mar 18, 2018
1 parent 894e9b6 commit 5c430f6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gui/core/canvas.cpp
Expand Up @@ -1445,7 +1445,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 5c430f6

Please sign in to comment.