"L. Spiro Engine"

F:/My Projects/LSEngine/Modules/LSGraphicsLib/Src/OpenGLES/LSGOpenGlEsStandardTexture.h

00001 
00016 #ifndef __LSG_OPENGLESSTANDARDTEXTURE_H__
00017 #define __LSG_OPENGLESSTANDARDTEXTURE_H__
00018 
00019 #include "../LSGGraphicsLib.h"
00020 #include "../Texture/LSGTextureBase.h"
00021 #include "CriticalSection/LSHCriticalSection.h"
00022 #include "Image/LSIImage.h"
00023 #include "Map/LSTLMap.h"
00024 
00025 #ifdef LSG_OGLES
00026 
00027 namespace lsg {
00028 
00035         class COpenGlEsStandardTexture : public CTextureBase {
00036                 friend class                                                    COpenGlEsDepthStencilRenderTarget;
00037                 friend class                                                    COpenGlEsRenderTarget;
00038         public :
00039                 // == Various constructors.
00040                 LSE_CALLCTOR                                                    COpenGlEsStandardTexture();
00041                 LSE_CALLCTOR                                                    ~COpenGlEsStandardTexture();
00042 
00043 
00044                 // == Members.
00049                 static CCriticalSection                                 m_csCrit;
00050 
00051                 // == Functions.
00058                 virtual LSBOOL LSE_CALL                                 Activate( LSUINT32 _ui32Slot );
00059 
00063                 virtual LSVOID LSE_CALL                                 Reset();
00064 
00070                 LSBOOL LSE_CALL                                                 SetAsRenderTarget() const;
00071 
00075                 LSVOID LSE_CALL                                                 EndAsRenderTarget() const;
00076 
00083                 static GLint LSE_CALL                                   GetOpenGlEsInternalFormatStandard( LSI_PIXEL_FORMAT _pfFormat );
00084 
00091                 static GLenum LSE_CALL                                  GetOpenGlEsFormatStandard( LSI_PIXEL_FORMAT _pfFormat );
00092 
00099                 static GLenum LSE_CALL                                  GetOpenGlEsTypeStandard( LSI_PIXEL_FORMAT _pfFormat );
00100 
00108                 static LSVOID LSE_CALL                                  InitOpenGlTextureContext( LSUINT32 _ui32ContextId );
00109 
00115                 static LSVOID LSE_CALL                                  CloseOpenGlTextureContext( LSUINT32 _ui32ContextId );
00116 
00122                 static LSVOID LSE_CALL                                  SetActiveOpenGlTextureContext( LSUINT32 _ui32ContextId );
00123                 
00127                 static LSVOID LSE_CALL                                  ClearLastSetTex();
00128 
00132                 static LSVOID LSE_CALL                                  ClearLastSetTexAndUnbindAll();
00133 
00134         protected :
00135                 // == Types.
00139                 CImage                                                                  m_iTexels;
00140 
00144                 GLuint                                                                  m_uiTexture;
00145 
00149                 GLuint                                                                  m_uiDepthId;
00150 
00154                 LSBOOL                                                                  m_bFlip;
00155 
00159                 static CMap<LSUINT32, GLuint>                   m_mFbos;
00160 
00164                 static LSUINT32                                                 m_ui32ActiveContext;
00165 
00166 
00167                 // == Functions.
00173                 LSBOOL LSE_CALL                                                 CreateApiTexture();
00174 
00178                 LSVOID LSE_CALL                                                 ResetApi();
00179 
00180         private :
00181                 // == Functions.
00190                 LSBOOL LSE_CALL                                                 GenerateMipMapsApi( const CImage &_iSrcImage, LSUINT32 _ui32Width, LSUINT32 _ui32Height );
00191 
00192                 typedef CTextureBase                                    Parent;
00193         };
00194 
00195 
00196         // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00197         // DEFINITIONS
00198         // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00199         
00200 
00201 }       // namespace lsg
00202 
00203 #endif  // #ifdef LSG_OGLES
00204 
00205 #endif  // __LSG_OPENGLESSTANDARDTEXTURE_H__
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator