From 0b625c5347a61e5ffaa9f3460767208321e5cffe Mon Sep 17 00:00:00 2001 From: James Turk Date: Fri, 24 Jan 2003 11:05:24 +0000 Subject: [PATCH] callback handler --- changelog.txt | 9 ++++++--- include/ZE_ZEngine.h | 14 +++++++++++++- src/ZE_ZEngine.cpp | 7 ++++++- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/changelog.txt b/changelog.txt index 4301656..592b268 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,13 +1,16 @@ ZEngine Version Log for Version 0.8.2 -$Id: changelog.txt,v 1.25 2003/01/18 22:00:52 cozman Exp $ +$Id: changelog.txt,v 1.26 2003/01/24 11:05:24 cozman Exp $ 0.8.2 - -Added "const" to members of ZImage,ZTimer,ZMusic,ZSound,ZRect,ZConfigFile,ZFont and ZError. + -Added ZEngine::SetEventFilter. + -Fixed the DisplayFormat + Dithering Bugs in ZImage / SDLGL_Util. + -Added copy constructor to ZImage. + -Fixed problems setting bit depth in OpenGL. + -Added const modifier to members of ZImage,ZTimer,ZMusic,ZSound,ZRect,ZConfigFile,ZFont and ZError. -Fixed several documentation problems. -Added complete error handling system to ZEngine including internal ZError class. -Updated examples to use newer features and check for errors. -Changed ZEngine::CreateDisplay to return a boolean value. - -Changed ZEngine::CreateDisplay to try desktop depth if setting the depth fails. -Added \since option to documentation (Everything after 0.8.0 will be labeled with a version.) -Added "desired framerate" functionality into the test programs. -Added "desired framerate" code to ZEngine. diff --git a/include/ZE_ZEngine.h b/include/ZE_ZEngine.h index a238953..1bd0446 100644 --- a/include/ZE_ZEngine.h +++ b/include/ZE_ZEngine.h @@ -13,7 +13,7 @@ File: ZE_ZEngine.h
Description: Header file for ZEngine class, the core of the ZEngine.
Author(s): James Turk
-$Id: ZE_ZEngine.h,v 1.14 2003/01/19 05:43:40 cozman Exp $
+$Id: ZE_ZEngine.h,v 1.15 2003/01/24 11:05:25 cozman Exp $
\file ZE_ZEngine.h \brief Definition file for core ZEngine class. @@ -454,6 +454,18 @@ class ZEngine **/ void CheckEvents(); + /*! + \brief Add a SDL Event Filter for user processing of events. + + This is only needed when you need tight control with ZEngine. The parameter is simply passed to SDL_SetEventFilter, + generally only those with a good amount of SDL experience should use this function or ZEngine's internal message + state could be corrupted. For more information on SDL_SetEventFilter see http://sdldoc.csn.ul.ie/sdlseteventfilter.php. + \since 0.8.2 + \param filter An SDL_EventFilter (A function that takes a const SDL_Event* and returns 0 if the event should be removed from + the event queue and 1 otherwise.) + **/ + void SetEventFilter(SDL_EventFilter filter); + #ifdef USE_PHYSFS //////////////////// //Physfs Utilities// diff --git a/src/ZE_ZEngine.cpp b/src/ZE_ZEngine.cpp index b247480..f52e4a4 100644 --- a/src/ZE_ZEngine.cpp +++ b/src/ZE_ZEngine.cpp @@ -13,7 +13,7 @@ File: ZE_ZEngine.cpp
Description: Implementation source file for ZEngine library main singleton class.
Author(s): James Turk
-$Id: ZE_ZEngine.cpp,v 1.20 2003/01/24 10:31:39 cozman Exp $
+$Id: ZE_ZEngine.cpp,v 1.21 2003/01/24 11:05:25 cozman Exp $
\file ZE_ZEngine.cpp \brief Central source file for ZEngine. @@ -488,6 +488,11 @@ void ZEngine::CheckEvents() mMouseB = SDL_GetMouseState(&mMouseX,&mMouseY); } +void ZEngine::SetEventFilter(SDL_EventFilter filter) +{ + SDL_SetEventFilter(filter); +} + #ifdef USE_PHYSFS void ZEngine::InitPhysFS(string argv)