OpenBarnyard
 
Loading...
Searching...
No Matches
T2GLTexture Class Reference

#include <T2GLTexture_GL.h>

Public Member Functions

 T2GLTexture ()=default
 
 ~T2GLTexture ()
 
void Create (TEXTURE_FORMAT a_eFormat, UINT a_uiWidth, UINT a_uiHeight, const void *a_pData)
 
void Destroy ()
 
const TCHARGetName () const
 
GLuint GetHandle () const
 
UINT GetWidth () const
 
UINT GetHeight () const
 
void SetName (const TCHAR *a_pchName)
 
void SetWrap (TEXTURE_ADDRESS_MODE a_eAddressU, TEXTURE_ADDRESS_MODE a_eAddressV)
 

Friends

class T2TextureManager
 

Detailed Description

Definition at line 186 of file T2GLTexture_GL.h.

Constructor & Destructor Documentation

◆ T2GLTexture()

T2GLTexture::T2GLTexture ( )
default

◆ ~T2GLTexture()

T2GLTexture::~T2GLTexture ( )

Definition at line 7 of file T2GLTexture_GL.cpp.

8{
9 if ( m_pHandle != 0 )
10 Destroy();
11}

Member Function Documentation

◆ Create()

void T2GLTexture::Create ( TEXTURE_FORMAT a_eFormat,
UINT a_uiWidth,
UINT a_uiHeight,
const void * a_pData )

Definition at line 19 of file T2GLTexture_GL.cpp.

20{
21 if ( m_pHandle != 0 )
22 Destroy();
23
24 m_pchTexName = "runtime";
25
26 GLenum glFormat =
27 ( a_eFormat == TEXTURE_FORMAT_R8G8B8A8_UNORM ) ? GL_RGBA :
28 ( a_eFormat == TEXTURE_FORMAT_R8G8_UNORM ) ? GL_RG :
29 GL_R;
30
31 m_pHandle = T2Render::CreateTexture( a_uiWidth, a_uiHeight, glFormat, glFormat, GL_UNSIGNED_BYTE, TFALSE, a_pData );
32 m_uiWidth = a_uiWidth;
33 m_uiHeight = a_uiHeight;
34 m_uiMipMapCount = 1;
35 m_eFormat = a_eFormat;
36
38}
@ TEXTURE_FORMAT_R8G8B8A8_UNORM
@ TEXTURE_FORMAT_R8G8_UNORM
#define TFALSE
Definition Typedefs.h:24
void AddTexture(T2GLTexture *a_pTexture)
static TFORCEINLINE T2TextureManager * GetSingleton()
Definition TSingleton.h:49

◆ Destroy()

void T2GLTexture::Destroy ( )

Definition at line 13 of file T2GLTexture_GL.cpp.

14{
16 T2Render::DestroyTexture( m_pHandle );
17}
void RemoveTexture(T2GLTexture *a_pTexture)

◆ GetHandle()

GLuint T2GLTexture::GetHandle ( ) const
inline

Definition at line 199 of file T2GLTexture_GL.h.

199{ return m_pHandle; }

◆ GetHeight()

UINT T2GLTexture::GetHeight ( ) const
inline

Definition at line 201 of file T2GLTexture_GL.h.

201{ return m_uiHeight; }

◆ GetName()

const TCHAR * T2GLTexture::GetName ( ) const
inline

Definition at line 198 of file T2GLTexture_GL.h.

198{ return m_pchTexName; }

◆ GetWidth()

UINT T2GLTexture::GetWidth ( ) const
inline

Definition at line 200 of file T2GLTexture_GL.h.

200{ return m_uiWidth; }

◆ SetName()

void T2GLTexture::SetName ( const TCHAR * a_pchName)
inline

Definition at line 203 of file T2GLTexture_GL.h.

203{ m_pchTexName = a_pchName; }

◆ SetWrap()

void T2GLTexture::SetWrap ( TEXTURE_ADDRESS_MODE a_eAddressU,
TEXTURE_ADDRESS_MODE a_eAddressV )

Definition at line 40 of file T2GLTexture_GL.cpp.

41{
42 m_eAddressU = eAddressU;
43 m_eAddressV = eAddressV;
44}

Friends And Related Symbol Documentation

◆ T2TextureManager

friend class T2TextureManager
friend

Definition at line 189 of file T2GLTexture_GL.h.


The documentation for this class was generated from the following files: