RobWorkProject  23.9.11-
Public Types | Public Member Functions | List of all members
RWGLTexture Class Reference

texture class that wraps the construction of opengl textures. More...

#include <RWGLTexture.hpp>

Public Types

typedef rw::core::Ptr< RWGLTexturePtr
 Smart pointer type for RWGLTexture.
 

Public Member Functions

 RWGLTexture ()
 Constructor - use init afterwards to initialize the GL texture.
 
 RWGLTexture (const rw::sensor::Image &img)
 constructor that creates a texture based on an image More...
 
 RWGLTexture (unsigned char r, unsigned char g, unsigned char b)
 constructor that creates a simple texture with an RGB color More...
 
virtual ~RWGLTexture ()
 destructor
 
void init (const rw::sensor::Image &img)
 set a new image on this texture More...
 
void init (unsigned char r, unsigned char g, unsigned char b)
 Set a new color for this texture. More...
 
const std::string & getName () const
 name identifier of this texture More...
 
int getWidth () const
 the width in data pixels of this texture More...
 
int getHeight () const
 the height in data pixels of this texture More...
 
GLuint getTextureID () const
 the texture id More...
 

Detailed Description

texture class that wraps the construction of opengl textures.

Constructor & Destructor Documentation

◆ RWGLTexture() [1/2]

RWGLTexture ( const rw::sensor::Image img)

constructor that creates a texture based on an image

Parameters
img[in] the image that is added to the texture
Exceptions
Exceptionif no OpenGL context is available.

◆ RWGLTexture() [2/2]

RWGLTexture ( unsigned char  r,
unsigned char  g,
unsigned char  b 
)

constructor that creates a simple texture with an RGB color

Parameters
r[in] red color value.
g[in] green color value.
b[in] blue color value.
Exceptions
Exceptionif no OpenGL context is available.

Member Function Documentation

◆ getHeight()

int getHeight ( ) const
inline

the height in data pixels of this texture

Returns

◆ getName()

const std::string& getName ( ) const
inline

name identifier of this texture

Returns

◆ getTextureID()

GLuint getTextureID ( ) const
inline

the texture id

Returns
texture id

◆ getWidth()

int getWidth ( ) const
inline

the width in data pixels of this texture

Returns

◆ init() [1/2]

void init ( const rw::sensor::Image img)

set a new image on this texture

Parameters
img[in] the image.
Exceptions
Exceptionif no OpenGL context is available.

◆ init() [2/2]

void init ( unsigned char  r,
unsigned char  g,
unsigned char  b 
)

Set a new color for this texture.

Parameters
r[in] red color value.
g[in] green color value.
b[in] blue color value.
Exceptions
Exceptionif no OpenGL context is available.

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