00001
00002 #ifndef __SCENERENDERER_H_
00003 #define __SCENERENDERER_H_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "IUnknown.h"
00028 #include "PrimTypes.h"
00029 #include "SceneCamera.h"
00030 #include "SceneLight.h"
00031 #include "SceneTexture.h"
00032 #include "SceneFont.h"
00033 #include "Matrix44.h"
00034
00040 #define MAX_LIGHTS 7
00041
00042 namespace peon
00043 {
00050 class PEONMAIN_API SceneRenderer : public IUnknown
00051 {
00052 protected:
00054 SDL_Surface* m_pOGLSurface;
00055
00057 int m_iDeviceWidth;
00058
00060 int m_iDeviceHeight;
00061
00063 int m_iBitsPerPixel;
00064
00066 bool m_bWindowed;
00067
00069 SceneCamera* m_pActiveCamera;
00070
00072 SceneLight m_oLights[MAX_LIGHTS];
00073
00074 public:
00078 SceneRenderer();
00079
00083 ~SceneRenderer();
00084
00091 bool loadDevice( IniConfigReader* pConfig );
00092
00096 void unloadDevice();
00097
00103 bool clearDevice();
00104
00109 void flipDevice();
00110
00117 void drawPrim( DiffusePrim* pVertices, int count );
00118
00125 void drawPrim( DiffuseTexPrim* pVertices, int count );
00126
00133 void drawPrim( NormalDiffuseTexPrim* pVertices, int count );
00134
00141 void drawQuads( NormalDiffuseTexPrim* pVertices, int count );
00142
00149 void setLight(int light_slot, const SceneLight& oLight);
00150
00160 SceneTexture* loadTexture( const String& strFilename, bool bAlpha = true,
00161 bool bMipMaps = true, bool bRepeat = false);
00162
00168
00169
00178 SceneFont* loadFont( int char_width = 16, int char_height = 16, int char_spacing = 10 );
00179
00184 SceneCamera* getActiveCamera(){ return m_pActiveCamera; }
00185
00190 int getWidth(){ return m_iDeviceWidth; }
00191
00196 int getHeight(){ return m_iDeviceHeight; }
00197
00203 bool isExtensionSupported( const String& strExtension );
00204
00208 void getScreenCapture();
00209
00215 void getProjectionMatrix( Matrix44& pMat );
00216
00222 void getModelViewMatrix( Matrix44& pMat );
00223
00224 };
00225 }
00226
00227 #endif