"L. Spiro Engine"

F:/My Projects/LSEngine/Modules/LSGraphicsLib/Src/Fnd/LSGFndBase.h

00001 
00017 #ifndef __LSG_FNDBASE_H__
00018 #define __LSG_FNDBASE_H__
00019 
00020 #ifndef __LSG_GRAPHICSLIB_H__
00021 #error "This file may not be included directly; it is for internal use only."
00022 #endif  // #ifndef __LSG_GRAPHICSLIB_H__
00023 #include "LSGFndConstants.h"
00024 #include "Matrix/LSMMatrix4x4.h"
00025 #include "Vector/LSMVector2.h"
00026 #include "Vector/LSMVector3.h"
00027 #include "Vector/LSMVector4.h"
00028 
00029 namespace lsg {
00030 
00031         // == Enumerations.
00035         enum LSG_LIGHT_TYPES {
00036                 LSG_LT_NONE,                                                                                    
00037                 LSG_LT_DIR,                                                                                             
00038                 LSG_LT_POINT,                                                                                   
00039                 LSG_LT_SPOT,                                                                                    
00040         };
00041 
00045         enum LSG_BLEND_MODES {
00046                 LSG_BM_ZERO,                                                                                    
00047                 LSG_BM_ONE,                                                                                             
00048                 LSG_BM_SRC_COLOR,                                                                               
00049                 LSG_BM_INV_SRC_COLOR,                                                                   
00050                 LSG_BM_DST_COLOR,                                                                               
00051                 LSG_BM_INV_DST_COLOR,                                                                   
00052                 LSG_BM_SRC_ALPHA,                                                                               
00053                 LSG_BM_INV_SRC_ALPHA,                                                                   
00054                 LSG_BM_DST_ALPHA,                                                                               
00055                 LSG_BM_INV_DEST_ALPHA,                                                                  
00056                 LSG_BM_SRC_ALPHA_SAT,                                                                   
00057                 LSG_BM_TOTAL,
00058 
00059                 LSG_BM_FORCE_DWORD                                                                              = 0x7FFFFFFF
00060         };
00061 
00065         enum LSG_FILL_MODES {
00066                 LSG_FM_SOLID,                                                                                   
00067                 LSG_FM_WIRE,                                                                                    
00068         };
00069 
00073         enum LSG_DEPTH_TEST {
00074                 LSG_DT_NEVER,                                                                                   
00075                 LSG_DT_ALWAYS,                                                                                  
00076                 LSG_DT_LESS,                                                                                    
00077                 LSG_DT_EQUAL,                                                                                   
00078                 LSG_DT_NOTEQUAL,                                                                                
00079                 LSG_DT_LESSEQUAL,                                                                               
00080                 LSG_DT_GREATER,                                                                                 
00081                 LSG_DT_GREATEREQUAL,                                                                    
00082         };
00083 
00084         class CPostProcessor;
00085         class CRenderTargetManager;
00086         class CVertexBuffer;
00087 
00096         class CFndBase {
00097         protected :
00098                 friend class                                                                                    CFnd;
00099                 friend class                                                                                    CGraphicsLib;
00100                 friend class                                                                                    COpenGl;
00101                 friend class                                                                                    COpenGlEs;
00102                 friend class                                                                                    CDirectX9;
00103                 friend class                                                                                    CDirectX10;
00104                 friend class                                                                                    CDirectX11;
00105 
00106 
00107                 // == Types.
00112                 typedef struct LSG_LIGHT {
00116                         CVector4                                                                                        vPos;
00117 
00121                         CVector3                                                                                        vDir;
00122                         
00126                         CVector3                                                                                        vDiffuse;
00127 
00131                         CVector3                                                                                        vAmbient;
00132 
00136                         CVector3                                                                                        vSpecular;
00137 
00141                         LSG_LIGHT_TYPES                                                                         ltType;
00142 
00143                 } * LPLSG_LIGHT, * const LPCLSG_LIGHT;
00144 
00148                 typedef struct LSG_METRICS {
00152                         LSUINT32                                                                                        ui32MaxRenderTargetSize;
00153 
00157                         LSUINT32                                                                                        ui32MaxRenderTargets;
00158 
00162                         LSUINT32                                                                                        ui32MaxTextureWidth;
00163 
00167                         LSUINT32                                                                                        ui32MaxTextureHeight;
00168 
00172                         LSUINT32                                                                                        ui32MaxAniso;
00173 
00177                         LSBOOL                                                                                          bNonPo2;
00178 
00182                         LSUINT32                                                                                        ui32MaxTexSlot;
00183 
00187                         LSBOOL                                                                                          bDdsSupport;
00188 
00192                         LSBOOL                                                                                          bPackedDepthStencil;
00193 
00197                         LSBOOL                                                                                          bDepthIsReadable;
00198                 } * LPLSG_METRICS, * const LPCLSG_METRICS;
00199 
00200 
00201                 // == Members.
00205                 static LSG_METRICS                                                                              m_mMetrics;
00206 
00210                 static CMatrix4x4                                                                               m_mWorldMatrix;
00211 
00215                 static CMatrix4x4                                                                               m_mViewMatrix;
00216 
00220                 static CMatrix4x4                                                                               m_mProjMatrix;
00221 
00226                 static CMatrix4x4                                                                               m_mWorldViewMatrix;
00227 
00232                 static CMatrix4x4                                                                               m_mWorldViewProjMatrix;
00233 
00237                 static CMatrix3x3                                                                               m_mNormalMatrix;
00238 
00243                 static CMatrix4x4                                                                               m_mInverseWorldViewMatrix;
00244 
00248                 static LSBOOL                                                                                   m_bWorldDirty;
00249 
00253                 static LSBOOL                                                                                   m_bViewDirty;
00254 
00258                 static LSBOOL                                                                                   m_bProjDirty;
00259 
00263                 static LSBOOL                                                                                   m_bFlipRender;
00264 
00268                 static LSUINT32                                                                                 m_ui32ScreenWidth;
00269 
00273                 static LSUINT32                                                                                 m_ui32ScreenHeight;
00274 
00278                 static LSINT32                                                                                  m_i32ViewportX;
00279 
00283                 static LSINT32                                                                                  m_i32ViewportY;
00284 
00288                 static LSINT32                                                                                  m_i32ViewportWidth;
00289 
00293                 static LSINT32                                                                                  m_i32ViewportHeight;
00294 
00298                 static LSINT32                                                                                  m_i32LastViewportX;
00299 
00303                 static LSINT32                                                                                  m_i32LastViewportY;
00304 
00308                 static LSINT32                                                                                  m_i32LastViewportWidth;
00309 
00313                 static LSINT32                                                                                  m_i32LastViewportHeight;
00314 
00318                 static LSUINT32                                                                                 m_ui32ViewStoreCount;
00319 
00323                 static CVector4                                                                                 m_vDiffuseMaterial;
00324 
00328                 static CVector4                                                                                 m_vAmbientMaterial;
00329 
00333                 static CVector4                                                                                 m_vEmissiveMaterial;
00334 
00338                 static CVector4                                                                                 m_vSpecularMaterial;
00339 
00343                 static LSREAL                                                                                   m_fPower;
00344 
00348                 static CVector2                                                                                 m_vRoughness;
00349 
00353                 static CVector2                                                                                 m_vAnisotropic;
00354 
00358                 static LSG_LIGHT                                                                                m_lLights[LSG_MAX_LIGHTS];
00359 
00363                 static LSUINT32                                                                                 m_ui32MaxLight;
00364 
00368                 static CVector3                                                                                 m_vGroundColor;
00369 
00373                 static CVector3                                                                                 m_vSkyColor;
00374 
00378                 static LSBOOL                                                                                   m_bHemisphere;
00379 
00383                 static LSFLOAT                                                                                  m_fGaussian;
00384 
00388                 static LSFLOAT                                                                                  m_fExposure;
00389 
00393                 static LSFLOAT                                                                                  m_fBrightCutoff;
00394 
00398                 static LSFLOAT                                                                                  m_fTimeSinceLastFrame;
00399 
00403                 static LSBOOL                                                                                   m_bBlending;
00404 
00408                 static LSG_BLEND_MODES                                                                  m_bmSrcBlend;
00409 
00413                 static LSG_BLEND_MODES                                                                  m_bmDstBlend;
00414 
00418                 static LSG_FILL_MODES                                                                   m_fmFillMode;
00419 
00423                 static LSG_DEPTH_TEST                                                                   m_dtDepthTestFunc;
00424 
00428                 static LSBOOL                                                                                   m_bDepthWrite;
00429 
00433                 static LSBOOL                                                                                   m_bShadowMapActive;
00434 
00438                 static CMatrix4x4                                                                               m_mShadowMapMatrix;
00439 
00443                 static CVector3                                                                                 m_vShadowMapUVDepth;
00444 
00448                 static LSREAL                                                                                   m_fShadowMapCasterSize;
00449 
00453                 static LSBOOL                                                                                   m_bMakeDepthCopy;
00454 
00458                 static LSBOOL                                                                                   m_bMakeNormalCopy;
00459 
00463                 static CRenderTargetManager *                                                   m_prtmRenderTargetMan;
00464 
00468                 static CPostProcessor *                                                                 m_pppPostProcessor;
00469 
00473                 static CVertexBuffer *                                                                  m_pcbBlitVerts;
00474 
00475 
00476                 // == Functions.
00480                 static LSVOID LSE_CALL                                                                  InitFnd();
00481 
00485                 static LSVOID LSE_CALL                                                                  ShutDownFnd();
00486 
00487 
00488 
00489                 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00490                 // POST PROCESSING
00491                 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00498                 static CVertexBuffer * LSE_CALL                                                 GetPostProcVertBuf();
00499         };
00500 
00501 
00502         // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00503         // DEFINITIONS
00504         // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00505 
00506 }       // namespace lsg
00507 
00508 #endif  // __LSG_FNDBASE_H__
00509 
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator