mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-10 13:28:15 +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:
@@ -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; \
|
||||
|
Reference in New Issue
Block a user