Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

SceneRenderer.h

00001 
00002 #ifndef __SCENERENDERER_H_
00003 #define __SCENERENDERER_H_
00004 /*
00005 Peon - Win32 Games Programming Library
00006 Copyright (C) 2002-2005 Erik Yuzwa
00007 
00008 This library is free software; you can redistribute it and/or
00009 modify it under the terms of the GNU Library General Public
00010 License as published by the Free Software Foundation; either
00011 version 2 of the License, or (at your option) any later version.
00012 
00013 This library is distributed in the hope that it will be useful,
00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016 Library General Public License for more details.
00017 
00018 You should have received a copy of the GNU Library General Public
00019 License along with this library; if not, write to the Free
00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021 
00022 Erik Yuzwa
00023 peon AT wazooinc DOT com
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                 //void setTexture( SceneTexture* pTex );
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

Generated on Thu Dec 1 01:55:40 2005 for Peon by  doxygen 1.4.1