Morph-SynRJ
view cmn_intro.h @ 0:22de913c2d84
morph-synrj intro
| author | "Cedric Pinson <cedric.pinson@alcove.fr> <mornifle@plopbyte.net>" |
|---|---|
| date | Tue Nov 27 15:23:52 2007 +0100 (2007-11-27) |
| parents | |
| children |
line source
1 #ifndef CMN_INTRO_H
2 #define CMN_INTRO_H
4 #include "mth_vector3.h"
5 #include "rdr_font.h"
8 extern rdrFont_t* font;
13 // define common
14 #define RX 800
15 #define RY 600
19 // DBUG TIME (Console)
20 #ifdef SOTA_DEBUG_MODE
21 #include <windows.h>
22 #include <cstring>
23 #include <cstdio>
24 extern HANDLE stdOut;
25 void Write2Console(const char * data );
27 #endif
30 /**
31 * Clear screen for all effects
32 */
33 #define DEFAULT_BGCOLOR_R 0
34 #define DEFAULT_BGCOLOR_G 0
35 #define DEFAULT_BGCOLOR_B 0
36 void cmnClearScreen(float r=DEFAULT_BGCOLOR_R,float g=DEFAULT_BGCOLOR_G,float b=DEFAULT_BGCOLOR_B,float a=1.0);
38 void cmnSetCamera(const mth::Vector3_t& _position,
39 const mth::Vector3_t& _lookat,
40 const mth::Vector3_t& _up=mth::Vector3_t(0,1,0));
42 void cmnSetFrustrum(float _fov=120,float _zmin=0.1,float _zmax=1000);
44 void cmnSetPlanarView();
46 void cmnDisplayBackground(GLuint _texture,int _r=33,int _g=137,int _b=255,int _a=255, int _nbPasses=2,int _side=0);
49 /// use this in your effect ( at the begin and at the end)
50 #ifndef FINAL_RELEASE
51 void cmnPushGLState();
52 void cmnPopGLState();
53 #else
54 #define cmnPushGLState() glPushAttrib(GL_ALL_ATTRIB_BITS)
55 #define cmnPopGLState glPopAttrib
56 #endif
58 void cmnPushMatrix();
59 void cmnPopMatrix();
62 void cmnScope(unsigned char alpha=100, float trans=0.68);
65 /// Timer class update it at each frame
66 class cmnTimer_t
67 {
68 double startTime;
69 double frameTime;
70 double currentTime;
72 public:
74 void Init();
76 double GetRealTime();
77 double GetFrameTime();
79 void Update();
80 };
83 extern cmnTimer_t* Timer;
85 #endif
