2002-11-21 05:40:49 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
< html > < head > < meta http-equiv = "Content-Type" content = "text/html;charset=iso-8859-1" >
2002-12-01 07:56:17 +00:00
< title > /include/ZE_ZEngine.h Source File< / title >
2002-11-21 05:40:49 +00:00
< link href = "doxygen.css" rel = "stylesheet" type = "text/css" >
< / head > < body >
2002-12-01 07:56:17 +00:00
<!-- Generated by Doxygen 1.2.18 -->
2002-11-21 05:40:49 +00:00
< center >
< a class = "qindex" href = "index.html" > Main Page< / a > < a class = "qindex" href = "namespaces.html" > Namespace List< / a > < a class = "qindex" href = "hierarchy.html" > Class Hierarchy< / a > < a class = "qindex" href = "annotated.html" > Compound List< / a > < a class = "qindex" href = "files.html" > File List< / a > < a class = "qindex" href = "namespacemembers.html" > Namespace Members< / a > < a class = "qindex" href = "functions.html" > Compound Members< / a > < a class = "qindex" href = "globals.html" > File Members< / a > < / center >
2002-12-01 07:56:17 +00:00
< hr > < h1 > /include/ZE_ZEngine.h< / h1 > < a href = "ZE__ZEngine_8h.html" > Go to the documentation of this file.< / a > < div class = "fragment" > < pre > 00001 < span class = "comment" > /*******************************************************************************< / span >
2002-11-21 05:40:49 +00:00
00002 < span class = "comment" > This file is Part of the ZEngine Library for SDL Game Development.< / span >
00003 < span class = "comment" > Copyright (C) 2002 ConceptOfZero.net< / span >
00004 < span class = "comment" > < / span >
00005 < span class = "comment" > Licensed under the BSD License, see licensing.txt.< / span >
00006 < span class = "comment" > < / span >
00007 < span class = "comment" > The maintainer of this library is James Turk (jturk@conceptofzero.net) < / span >
00008 < span class = "comment" > and the home of this Library is http://www.conceptofzero.net/< / span >
00009 < span class = "comment" > *******************************************************************************/< / span >
00010
00024 < span class = "preprocessor" > #ifndef __ze_zengine_h__< / span >
00025 < span class = "preprocessor" > < / span > < span class = "preprocessor" > #define __ze_zengine_h__< / span >
00026 < span class = "preprocessor" > < / span >
2002-12-01 07:56:17 +00:00
00027 < span class = "preprocessor" > #include "< a class = "code" href = "ZE__Error_8h.html" > ZE_Error.h< / a > "< / span >
00028 < span class = "preprocessor" > #include "< a class = "code" href = "ZE__Defines_8h.html" > ZE_Defines.h< / a > "< / span >
00029 < span class = "preprocessor" > #include "< a class = "code" href = "ZE__Macros_8h.html" > ZE_Macros.h< / a > "< / span >
2002-11-21 05:40:49 +00:00
00030 < span class = "preprocessor" > #include "< a class = "code" href = "ZE__Includes_8h.html" > ZE_Includes.h< / a > "< / span >
00031
00037 < span class = "keyword" > namespace < / span > ZE
00038 {
00039
2002-12-01 07:56:17 +00:00
< a name = "l00046" > < / a > < a class = "code" href = "classZE_1_1ZEngine.html" > 00046< / a > < span class = "keyword" > class < / span > < a class = "code" href = "classZE_1_1ZEngine.html" > ZEngine< / a >
2002-11-21 05:40:49 +00:00
00047 {
2002-12-01 07:56:17 +00:00
00049 < span class = "comment" > //Singleton + Memory Management//< / span >
2002-11-21 05:40:49 +00:00
00051 < span class = "comment" > < / span >
2002-12-01 07:56:17 +00:00
00052 < span class = "keyword" > private< / span > :
00054 < span class = "keyword" > static< / span > < a class = "code" href = "classZE_1_1ZEngine.html" > ZEngine< / a > *< a class = "code" href = "classZE_1_1ZEngine.html#r0" > sInstance< / a > ;
2002-11-21 05:40:49 +00:00
00055
2002-12-01 07:56:17 +00:00
00061 < a class = "code" href = "classZE_1_1ZEngine.html#c0" > ZEngine< / a > ();
2002-11-21 05:40:49 +00:00
00062
2002-12-01 07:56:17 +00:00
00063 < span class = "keyword" > public< / span > :
2002-11-21 05:40:49 +00:00
00064
2002-12-01 07:56:17 +00:00
00071 < span class = "keyword" > static< / span > < a class = "code" href = "classZE_1_1ZEngine.html" > ZEngine< / a > * < a class = "code" href = "classZE_1_1ZEngine.html#d0" > GetInstance< / a > ();
2002-11-21 05:40:49 +00:00
00072
2002-12-01 07:56:17 +00:00
00078 < span class = "keyword" > static< / span > < span class = "keywordtype" > void< / span > < a class = "code" href = "classZE_1_1ZEngine.html#d1" > ReleaseInstance< / a > ();
2002-11-21 05:40:49 +00:00
00079
2002-12-01 07:56:17 +00:00
00086 < span class = "keyword" > static< / span > string < a class = "code" href = "classZE_1_1ZEngine.html#d2" > GetVersion< / a > ();
2002-11-21 05:40:49 +00:00
00087
2002-12-01 07:56:17 +00:00
00089 < span class = "comment" > //Initialization//< / span >
2002-11-21 05:40:49 +00:00
00091 < span class = "comment" > < / span >
2002-12-01 07:56:17 +00:00
00092 < span class = "keyword" > private< / span > :
< a name = "l00094" > < / a > < a class = "code" href = "classZE_1_1ZEngine.html#o0" > 00094< / a > < span class = "keywordtype" > int< / span > < a class = "code" href = "classZE_1_1ZEngine.html#o0" > mWidth< / a > ;
< a name = "l00096" > < / a > < a class = "code" href = "classZE_1_1ZEngine.html#o1" > 00096< / a > < span class = "keywordtype" > int< / span > < a class = "code" href = "classZE_1_1ZEngine.html#o1" > mHeight< / a > ;
< a name = "l00098" > < / a > < a class = "code" href = "classZE_1_1ZEngine.html#o2" > 00098< / a > < span class = "keywordtype" > int< / span > < a class = "code" href = "classZE_1_1ZEngine.html#o2" > mBPP< / a > ;
< a name = "l00100" > < / a > < a class = "code" href = "classZE_1_1ZEngine.html#o3" > 00100< / a > < span class = "keywordtype" > bool< / span > < a class = "code" href = "classZE_1_1ZEngine.html#o3" > mFullscreen< / a > ;
2002-11-21 05:40:49 +00:00
00101
00102 < span class = "preprocessor" > #ifdef USE_SDL_MIXER < / span >
2002-12-01 07:56:17 +00:00
00103 < span class = "preprocessor" > < / span >
< a name = "l00104" > < / a > < a class = "code" href = "classZE_1_1ZEngine.html#o4" > 00104< / a > < span class = "keywordtype" > int< / span > < a class = "code" href = "classZE_1_1ZEngine.html#o4" > mRate< / a > ;
< a name = "l00106" > < / a > < a class = "code" href = "classZE_1_1ZEngine.html#o5" > 00106< / a > < span class = "keywordtype" > bool< / span > < a class = "code" href = "classZE_1_1ZEngine.html#o5" > mStereo< / a > ;
2002-11-21 05:40:49 +00:00
00107 < span class = "preprocessor" > #endif < / span >
00108 < span class = "preprocessor" > < / span >
00109
2002-12-01 07:56:17 +00:00
00110 < span class = "keyword" > public< / span > :
00111 < span class = "comment" > //add initialization< / span >
2002-11-21 05:40:49 +00:00
00112
2002-12-01 07:56:17 +00:00
00123 < span class = "keywordtype" > void< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a0" > SetupDisplay< / a > (< span class = "keywordtype" > int< / span > width, < span class = "keywordtype" > int< / span > height, < span class = "keywordtype" > int< / span > bpp, < span class = "keywordtype" > bool< / span > fullscreen);
2002-11-21 05:40:49 +00:00
00124
00125 < span class = "preprocessor" > #ifdef USE_SDL_MIXER< / span >
00126 < span class = "preprocessor" > < / span >
2002-12-01 07:56:17 +00:00
00134 < span class = "keywordtype" > void< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a1" > SetupSound< / a > (< span class = "keywordtype" > int< / span > rate, < span class = "keywordtype" > bool< / span > stereo);
2002-11-21 05:40:49 +00:00
00135 < span class = "preprocessor" > #endif < / span >
00136 < span class = "preprocessor" > < / span >
2002-12-01 07:56:17 +00:00
00146 < span class = "keywordtype" > void< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a2" > CreateDisplay< / a > (string title, string icon=< span class = "stringliteral" > ""< / span > );
2002-11-21 05:40:49 +00:00
00147
2002-12-01 07:56:17 +00:00
00153 < span class = "keywordtype" > void< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a3" > CloseDisplay< / a > ();
2002-11-21 05:40:49 +00:00
00154
2002-12-01 07:56:17 +00:00
00156 < span class = "comment" > //Screen Access//< / span >
2002-11-21 05:40:49 +00:00
00158 < span class = "comment" > < / span >
2002-12-01 07:56:17 +00:00
00159 < span class = "keyword" > private< / span > :
< a name = "l00161" > < / a > < a class = "code" href = "classZE_1_1ZEngine.html#o6" > 00161< / a > SDL_Surface *< a class = "code" href = "classZE_1_1ZEngine.html#o6" > mScreen< / a > ;
2002-11-21 05:40:49 +00:00
00162
2002-12-01 07:56:17 +00:00
00163 < span class = "keyword" > public< / span > :
00170 SDL_Surface *< a class = "code" href = "classZE_1_1ZEngine.html#a4" > Display< / a > ();
2002-11-21 05:40:49 +00:00
00171
2002-12-01 07:56:17 +00:00
00177 < span class = "keywordtype" > void< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a5" > UpdateScreen< / a > ();
2002-11-21 05:40:49 +00:00
00178
2002-12-01 07:56:17 +00:00
00188 < span class = "keywordtype" > void< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a6" > Clear< / a > (< span class = "keywordtype" > float< / span > red=0.0f, < span class = "keywordtype" > float< / span > green=0.0f, < span class = "keywordtype" > float< / span > blue=0.0f, < span class = "keywordtype" > float< / span > alpha=1.0f);
00189
00191 < span class = "comment" > //OpenGL Specific Functions//< / span >
00193 < span class = "comment" > public:< / span >
00194
00201 < span class = "keywordtype" > void< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a7" > SetGL2D< / a > ();
00202
00204 < span class = "comment" > //Timer and Framerate Independent Movement//< / span >
00206 < span class = "comment" > < / span >
00207 < span class = "keyword" > private< / span > :
< a name = "l00209" > < / a > < a class = "code" href = "classZE_1_1ZEngine.html#o7" > 00209< / a > < span class = "keywordtype" > bool< / span > < a class = "code" href = "classZE_1_1ZEngine.html#o7" > mPaused< / a > ;
< a name = "l00211" > < / a > < a class = "code" href = "classZE_1_1ZEngine.html#o8" > 00211< / a > < span class = "keywordtype" > bool< / span > < a class = "code" href = "classZE_1_1ZEngine.html#o8" > mUnpauseOnActive< / a > ;
< a name = "l00213" > < / a > < a class = "code" href = "classZE_1_1ZEngine.html#o9" > 00213< / a > Uint32 < a class = "code" href = "classZE_1_1ZEngine.html#o9" > mLastPause< / a > ;
< a name = "l00215" > < / a > < a class = "code" href = "classZE_1_1ZEngine.html#o10" > 00215< / a > Uint32 < a class = "code" href = "classZE_1_1ZEngine.html#o10" > mPausedTime< / a > ;
< a name = "l00217" > < / a > < a class = "code" href = "classZE_1_1ZEngine.html#o11" > 00217< / a > Uint32 < a class = "code" href = "classZE_1_1ZEngine.html#o11" > mLastTime< / a > ;
< a name = "l00219" > < / a > < a class = "code" href = "classZE_1_1ZEngine.html#o12" > 00219< / a > < span class = "keywordtype" > double< / span > < a class = "code" href = "classZE_1_1ZEngine.html#o12" > mSecPerFrame< / a > ;
00220
00221 < span class = "keyword" > public< / span > :
00228 < span class = "keywordtype" > void< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a8" > Delay< / a > (Uint32 milliseconds);
00229
00236 Uint32 < a class = "code" href = "classZE_1_1ZEngine.html#a9" > GetTime< / a > ();
00237
00243 < span class = "keywordtype" > void< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a10" > PauseTimer< / a > ();
00244
00250 < span class = "keywordtype" > void< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a11" > UnpauseTimer< / a > ();
00251
00258 < span class = "keywordtype" > double< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a12" > GetFrameTime< / a > ();
00259
00266 < span class = "keywordtype" > bool< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a13" > IsPaused< / a > ();
00267
00269 < span class = "comment" > //Event and Input Handling//< / span >
00271 < span class = "comment" > < / span >
00272 < span class = "keyword" > private< / span > :
< a name = "l00274" > < / a > < a class = "code" href = "classZE_1_1ZEngine.html#o13" > 00274< / a > < span class = "keywordtype" > bool< / span > < a class = "code" href = "classZE_1_1ZEngine.html#o13" > mActive< / a > ;
< a name = "l00276" > < / a > < a class = "code" href = "classZE_1_1ZEngine.html#o14" > 00276< / a > < span class = "keywordtype" > bool< / span > < a class = "code" href = "classZE_1_1ZEngine.html#o14" > mQuit< / a > ;
< a name = "l00278" > < / a > < a class = "code" href = "classZE_1_1ZEngine.html#o15" > 00278< / a > Uint8 *< a class = "code" href = "classZE_1_1ZEngine.html#o15" > mKeyPressed< / a > ;
< a name = "l00280" > < / a > < a class = "code" href = "classZE_1_1ZEngine.html#o16" > 00280< / a > < span class = "keywordtype" > int< / span > < a class = "code" href = "classZE_1_1ZEngine.html#o16" > mMouseX< / a > ;
< a name = "l00282" > < / a > < a class = "code" href = "classZE_1_1ZEngine.html#o17" > 00282< / a > < span class = "keywordtype" > int< / span > < a class = "code" href = "classZE_1_1ZEngine.html#o17" > mMouseY< / a > ;
< a name = "l00284" > < / a > < a class = "code" href = "classZE_1_1ZEngine.html#o18" > 00284< / a > Uint8 < a class = "code" href = "classZE_1_1ZEngine.html#o18" > mMouseB< / a > ;
00285
00286 < span class = "keyword" > public< / span > :
00293 < span class = "keywordtype" > bool< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a14" > IsActive< / a > ();
00294
00301 < span class = "keywordtype" > void< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a15" > RequestQuit< / a > ();
00302
00310 < span class = "keywordtype" > bool< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a16" > QuitRequested< / a > ();
00311
00319 < span class = "keywordtype" > bool< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a17" > KeyIsPressed< / a > (SDLKey key);
00320
00326 < span class = "keywordtype" > void< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a18" > HideCursor< / a > ();
00327
00333 < span class = "keywordtype" > void< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a19" > ShowCursor< / a > ();
00334
00341 < span class = "keywordtype" > int< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a20" > MouseX< / a > ();
00342
00349 < span class = "keywordtype" > int< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a21" > MouseY< / a > ();
00350
00357 < span class = "keywordtype" > bool< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a22" > LButtonPressed< / a > ();
00358
00365 < span class = "keywordtype" > bool< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a23" > RButtonPressed< / a > ();
00366
00374 < span class = "keywordtype" > bool< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a24" > MouseInRect< / a > (SDL_Rect *rect);
00375
00381 < span class = "keywordtype" > void< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a25" > CheckEvents< / a > ();
00382
00383 < span class = "preprocessor" > #ifdef USE_PHYSFS< / span >
00384 < span class = "preprocessor" > < / span >
00385 < span class = "comment" > //Physfs Utilities//< / span >
00387 < span class = "comment" > public:< / span >
00394 < span class = "comment" > < / span > < span class = "keywordtype" > void< / span > InitPhysFS(string argv);
00395
00402 < span class = "keywordtype" > void< / span > AddPhysFSDir(string dir);
00403
00404 < span class = "preprocessor" > #endif //USE_PHYSFS< / span >
00405 < span class = "preprocessor" > < / span >
00406
00408 < span class = "comment" > //Data Loading + Unloading//< / span >
00410 < span class = "comment" > public:< / span >
00418 < span class = "comment" > < / span > SDL_Surface* < a class = "code" href = "classZE_1_1ZEngine.html#a26" > LoadImage< / a > (string filename);
00419
00420 < span class = "preprocessor" > #ifdef USE_SDL_MIXER< / span >
00421 < span class = "preprocessor" > < / span >
00428 Mix_Chunk* < a class = "code" href = "classZE_1_1ZEngine.html#a27" > LoadSound< / a > (string filename);
00429
00437 Mix_Music* < a class = "code" href = "classZE_1_1ZEngine.html#a28" > LoadMusic< / a > (string filename);
00438 < span class = "preprocessor" > #endif< / span >
00439 < span class = "preprocessor" > < / span >
00440 < span class = "preprocessor" > #ifdef USE_SDL_TTF< / span >
00441 < span class = "preprocessor" > < / span >
00449 TTF_Font* < a class = "code" href = "classZE_1_1ZEngine.html#a29" > LoadFont< / a > (string filename, < span class = "keywordtype" > int< / span > size);
00450 < span class = "preprocessor" > #endif < / span >
00451 < span class = "preprocessor" > < / span >
00453 < span class = "comment" > //Accessors//< / span >
00455 < span class = "comment" > < / span >
00456 < span class = "keyword" > public< / span > :
00463 < span class = "keywordtype" > int< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a30" > Width< / a > ();
00464
00471 < span class = "keywordtype" > int< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a31" > Height< / a > ();
2002-11-21 05:40:49 +00:00
00472
2002-12-01 07:56:17 +00:00
00479 < span class = "keywordtype" > int< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a32" > BPP< / a > ();
00480
00487 < span class = "keywordtype" > bool< / span > < a class = "code" href = "classZE_1_1ZEngine.html#a33" > IsFullscreen< / a > ();
00488 };
00489
00490 }
00491
00492 < span class = "preprocessor" > #endif //__ze_zengine_h__< / span >
< / pre > < / div > < hr > < address style = "align: right;" > < small > Generated on Sun Dec 1 02:44:14 2002 for ZEngine by
2002-11-21 05:40:49 +00:00
< a href = "http://www.doxygen.org/index.html" >
< img src = "doxygen.png" alt = "doxygen" align = "middle" border = 0
2002-12-01 07:56:17 +00:00
width=110 height=53>< / a > 1.2.18 < / small > < / address >
2002-11-21 05:40:49 +00:00
< / body >
< / html >