00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _ENGINE_H
00026 #define _ENGINE_H
00027
00028 #ifdef WIN32
00029 #include <windows.h>
00030 #endif
00031
00032
00033 #include <string>
00034 #include "color.h"
00035 #include "system.h"
00036 #include "log.h"
00037 #include "font.h"
00038 #include "fps.h"
00039
00040
00041 #include "texture.h"
00042 #include "renderer.h"
00043 #include "bsp.h"
00044 #include "scene.h"
00045 #include "camera.h"
00046 #include "font.h"
00047 #include "gltools.h"
00048 #include "parser.h"
00049 #include "skybox.h"
00050 #include "shader.h"
00051 #include "patch.h"
00052 #include "models_md2.h"
00053
00054 #include "build.h"
00055
00056
00057
00058
00059 struct SDL_Surface;
00060
00061 namespace ngn
00062 {
00063 class InputHandler;
00064 }
00065
00066 class NGN;
00067
00068
00070 NGN_API NGN& WINAPI ngnCreate( ngn::InputHandler *input, int width, int height, int bpp, const std::string& name, bool fullscreen=false );
00072 NGN_API NGN& WINAPI ngnGet();
00074 NGN_API void WINAPI ngnQuit();
00075
00076
00080 class NGN_API NGN
00081 {
00082
00083 friend NGN_API NGN& WINAPI ngnCreate( ngn::InputHandler *input, int width, int height, int bpp, const std::string& name, bool fullscreen );
00084 friend NGN_API NGN& WINAPI ngnGet();
00085 friend NGN_API void WINAPI ngnQuit();
00086
00087
00088 public:
00089 virtual ~NGN();
00091 void toggleFullscreen();
00093 void resize( int w, int h, int d );
00095 void setCursorVisible( bool state );
00097 void setBackgroundColor( const ngn::core::Colorf& colour );
00099 int getMouseX() const;
00101 int getMouseY() const;
00102
00104 int getWidth();
00106 int getHeight();
00108 int getColorDepth() const;
00110 const std::string& getCaption() const;
00112 bool isFullscreen() const;
00114 bool isRunning() const;
00116 bool isCursorVisible() const;
00118 const ngn::core::Colorf& getBackgroundColor() const;
00120 const ngn::SystemInfo& getSystemInfo() const;
00122 const std::string& getVersion() const;
00124 ngn::FontManager& getFontManager();
00126 static ngn::core::FPS& getTimer();
00128 void setDebugMode( bool state );
00130 bool isDebugMode() const;
00132 ngn::sys::Log& getLogManager();
00133
00134 private:
00135
00136 NGN( ngn::InputHandler *input, int width, int height, int bpp, const std::string& name, bool fullscreen=false );
00137
00138
00139 bool initSDL();
00140
00141 SDL_Surface* m_win;
00142 ngn::InputHandler* m_input;
00143 ngn::SystemInfo m_sysinfo;
00144 int m_width;
00145 int m_height;
00146 int m_depth;
00147 std::string m_caption;
00148 std::string m_version;
00149 bool m_fullscreen;
00150 bool m_runs;
00151 bool m_cursor_visible;
00152
00153 ngn::core::Colorf m_bg_color;
00154
00155 ngn::sys::Log slog;
00156
00157 ngn::FontManager m_fontmanager;
00158
00159 unsigned int m_font0;
00160
00161 static ngn::core::FPS m_fps;
00162
00163 bool m_debug_mode;
00164
00165
00166 friend class ngn::core::Texture;
00167 friend class ngn::gl::Renderer;
00168 friend class ngn::Camera;
00169 friend class ngn::core::Bsp;
00170 friend class ngn::Scene;
00171 friend class ngn::core::Font;
00172 friend class ngn::core::SkyboxScriptParser;
00173 friend class ngn::Skybox;
00174 friend void ngn::gl::Enter2DMode();
00175 friend class ngn::gl::Shader;
00176 friend class ngn::gl::ShaderProgram;
00177 friend class ngn::core::bsp::Q3Patch;
00178 friend class ngn::Md2Model;
00179
00180 };
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211 #endif