zengine/doc/html/ZE__ZEngine_8h-source.html
2002-12-05 00:05:06 +00:00

204 lines
14 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>/home/James/ZEngine-dev/include/ZE_ZEngine.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3-rc1 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="namespacemembers.html">Namespace Members</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center>
<hr><h1>/home/James/ZEngine-dev/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>
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>
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>
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
00046 <span class="keyword">class </span>ZEngine
00047 {
00049 <span class="comment">//Singleton + Memory Management//</span>
00051 <span class="comment"></span>
00052 <span class="keyword">private</span>:
00054 <span class="keyword">static</span> <a class="code" href="classZE_1_1ZEngine.html#c0">ZEngine</a> *<a class="code" href="classZE_1_1ZEngine.html#r0">sInstance</a>;
00055
00061 <a class="code" href="classZE_1_1ZEngine.html#c0">ZEngine</a>();
00062
00063 <span class="keyword">public</span>:
00064
00071 <span class="keyword">static</span> <a class="code" href="classZE_1_1ZEngine.html#c0">ZEngine</a>* <a class="code" href="classZE_1_1ZEngine.html#d0">GetInstance</a>();
00072
00078 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZEngine.html#d1">ReleaseInstance</a>();
00079
00086 <span class="keyword">static</span> string <a class="code" href="classZE_1_1ZEngine.html#d2">GetVersion</a>();
00087
00089 <span class="comment">//Initialization//</span>
00091 <span class="comment"></span>
00092 <span class="keyword">private</span>:
00094 <span class="keywordtype">int</span> <a class="code" href="classZE_1_1ZEngine.html#o0">mWidth</a>;
00096 <span class="keywordtype">int</span> <a class="code" href="classZE_1_1ZEngine.html#o1">mHeight</a>;
00098 <span class="keywordtype">int</span> <a class="code" href="classZE_1_1ZEngine.html#o2">mBPP</a>;
00100 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#o3">mFullscreen</a>;
00101
00102 <span class="preprocessor">#ifdef USE_SDL_MIXER </span>
<a name="l00103"></a><a class="code" href="classZE_1_1ZEngine.html#o4">00103</a> <span class="preprocessor"></span>
00104 <span class="keywordtype">int</span> <a class="code" href="classZE_1_1ZEngine.html#o4">mRate</a>;
00106 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#o5">mStereo</a>;
00107 <span class="preprocessor">#endif </span>
00108 <span class="preprocessor"></span>
00109
00110 <span class="keyword">public</span>:
00111 <span class="comment">//add initialization</span>
00112
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);
00124
00125 <span class="preprocessor">#ifdef USE_SDL_MIXER</span>
00126 <span class="preprocessor"></span>
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);
00135 <span class="preprocessor">#endif </span>
00136 <span class="preprocessor"></span>
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>);
00147
00153 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZEngine.html#a3">CloseDisplay</a>();
00154
00156 <span class="comment">//Screen Access//</span>
00158 <span class="comment"></span>
00159 <span class="keyword">private</span>:
00161 SDL_Surface *<a class="code" href="classZE_1_1ZEngine.html#o6">mScreen</a>;
00162
00163 <span class="keyword">public</span>:
00170 SDL_Surface *<a class="code" href="classZE_1_1ZEngine.html#a4">Display</a>();
00171
00177 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZEngine.html#a5">UpdateScreen</a>();
00178
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>:
00209 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#o7">mPaused</a>;
00211 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#o8">mUnpauseOnActive</a>;
00213 Uint32 <a class="code" href="classZE_1_1ZEngine.html#o9">mLastPause</a>;
00215 Uint32 <a class="code" href="classZE_1_1ZEngine.html#o10">mPausedTime</a>;
00217 Uint32 <a class="code" href="classZE_1_1ZEngine.html#o11">mLastTime</a>;
00219 <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>:
00274 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#o13">mActive</a>;
00276 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#o14">mQuit</a>;
00278 Uint8 *<a class="code" href="classZE_1_1ZEngine.html#o15">mKeyIsPressed</a>;
00280 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#o16">mKeyPress</a>[SDLK_LAST];
00282 <span class="keywordtype">int</span> <a class="code" href="classZE_1_1ZEngine.html#o17">mMouseX</a>;
00284 <span class="keywordtype">int</span> <a class="code" href="classZE_1_1ZEngine.html#o18">mMouseY</a>;
00286 Uint8 <a class="code" href="classZE_1_1ZEngine.html#o19">mMouseB</a>;
00287
00288 <span class="keyword">public</span>:
00295 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#a14">IsActive</a>();
00296
00303 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZEngine.html#a15">RequestQuit</a>();
00304
00312 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#a16">QuitRequested</a>();
00313
00323 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZEngine.html#a17">SetKeyRepeatRate</a>(<span class="keywordtype">int</span> rate);
00324
00332 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#a18">KeyIsPressed</a>(SDLKey key);
00333
00341 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#a19">KeyPress</a>(SDLKey key);
00342
00348 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZEngine.html#a20">HideCursor</a>();
00349
00355 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZEngine.html#a21">ShowCursor</a>();
00356
00363 <span class="keywordtype">int</span> <a class="code" href="classZE_1_1ZEngine.html#a22">MouseX</a>();
00364
00371 <span class="keywordtype">int</span> <a class="code" href="classZE_1_1ZEngine.html#a23">MouseY</a>();
00372
00379 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#a24">LButtonPressed</a>();
00380
00387 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#a25">RButtonPressed</a>();
00388
00396 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#a26">MouseInRect</a>(SDL_Rect *rect);
00397
00403 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZEngine.html#a27">CheckEvents</a>();
00404
00405 <span class="preprocessor">#ifdef USE_PHYSFS</span>
00406 <span class="preprocessor"></span>
00407 <span class="comment">//Physfs Utilities//</span>
00409 <span class="comment"> public:</span>
00416 <span class="comment"></span> <span class="keywordtype">void</span> InitPhysFS(string argv);
00417
00424 <span class="keywordtype">void</span> AddPhysFSDir(string dir);
00425
00426 <span class="preprocessor">#endif //USE_PHYSFS</span>
00427 <span class="preprocessor"></span>
00428
00430 <span class="comment">//Data Loading + Unloading//</span>
00432 <span class="comment"> public:</span>
00440 <span class="comment"></span> SDL_Surface* <a class="code" href="classZE_1_1ZEngine.html#a28">LoadImage</a>(string filename);
00441
00442 <span class="preprocessor">#ifdef USE_SDL_MIXER</span>
00443 <span class="preprocessor"></span>
00450 Mix_Chunk* <a class="code" href="classZE_1_1ZEngine.html#a29">LoadSound</a>(string filename);
00451
00459 Mix_Music* <a class="code" href="classZE_1_1ZEngine.html#a30">LoadMusic</a>(string filename);
00460 <span class="preprocessor">#endif</span>
00461 <span class="preprocessor"></span>
00462 <span class="preprocessor">#ifdef USE_SDL_TTF</span>
00463 <span class="preprocessor"></span>
00471 TTF_Font* <a class="code" href="classZE_1_1ZEngine.html#a31">LoadFont</a>(string filename, <span class="keywordtype">int</span> size);
00472 <span class="preprocessor">#endif </span>
00473 <span class="preprocessor"></span>
00475 <span class="comment">//Accessors//</span>
00477 <span class="comment"></span>
00478 <span class="keyword">public</span>:
00485 <span class="keywordtype">int</span> <a class="code" href="classZE_1_1ZEngine.html#a32">Width</a>();
00486
00493 <span class="keywordtype">int</span> <a class="code" href="classZE_1_1ZEngine.html#a33">Height</a>();
00494
00501 <span class="keywordtype">int</span> <a class="code" href="classZE_1_1ZEngine.html#a34">BPP</a>();
00502
00509 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#a35">IsFullscreen</a>();
00510 };
00511
00512 }
00513
00514 <span class="preprocessor">#endif //__ze_zengine_h__</span>
</pre></div><hr><address style="align: right;"><small>Generated on Wed Dec 4 19:01:30 2002 for ZEngine by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0
width=110 height=53></a>1.3-rc1 </small></address>
</body>
</html>