"L. Spiro Engine"

F:/My Projects/LSEngine/Modules/LSGraphicsLib/Src/RenderQueue/LSGRenderQueue.h

00001 
00016 #ifndef __LSG_RENDERQUEUE_H__
00017 #define __LSG_RENDERQUEUE_H__
00018 
00019 #include "../LSGGraphicsLib.h"
00020 #include "../DirectXRenderQueue/LSGDirectX9RenderQueue.h"
00021 #include "../DirectXRenderQueue/LSGDirectX10RenderQueue.h"
00022 #include "../DirectXRenderQueue/LSGDirectX11RenderQueue.h"
00023 #include "../OpenGLESRenderQueue/LSGOpenGlEsRenderQueue.h"
00024 #include "../OpenGLRenderQueue/LSGOpenGlRenderQueue.h"
00025 
00026 namespace lsg {
00027 
00034         class CRenderQueue : public
00035 #if defined( LSG_DX9 )
00036                 CDirectX9RenderQueue
00037 #elif defined( LSG_DX10 )
00038                 CDirectX10RenderQueue
00039 #elif defined( LSG_DX11 )
00040                 CDirectX11RenderQueue
00041 #elif defined( LSG_OGL )
00042                 COpenGlRenderQueue
00043 #elif defined( LSG_OGLES )
00044                 COpenGlEsRenderQueue
00045 #endif  // #if defined( LSG_DX9 )
00046         {
00047         public :
00048                 // == Various constructors.
00049                 LSE_CALLCTOR                                                    CRenderQueue();
00050 
00051 
00052                 // == Operators.
00059                 LSE_INLINE CRenderQueue & LSE_CALL              operator = ( const CRenderQueue &_rqOther );
00060 
00061 
00062                 // == Functions.
00066                 LSE_INLINE LSVOID LSE_CALL                              RenderNormal() const;
00067 
00071                 LSE_INLINE LSVOID LSE_CALL                              RenderAmbient() const;
00072 
00076                 LSE_INLINE LSVOID LSE_CALL                              RenderLighting() const;
00077 
00081                 LSE_INLINE LSVOID LSE_CALL                              RenderShadowMap() const;
00082 
00088                 LSE_INLINE LSVOID LSE_CALL                              Render( LSG_RENDER_TYPE _rtRenderType ) const;
00089 
00093                 LSE_INLINE LSVOID LSE_CALL                              PrepareUnsortedRender();
00094 
00095         protected :
00096                 // == Members.
00097 
00098         private :
00099 #if defined( LSG_DX9 )
00100                 typedef CDirectX9RenderQueue                    Parent;
00101 #elif defined( LSG_DX10 )
00102                 typedef CDirectX10RenderQueue                   Parent;
00103 #elif defined( LSG_DX11 )
00104                 typedef CDirectX11RenderQueue                   Parent;
00105 #elif defined( LSG_OGL )
00106                 typedef COpenGlRenderQueue                              Parent;
00107 #elif defined( LSG_OGLES )
00108                 typedef COpenGlEsRenderQueue                    Parent;
00109 #endif  // #if defined( LSG_DX9 )
00110         };
00111 
00112 
00113         // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00114         // DEFINITIONS
00115         // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00116         // == Operators.
00123         LSE_INLINE CRenderQueue & LSE_CALL CRenderQueue::operator = ( const CRenderQueue &_rqOther ) {
00124                 m_vList = _rqOther.m_vList;
00125                 return (*this);
00126         }
00127 
00128         // == Functions.
00132         LSE_INLINE LSVOID LSE_CALL CRenderQueue::RenderNormal() const {
00133                 const LSUINT32 * pui32Indices = m_isSorter.GetIndices();
00134                 for ( LSUINT32 I = 0UL; I < m_vList.Length(); ++I ) {
00135                         m_vList[pui32Indices[I]].prqcSender->FinalRenderStandard( m_vList[pui32Indices[I]].uiptrUser );
00136                 }
00137         }
00138 
00142         LSE_INLINE LSVOID LSE_CALL CRenderQueue::RenderAmbient() const {
00143                 const LSUINT32 * pui32Indices = m_isSorter.GetIndices();
00144                 for ( LSUINT32 I = 0UL; I < m_vList.Length(); ++I ) {
00145                         m_vList[pui32Indices[I]].prqcSender->FinalRenderAmbientOnly( m_vList[pui32Indices[I]].uiptrUser );
00146                 }
00147         }
00148 
00152         LSE_INLINE LSVOID LSE_CALL CRenderQueue::RenderLighting() const {
00153                 const LSUINT32 * pui32Indices = m_isSorter.GetIndices();
00154                 for ( LSUINT32 I = 0UL; I < m_vList.Length(); ++I ) {
00155                         m_vList[pui32Indices[I]].prqcSender->FinalRenderLighting( m_vList[pui32Indices[I]].uiptrUser );
00156                 }
00157         }
00158 
00162         LSE_INLINE LSVOID LSE_CALL CRenderQueue::RenderShadowMap() const {
00163                 const LSUINT32 * pui32Indices = m_isSorter.GetIndices();
00164                 for ( LSUINT32 I = 0UL; I < m_vList.Length(); ++I ) {
00165                         m_vList[pui32Indices[I]].prqcSender->FinalRenderShadowMap( m_vList[pui32Indices[I]].uiptrUser );
00166                 }
00167         }
00168 
00174         LSE_INLINE LSVOID LSE_CALL CRenderQueue::Render( LSG_RENDER_TYPE _rtRenderType ) const {
00175                 const LSUINT32 * pui32Indices = m_isSorter.GetIndices();
00176                 for ( LSUINT32 I = 0UL; I < m_vList.Length(); ++I ) {
00177                         m_vList[pui32Indices[I]].prqcSender->FinalRender( _rtRenderType, m_vList[pui32Indices[I]].uiptrUser );
00178                 }
00179         }
00180 
00184         LSE_INLINE LSVOID LSE_CALL CRenderQueue::PrepareUnsortedRender() {
00185                 m_isSorter.PrepareFor( m_vList.Length() );
00186         }
00187 
00188 }       // namespace lsg
00189 
00190 #endif  // __LSG_RENDERQUEUE_H__
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator