mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-17 18:28:28 +00:00
Fixed bug 2344 - CHECK_WINDOW_MAGIC should include __FILE__ and __LINE__
Martin Gerhardy just for easier debugging issues in the own code... SDL_CreateRenderer should maybe also use this macro Ryan C. Gordon I'll go one better: it should have an SDL_assert().
This commit is contained in:
parent
96e15fa7f6
commit
aebe17d34f
2 changed files with 4 additions and 0 deletions
|
@ -33,12 +33,14 @@
|
|||
#define SDL_WINDOWRENDERDATA "_SDL_WindowRenderData"
|
||||
|
||||
#define CHECK_RENDERER_MAGIC(renderer, retval) \
|
||||
SDL_assert(renderer && renderer->magic == &renderer_magic); \
|
||||
if (!renderer || renderer->magic != &renderer_magic) { \
|
||||
SDL_SetError("Invalid renderer"); \
|
||||
return retval; \
|
||||
}
|
||||
|
||||
#define CHECK_TEXTURE_MAGIC(texture, retval) \
|
||||
SDL_assert(texture && texture->magic == &texture_magic); \
|
||||
if (!texture || texture->magic != &texture_magic) { \
|
||||
SDL_SetError("Invalid texture"); \
|
||||
return retval; \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue