Otclient  14/8/2020
Texture Class Reference

#include <texture.h>

Inheritance diagram for Texture:
Collaboration diagram for Texture:

Public Member Functions

 Texture ()
 
 Texture (const Size &size)
 
 Texture (const ImagePtr &image, bool buildMipmaps=false, bool compress=false)
 
virtual ~Texture ()
 
void uploadPixels (const ImagePtr &image, bool buildMipmaps=false, bool compress=false)
 
void bind ()
 
void copyFromScreen (const Rect &screenRect)
 
virtual bool buildHardwareMipmaps ()
 
virtual void setSmooth (bool smooth)
 
virtual void setRepeat (bool repeat)
 
void setUpsideDown (bool upsideDown)
 
void setTime (ticks_t time)
 
uint getId ()
 
ticks_t getTime ()
 
int getWidth ()
 
int getHeight ()
 
const SizegetSize ()
 
const SizegetGlSize ()
 
const Matrix3getTransformMatrix ()
 
bool isEmpty ()
 
bool hasRepeat ()
 
bool hasMipmaps ()
 
virtual bool isAnimatedTexture ()
 
- Public Member Functions inherited from stdext::shared_object
 shared_object ()
 
virtual ~shared_object ()
 
void add_ref ()
 
void dec_ref ()
 
refcount_t ref_count ()
 
template<typename T >
stdext::shared_object_ptr< T > static_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > dynamic_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > const_self_cast ()
 

Protected Member Functions

void createTexture ()
 
bool setupSize (const Size &size, bool forcePowerOfTwo=false)
 
void setupWrap ()
 
void setupFilters ()
 
void setupTranformMatrix ()
 
void setupPixels (int level, const Size &size, uchar *pixels, int channels=4, bool compress=false)
 

Protected Attributes

uint m_id
 
ticks_t m_time
 
Size m_size
 
Size m_glSize
 
Matrix3 m_transformMatrix
 
stdext::boolean< false > m_hasMipmaps
 
stdext::boolean< false > m_smooth
 
stdext::boolean< false > m_upsideDown
 
stdext::boolean< false > m_repeat
 

Detailed Description

Definition at line 28 of file texture.h.

Constructor & Destructor Documentation

◆ Texture() [1/3]

Texture::Texture ( )

Definition at line 30 of file texture.cpp.

Here is the caller graph for this function:

◆ Texture() [2/3]

Texture::Texture ( const Size size)

Definition at line 36 of file texture.cpp.

Here is the call graph for this function:

◆ Texture() [3/3]

Texture::Texture ( const ImagePtr image,
bool  buildMipmaps = false,
bool  compress = false 
)

Definition at line 51 of file texture.cpp.

Here is the call graph for this function:

◆ ~Texture()

Texture::~Texture ( )
virtual

Definition at line 61 of file texture.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ bind()

void Texture::bind ( )

Definition at line 98 of file texture.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildHardwareMipmaps()

bool Texture::buildHardwareMipmaps ( )
virtual

Reimplemented in AnimatedTexture.

Definition at line 111 of file texture.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copyFromScreen()

void Texture::copyFromScreen ( const Rect screenRect)

Definition at line 105 of file texture.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createTexture()

void Texture::createTexture ( )
protected

Definition at line 158 of file texture.cpp.

Here is the caller graph for this function:

◆ getGlSize()

const Size& Texture::getGlSize ( )
inline

Definition at line 51 of file texture.h.

◆ getHeight()

int Texture::getHeight ( )
inline

Definition at line 49 of file texture.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getId()

uint Texture::getId ( )
inline

Definition at line 46 of file texture.h.

Here is the caller graph for this function:

◆ getSize()

const Size& Texture::getSize ( )
inline

Definition at line 50 of file texture.h.

Here is the caller graph for this function:

◆ getTime()

ticks_t Texture::getTime ( )
inline

Definition at line 47 of file texture.h.

◆ getTransformMatrix()

const Matrix3& Texture::getTransformMatrix ( )
inline

Definition at line 52 of file texture.h.

Here is the caller graph for this function:

◆ getWidth()

int Texture::getWidth ( )
inline

Definition at line 48 of file texture.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasMipmaps()

bool Texture::hasMipmaps ( )
inline

Definition at line 55 of file texture.h.

◆ hasRepeat()

bool Texture::hasRepeat ( )
inline

Definition at line 54 of file texture.h.

◆ isAnimatedTexture()

virtual bool Texture::isAnimatedTexture ( )
inlinevirtual

Reimplemented in AnimatedTexture.

Definition at line 56 of file texture.h.

◆ isEmpty()

bool Texture::isEmpty ( )
inline

Definition at line 53 of file texture.h.

Here is the caller graph for this function:

◆ setRepeat()

void Texture::setRepeat ( bool  repeat)
virtual

Reimplemented in AnimatedTexture.

Definition at line 140 of file texture.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSmooth()

void Texture::setSmooth ( bool  smooth)
virtual

Reimplemented in AnimatedTexture.

Definition at line 127 of file texture.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTime()

void Texture::setTime ( ticks_t  time)
inline

Definition at line 44 of file texture.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupFilters()

void Texture::setupFilters ( )
protected

Definition at line 199 of file texture.cpp.

Here is the caller graph for this function:

◆ setupPixels()

void Texture::setupPixels ( int  level,
const Size size,
uchar pixels,
int  channels = 4,
bool  compress = false 
)
protected

Definition at line 227 of file texture.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setUpsideDown()

void Texture::setUpsideDown ( bool  upsideDown)

Definition at line 150 of file texture.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupSize()

bool Texture::setupSize ( const Size size,
bool  forcePowerOfTwo = false 
)
protected

Definition at line 164 of file texture.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupTranformMatrix()

void Texture::setupTranformMatrix ( )
protected

Definition at line 214 of file texture.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupWrap()

void Texture::setupWrap ( )
protected

Definition at line 187 of file texture.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uploadPixels()

void Texture::uploadPixels ( const ImagePtr image,
bool  buildMipmaps = false,
bool  compress = false 
)

Definition at line 71 of file texture.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_glSize

Size Texture::m_glSize
protected

Definition at line 69 of file texture.h.

◆ m_hasMipmaps

stdext::boolean<false> Texture::m_hasMipmaps
protected

Definition at line 71 of file texture.h.

◆ m_id

uint Texture::m_id
protected

Definition at line 66 of file texture.h.

◆ m_repeat

stdext::boolean<false> Texture::m_repeat
protected

Definition at line 74 of file texture.h.

◆ m_size

Size Texture::m_size
protected

Definition at line 68 of file texture.h.

◆ m_smooth

stdext::boolean<false> Texture::m_smooth
protected

Definition at line 72 of file texture.h.

◆ m_time

ticks_t Texture::m_time
protected

Definition at line 67 of file texture.h.

◆ m_transformMatrix

Matrix3 Texture::m_transformMatrix
protected

Definition at line 70 of file texture.h.

◆ m_upsideDown

stdext::boolean<false> Texture::m_upsideDown
protected

Definition at line 73 of file texture.h.


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