omegalib  13.1
omega::Texture Class Reference

#include <Texture.h>

Public Types

enum  TextureType { Type2D, TypeRectangle }
 Texture types. More...
 
enum  ChannelType { ChannelRGBA, ChannelRGB, ChannelDepth }
 Channel types. More...
 
enum  ChannelFormat { FormatUInt, FormatUByte, FormatFloat }
 Channel format. More...
 

Public Member Functions

void initialize (int width, int height, TextureType tt=Type2D, ChannelType ct=ChannelRGBA, ChannelFormat cf=FormatUByte)
 Initializes this texture object using a specific texture type, channel type and channel format. More...
 
void resize (int width, int height)
 Resets the size of this texture without changing its format. More...
 
bool isInitialized ()
 
void writePixels (PixelData *data)
 Write pixels from a PixelData object. More...
 
void readPixels (PixelData *data)
 Write pixels to a PixelData object. More...
 
void writeRawPixels (const byte *data, int width, int height, uint format)
 Write pixels from a memory buffer. More...
 
int getWidth ()
 
int getHeight ()
 
TextureType getTextureType ()
 
ChannelType getChannelType ()
 
ChannelFormat getChannelFormat ()
 
virtual void dispose ()
 
GLuint getGLTexture ()
 Texture operations. More...
 
void bind (GpuContext::TextureUnit unit)
 
void unbind ()
 
void refresh ()
 
bool isBound ()
 
GpuContext::TextureUnit getTextureUnit ()
 
- Public Member Functions inherited from omega::GpuResource
 GpuResource (GpuContext *ctx)
 
GpuContextgetContext ()
 
- Public Member Functions inherited from omicron::ReferenceType
 ReferenceType ()
 
virtual ~ReferenceType ()
 
void ref ()
 
void unref ()
 
long refCount ()
 

Static Public Member Functions

static void enablePboTransfers (bool value)
 
- Static Public Member Functions inherited from omicron::ReferenceType
static void printObjCounts ()
 

Protected Member Functions

 Texture (GpuContext *context)
 

Friends

class GpuContext
 

Additional Inherited Members

- Static Protected Attributes inherited from omicron::ReferenceType
static List< ReferenceType * > mysObjList
 
+ Inheritance diagram for omega::Texture:

Member Enumeration Documentation

Channel format.

Enumerator
FormatUInt 
FormatUByte 
FormatFloat 

Channel types.

Enumerator
ChannelRGBA 
ChannelRGB 
ChannelDepth 

Texture types.

Enumerator
Type2D 
TypeRectangle 

Constructor & Destructor Documentation

omega::Texture::Texture ( GpuContext context)
protected

Member Function Documentation

void omega::Texture::bind ( GpuContext::TextureUnit  unit)
virtual void omega::Texture::dispose ( )
virtual

Implements omega::GpuResource.

static void omega::Texture::enablePboTransfers ( bool  value)
inlinestatic
Texture::ChannelFormat omega::Texture::getChannelFormat ( )
inline
Texture::ChannelType omega::Texture::getChannelType ( )
inline
GLuint omega::Texture::getGLTexture ( )
inline

Texture operations.

int omega::Texture::getHeight ( )
inline
Texture::TextureType omega::Texture::getTextureType ( )
inline
GpuContext::TextureUnit omega::Texture::getTextureUnit ( )
inline
int omega::Texture::getWidth ( )
inline
void omega::Texture::initialize ( int  width,
int  height,
TextureType  tt = Type2D,
ChannelType  ct = ChannelRGBA,
ChannelFormat  cf = FormatUByte 
)

Initializes this texture object using a specific texture type, channel type and channel format.

bool omega::Texture::isBound ( )
inline
bool omega::Texture::isInitialized ( )
inline
void omega::Texture::readPixels ( PixelData data)

Write pixels to a PixelData object.

void omega::Texture::refresh ( )
void omega::Texture::resize ( int  width,
int  height 
)

Resets the size of this texture without changing its format.

void omega::Texture::unbind ( )
void omega::Texture::writePixels ( PixelData data)

Write pixels from a PixelData object.

void omega::Texture::writeRawPixels ( const byte data,
int  width,
int  height,
uint  format 
)

Write pixels from a memory buffer.

Parameters
format- a pixel format such as GL_RGB, GL_RGBA, etc.

Friends And Related Function Documentation

friend class GpuContext
friend

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