zengine/doc/html/ZE__ZEngine_8h-source.html

204 lines
14 KiB
HTML
Raw Normal View History

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">
<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__DataPtr_8h.html">ZE_DataPtr.h</a>"</span>
00028 <span class="preprocessor">#include "<a class="code" href="ZE__Error_8h.html">ZE_Error.h</a>"</span>
00029 <span class="preprocessor">#include "<a class="code" href="ZE__Defines_8h.html">ZE_Defines.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">CreateWindow</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">CloseWindow</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">GetDisplay</a>();
00171
00177 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZEngine.html#a5">UpdateScreen</a>();
00178
00190 Uint32 <a class="code" href="classZE_1_1ZEngine.html#a6">MapColor</a>(Uint8 r, Uint8 g, Uint8 b, Uint8 a=255);
00191
00199 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZEngine.html#a7">Clear</a>(Uint32 color=0, SDL_Rect *rect=NULL);
00200
00202 <span class="comment">//Timer and Framerate Independent Movement//</span>
00204 <span class="comment"> </span>
00205 <span class="keyword">private</span>:
00207 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#o7">mPaused</a>;
00209 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#o8">mUnpauseOnActive</a>;
00211 Uint32 <a class="code" href="classZE_1_1ZEngine.html#o9">mLastPause</a>;
00213 Uint32 <a class="code" href="classZE_1_1ZEngine.html#o10">mPausedTime</a>;
00215 Uint32 <a class="code" href="classZE_1_1ZEngine.html#o11">mLastTime</a>;
00217 <span class="keywordtype">double</span> <a class="code" href="classZE_1_1ZEngine.html#o12">mSecPerFrame</a>;
00218
00219 <span class="keyword">public</span>:
00226 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZEngine.html#a8">Sleep</a>(Uint32 milliseconds);
00227
00234 Uint32 <a class="code" href="classZE_1_1ZEngine.html#a9">GetTime</a>();
00235
00241 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZEngine.html#a10">PauseTimer</a>();
00242
00248 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZEngine.html#a11">UnpauseTimer</a>();
00249
00256 <span class="keywordtype">double</span> <a class="code" href="classZE_1_1ZEngine.html#a12">GetFrameTime</a>();
00257
00264 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#a13">IsPaused</a>();
00265
00267 <span class="comment">//Event and Input Handling//</span>
00269 <span class="comment"></span>
00270 <span class="keyword">private</span>:
00272 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#o13">mActive</a>;
00274 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#o14">mQuit</a>;
00276 Uint8 *<a class="code" href="classZE_1_1ZEngine.html#o15">mKeyPressed</a>;
00278 <span class="keywordtype">int</span> <a class="code" href="classZE_1_1ZEngine.html#o16">mMouseX</a>;
00280 <span class="keywordtype">int</span> <a class="code" href="classZE_1_1ZEngine.html#o17">mMouseY</a>;
00282 Uint8 <a class="code" href="classZE_1_1ZEngine.html#o18">mMouseB</a>;
00283
00284 <span class="keyword">public</span>:
00291 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#a14">IsActive</a>();
00292
00299 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZEngine.html#a15">RequestQuit</a>();
00300
00308 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#a16">QuitRequested</a>();
00309
00317 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#a17">KeyIsPressed</a>(SDLKey key);
00318
00324 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZEngine.html#a18">HideCursor</a>();
00325
00331 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZEngine.html#a19">ShowCursor</a>();
00332
00339 <span class="keywordtype">int</span> <a class="code" href="classZE_1_1ZEngine.html#a20">GetMouseX</a>();
00340
00347 <span class="keywordtype">int</span> <a class="code" href="classZE_1_1ZEngine.html#a21">GetMouseY</a>();
00348
00355 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#a22">LButtonPressed</a>();
00356
00363 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#a23">RButtonPressed</a>();
00364
00372 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#a24">MouseInRect</a>(SDL_Rect *rect);
00373
00379 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZEngine.html#a25">CheckEvents</a>();
00380
00381 <span class="preprocessor">#ifdef USE_PHYSFS</span>
00382 <span class="preprocessor"></span>
00383 <span class="comment">//Physfs Utilities//</span>
00385 <span class="comment"> public:</span>
00392 <span class="comment"></span> <span class="keywordtype">void</span> InitPhysFS(string argv);
00393
00400 <span class="keywordtype">void</span> AddPhysFSDir(string dir);
00401
00402 <span class="preprocessor">#endif //USE_PHYSFS</span>
00403 <span class="preprocessor"></span>
00404
00406 <span class="comment">//Data Loading + Unloading//</span>
00408 <span class="comment"> public:</span>
00416 <span class="comment"></span> <a class="code" href="classZE_1_1ImageData.html">ImageData</a> <a class="code" href="classZE_1_1ZEngine.html#a26">LoadImage</a>(string filename);
00417
00424 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZEngine.html#a27">FreeImage</a>(<a class="code" href="classZE_1_1ImageData.html">ImageData</a> &amp;image);
00425
00426 <span class="preprocessor">#ifdef USE_SDL_MIXER</span>
00427 <span class="preprocessor"></span>
00434 <a class="code" href="classZE_1_1SoundData.html">SoundData</a> <a class="code" href="classZE_1_1ZEngine.html#a28">LoadSound</a>(string filename);
00435
00442 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZEngine.html#a29">FreeSound</a>(<a class="code" href="classZE_1_1SoundData.html">SoundData</a> &amp;sound);
00443
00451 <a class="code" href="classZE_1_1MusicData.html">MusicData</a> <a class="code" href="classZE_1_1ZEngine.html#a30">LoadMusic</a>(string filename);
00452
00459 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZEngine.html#a31">FreeMusic</a>(<a class="code" href="classZE_1_1MusicData.html">MusicData</a> &amp;music);
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 <a class="code" href="classZE_1_1FontData.html">FontData</a> <a class="code" href="classZE_1_1ZEngine.html#a32">LoadFont</a>(string filename, <span class="keywordtype">int</span> size);
00472
00479 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZEngine.html#a33">FreeFont</a>(<a class="code" href="classZE_1_1FontData.html">FontData</a> &amp;font);
00480 <span class="preprocessor">#endif </span>
00481 <span class="preprocessor"></span>
00483 <span class="comment">//Accessors//</span>
00485 <span class="comment"> </span>
00486 <span class="keyword">public</span>:
00493 <span class="keywordtype">int</span> <a class="code" href="classZE_1_1ZEngine.html#a34">GetWidth</a>();
00494
00501 <span class="keywordtype">int</span> <a class="code" href="classZE_1_1ZEngine.html#a35">GetHeight</a>();
00502
00509 <span class="keywordtype">int</span> <a class="code" href="classZE_1_1ZEngine.html#a36">GetBPP</a>();
00510
00517 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZEngine.html#a37">IsFullscreen</a>();
00518 };
00519
00520 }
00521
00522 <span class="preprocessor">#endif //__ze_zengine_h__</span>
</pre></div><hr><address style="align: right;"><small>Generated on Wed Nov 20 01:18:05 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>