SDLPP: Add function for retreiving events that works on all platforms
This commit is contained in:
@@ -191,3 +191,11 @@ std::tuple< int, int, int, int >
|
||||
SDLPP::getColorsSDLColor( const SDL_Color &color ) {
|
||||
return { color.r, color.g, color.b, color.a };
|
||||
}
|
||||
|
||||
bool SDLPP::getSDLEvent( SDL_Event &e ) {
|
||||
if( SDL_PeepEvents(&e, 1, SDL_PEEKEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT) == 1 ) {
|
||||
SDL_PeepEvents(&e, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user