add SDL_GetEvent

This commit is contained in:
Glenn Maynard
2003-04-12 19:00:56 +00:00
parent 5e0f9956f2
commit 3046f71c66
2 changed files with 19 additions and 0 deletions
+16
View File
@@ -488,3 +488,19 @@ int FindSurfaceTraits(const SDL_Surface *img)
// if(WhiteOnly) ret |= TRAIT_WHITE_ONLY;
return ret;
}
bool SDL_GetEvent(SDL_Event &event, int mask)
{
/* SDL_PeepEvents returns error if video isn't initialized. */
if(!SDL_WasInit(SDL_INIT_VIDEO))
return false;
switch(SDL_PeepEvents(&event, 1, SDL_GETEVENT, mask))
{
case 1: return true;
case 0: return false;
case -1: RageException::Throw("SDL_PeepEvents returned unexpected error: %s", SDL_GetError());
}
}
+3
View File
@@ -32,6 +32,9 @@ SDL_Surface *SDL_CreateRGBSurfaceSane
void FixHiddenAlpha(SDL_Surface *img);
/* Check for an event; return true if one was waiting. */
bool SDL_GetEvent(SDL_Event &event, int mask);
/* The surface contains no transparent pixels and/or never uses its color
* key, so it doesn't need any alpha bits at all. */
#define TRAIT_NO_TRANSPARENCY 0x0001 /* 0alpha */