Kochol Game Engine  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kge::gfx::Texture Class Reference

#include <Texture.h>

Inheritance diagram for kge::gfx::Texture:
kge::Resource kge::KgeUnknown

Public Member Functions

 Texture (const u32 Handle, const char *FileName, const char *Name, void *ExtraParam)
 Constructor.
 Texture (ImageData *pImg)
 ImageData constructor.
virtual ~Texture ()
 Destructor.
virtual bool CreateTexture (int Width, int Height, TextureFormat fmt=ETF_A8R8G8B8, int numMipMaps=0, bool StoreCopy=true)
 Create an empty texture.
virtual bool SetData (u8 *Data, int DataSize, int mipmapLevel=0)
 Sets the texture data.
virtual bool SetData (int X, int Y, int Width, int Height, u8 *Data, u32 DataSize, int mipmaplevel=0)
 Sets a region of texture data.
bool IsAntiAliased ()
 Check if the target is an Anti Aliased surface.
virtual u8GetCopyData (int MipMapLevel)
int GetNumberOfMipmapLevels ()
virtual void * GetD3DTexture ()
virtual void * Lock ()
virtual void UnLock ()
virtual TextureFormat GetFormat ()
int GetWidth ()
int GetHeight ()
- Public Member Functions inherited from kge::Resource
 Resource (const u32 Handle, const char *FileName, const char *Name, void *ExtraParam)
 Constructor.
virtual ~Resource ()
 Destructor.
virtual const char * GetFileName ()
 Return resource file name.
virtual const char * GetName ()
 Return resource name.
virtual u32 GetHandle ()
 Return resource handle.
- Public Member Functions inherited from kge::KgeUnknown
 KgeUnknown ()
 Constructor.
virtual ~KgeUnknown ()
 Destructor.
virtual void AddRef ()
 Add a reference to the object.
virtual void DecRef ()
 Decrease a reference from the object. if its reference count get 0 then the object will destroy.
u32 GetRefCount ()
 Return resource reference count.
const char * GetDebugText ()
 returns the instance debug text.

Static Public Member Functions

static int GetPowerOf2Size (int size, int &mipmaplevel)
 Returns a power of 2 size for texture.

Protected Attributes

TextureFormat m_Tfmt
int m_iBpp
 Byte per pixel.
int m_iMipmapsCount
 Number of mipmaps.
int m_iWidth
 Texture width.
int m_iHeight
 Texture height.
int m_ibpp
bool m_bAA
 Has Anti Aliasing.
bool m_bCompressed
 Is it compressed.
bool m_bStoreCopy
 Stores a copy of texture data.
- Protected Attributes inherited from kge::Resource
char * m_pFileName
char * m_pName
void * m_pExtraParam
u32 m_iHandle
void * m_pMyMgr
 Resource manager pointer.

Additional Inherited Members

- Protected Member Functions inherited from kge::KgeUnknown
void SetDebugText (char *text)

Detailed Description

Texture class

Definition at line 31 of file Texture.h.

Constructor & Destructor Documentation

kge::gfx::Texture::Texture ( const u32  Handle,
const char *  FileName,
const char *  Name,
void *  ExtraParam 
)
inline

Constructor.

Definition at line 36 of file Texture.h.

kge::gfx::Texture::Texture ( ImageData pImg)

ImageData constructor.

virtual kge::gfx::Texture::~Texture ( )
inlinevirtual

Destructor.

Definition at line 45 of file Texture.h.

Member Function Documentation

virtual bool kge::gfx::Texture::CreateTexture ( int  Width,
int  Height,
TextureFormat  fmt = ETF_A8R8G8B8,
int  numMipMaps = 0,
bool  StoreCopy = true 
)
inlinevirtual

Create an empty texture.

Definition at line 48 of file Texture.h.

virtual u8* kge::gfx::Texture::GetCopyData ( int  MipMapLevel)
inlinevirtual

Definition at line 90 of file Texture.h.

References NULL.

virtual void* kge::gfx::Texture::GetD3DTexture ( )
inlinevirtual

Definition at line 94 of file Texture.h.

References NULL.

virtual TextureFormat kge::gfx::Texture::GetFormat ( )
inlinevirtual

Definition at line 100 of file Texture.h.

int kge::gfx::Texture::GetHeight ( )
inline

Definition at line 104 of file Texture.h.

int kge::gfx::Texture::GetNumberOfMipmapLevels ( )
inline

Definition at line 92 of file Texture.h.

static int kge::gfx::Texture::GetPowerOf2Size ( int  size,
int &  mipmaplevel 
)
inlinestatic

Returns a power of 2 size for texture.

Definition at line 69 of file Texture.h.

References kge::io::ELM_Warning, and kge::io::Logger::Log().

int kge::gfx::Texture::GetWidth ( )
inline

Definition at line 102 of file Texture.h.

bool kge::gfx::Texture::IsAntiAliased ( )
inline

Check if the target is an Anti Aliased surface.

Definition at line 88 of file Texture.h.

virtual void* kge::gfx::Texture::Lock ( )
inlinevirtual

Definition at line 96 of file Texture.h.

References NULL.

virtual bool kge::gfx::Texture::SetData ( u8 Data,
int  DataSize,
int  mipmapLevel = 0 
)
inlinevirtual

Sets the texture data.

Definition at line 57 of file Texture.h.

virtual bool kge::gfx::Texture::SetData ( int  X,
int  Y,
int  Width,
int  Height,
u8 Data,
u32  DataSize,
int  mipmaplevel = 0 
)
inlinevirtual

Sets a region of texture data.

Definition at line 63 of file Texture.h.

virtual void kge::gfx::Texture::UnLock ( )
inlinevirtual

Definition at line 98 of file Texture.h.

Member Data Documentation

bool kge::gfx::Texture::m_bAA
protected

Has Anti Aliasing.

Definition at line 118 of file Texture.h.

bool kge::gfx::Texture::m_bCompressed
protected

Is it compressed.

Definition at line 118 of file Texture.h.

bool kge::gfx::Texture::m_bStoreCopy
protected

Stores a copy of texture data.

Definition at line 118 of file Texture.h.

int kge::gfx::Texture::m_iBpp
protected

Byte per pixel.

Definition at line 111 of file Texture.h.

int kge::gfx::Texture::m_ibpp
protected

Definition at line 111 of file Texture.h.

int kge::gfx::Texture::m_iHeight
protected

Texture height.

Definition at line 111 of file Texture.h.

int kge::gfx::Texture::m_iMipmapsCount
protected

Number of mipmaps.

Definition at line 111 of file Texture.h.

int kge::gfx::Texture::m_iWidth
protected

Texture width.

Definition at line 111 of file Texture.h.

TextureFormat kge::gfx::Texture::m_Tfmt
protected

Definition at line 108 of file Texture.h.


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