00001
00008 #ifndef _GLOBALS_H_
00009 #define _GLOBALS_H_
00010
00011
00012
00013
00014
00015
00016
00017
00019 #if defined (__WIN32__) || defined(_WIN32) || defined(__CYGWIN__)
00020 #define _WIN_
00021 #include <windows.h>
00022 #else
00024 #include <sys/time.h>
00025 #endif
00026
00027
00028 #ifdef _WIN_
00029 #include "../extern/SDL/SDL.h"
00030 #else
00031 #include <SDL/SDL.h>
00032 #endif
00033
00035 #include "../extern/glew/glew.h"
00036 #include <GL/glu.h>
00037
00039 #ifdef USE_CL
00040 #include "../extern/CL/cl.h"
00041 #include "../extern/CL/cl_gl.h"
00042 #endif
00043
00045 #include <cstdio>
00046 #include <cstdlib>
00047 #include <cstdarg>
00048 #include <malloc.h>
00049 #include <memory.h>
00050 #include <string>
00051 #include <fstream>
00052 #include <iostream>
00053 #include <sstream>
00054 #include <vector>
00055 #include <map>
00056 #include <cmath>
00057
00058 using namespace std;
00060 const int ERR = -1;
00061
00063 enum Axes {A_X, A_Y, A_Z};
00064
00066 enum LightModels{GOURAUD,PHONG,NONE};
00068 enum LightComponents{AMBIENT,DIFFUSE,SPECULAR};
00069
00071 enum TextureTypes{BASE,ENV,BUMP,PARALLAX,DISPLACE,CUBEMAP,CUBEMAP_ENV, ALPHA,
00072 SHADOW,RENDER_TEXTURE,NORMAL_TEXTURE,BLOOM_TEXTURE, BLUR_TEXTURE};
00074 enum TextureMods{ADD,MODULATE,DECAL,BLEND,REPLACE};
00075
00077 enum font_type{NORMAL,TIMES,HELVETICA};
00079 enum font_size{SMALL,MEDIUM,LARGE};
00080
00087 inline void ShowMessage(const char *msg,bool info=true)
00088 {
00089 if(!info)
00090 {
00091 #ifdef _WIN_
00092 MessageBox(NULL,msg,"ERROR",MB_ICONERROR);
00093 #else
00094 cerr<<"ERROR: "<<msg<<endl;
00095 #endif
00096 }
00097 else
00098 {
00099 #ifdef _WIN_
00100 MessageBox(NULL,msg,"Info",MB_ICONINFORMATION);
00101 #else
00102 cout<<msg<<endl;
00103 #endif
00104 }
00105 }
00106
00113 template <class T> inline string num2str(const T& t)
00114 {
00115 stringstream ss;
00116 ss << t;
00117 return ss.str();
00118 }
00119
00120
00121 #endif