Developer Documentation
ACG::Texture2D Class Reference
Inheritance diagram for ACG::Texture2D:
ACG::Texture

Public Member Functions

 Texture2D (GLenum unit=GL_NONE)
 
bool autogenerateMipMaps ()
 
void disableAutogenerateMipMaps ()
 
void setData (GLint _level, GLint _internalFormat, GLsizei _width, GLsizei _height, GLenum _format, GLenum _type, const GLvoid *_data, bool _mipmaps=false)
 
void setStorage (GLsizei _levels, GLenum _internalFormat, GLsizei _width, GLsizei _height)
 
bool loadFromFile (const std::string &_filename, GLenum _minFilter=GL_NEAREST_MIPMAP_LINEAR, GLenum _magFilter=GL_LINEAR)
 
void loadRandom (GLint _internalFormat, GLsizei _width, GLsizei _height)
 
GLsizei getWidth () const
 
GLsizei getHeight () const
 
GLenum getFormat () const
 
GLenum getType () const
 
bool getData (GLint _level, void *_dst)
 
bool getData (GLint _level, std::vector< char > &_dst)
 
- Public Member Functions inherited from ACG::Texture
 Texture (GLenum tgt, GLenum _unit=GL_NONE)
 
void bind (GLenum _unit)
 
void activate (GLenum _unit)
 
void bind ()
 
void activate ()
 
void parameter (GLenum pname, GLint i)
 
void parameter (GLenum pname, GLfloat f)
 
void parameter (GLenum pname, GLint *ip)
 
void parameter (GLenum pname, GLfloat *fp)
 
void enable ()
 
void disable ()
 
void del ()
 
void gen ()
 
bool is_valid () const
 
GLuint id () const
 
void setUnit (GLenum u)
 
GLenum getUnit () const
 
GLenum getTarget () const
 
GLint getInternalFormat ()
 
bool clear (const ACG::Vec4f &_color)
 
bool clear (const ACG::Vec4i &_color)
 
bool clear (const ACG::Vec4ui &_color)
 
void bindAsImage (GLuint _index, GLenum _access)
 

Static Public Member Functions

static bool checkTextureMem (GLenum _internalFormat, GLsizei _width, GLsizei _height, GLenum _format)
 
- Static Public Member Functions inherited from ACG::Texture
static bool supportsImageLoadStore ()
 
static bool supportsTextureBuffer ()
 
static bool supportsClearTexture ()
 
static bool supportsGenerateMipmap ()
 

Private Member Functions

void buildMipMaps (GLenum _internalfmt, GLint _width, GLint _height, GLenum _format, GLenum _type, const void *_data)
 

Private Attributes

GLsizei width_
 
GLsizei height_
 
GLenum format_
 
GLenum type_
 
bool buildMipsCPU_
 

Additional Inherited Members

- Protected Attributes inherited from ACG::Texture
GLint internalFormat_
 

Detailed Description

Definition at line 391 of file globjects.hh.

Constructor & Destructor Documentation

◆ Texture2D()

ACG::Texture2D::Texture2D ( GLenum  unit = GL_NONE)

Definition at line 308 of file globjects.cc.

Member Function Documentation

◆ autogenerateMipMaps()

bool ACG::Texture2D::autogenerateMipMaps ( )

Definition at line 317 of file globjects.cc.

◆ buildMipMaps()

void ACG::Texture2D::buildMipMaps ( GLenum  _internalfmt,
GLint  _width,
GLint  _height,
GLenum  _format,
GLenum  _type,
const void *  _data 
)
private

Definition at line 440 of file globjects.cc.

◆ checkTextureMem()

bool ACG::Texture2D::checkTextureMem ( GLenum  _internalFormat,
GLsizei  _width,
GLsizei  _height,
GLenum  _format 
)
static

Definition at line 714 of file globjects.cc.

◆ disableAutogenerateMipMaps()

void ACG::Texture2D::disableAutogenerateMipMaps ( )

Definition at line 340 of file globjects.cc.

◆ getData() [1/2]

bool ACG::Texture2D::getData ( GLint  _level,
std::vector< char > &  _dst 
)

Definition at line 413 of file globjects.cc.

◆ getData() [2/2]

bool ACG::Texture2D::getData ( GLint  _level,
void *  _dst 
)

Definition at line 398 of file globjects.cc.

◆ getFormat()

GLenum ACG::Texture2D::getFormat ( ) const
inline

Definition at line 423 of file globjects.hh.

◆ getHeight()

GLsizei ACG::Texture2D::getHeight ( ) const
inline

Definition at line 422 of file globjects.hh.

◆ getType()

GLenum ACG::Texture2D::getType ( ) const
inline

Definition at line 424 of file globjects.hh.

◆ getWidth()

GLsizei ACG::Texture2D::getWidth ( ) const
inline

Definition at line 421 of file globjects.hh.

◆ loadFromFile()

bool ACG::Texture2D::loadFromFile ( const std::string &  _filename,
GLenum  _minFilter = GL_NEAREST_MIPMAP_LINEAR,
GLenum  _magFilter = GL_LINEAR 
)

Definition at line 623 of file globjects.cc.

◆ loadRandom()

void ACG::Texture2D::loadRandom ( GLint  _internalFormat,
GLsizei  _width,
GLsizei  _height 
)

Definition at line 664 of file globjects.cc.

◆ setData()

void ACG::Texture2D::setData ( GLint  _level,
GLint  _internalFormat,
GLsizei  _width,
GLsizei  _height,
GLenum  _format,
GLenum  _type,
const GLvoid *  _data,
bool  _mipmaps = false 
)

Definition at line 351 of file globjects.cc.

◆ setStorage()

void ACG::Texture2D::setStorage ( GLsizei  _levels,
GLenum  _internalFormat,
GLsizei  _width,
GLsizei  _height 
)

Definition at line 382 of file globjects.cc.

Member Data Documentation

◆ buildMipsCPU_

bool ACG::Texture2D::buildMipsCPU_
private

Definition at line 449 of file globjects.hh.

◆ format_

GLenum ACG::Texture2D::format_
private

Definition at line 447 of file globjects.hh.

◆ height_

GLsizei ACG::Texture2D::height_
private

Definition at line 446 of file globjects.hh.

◆ type_

GLenum ACG::Texture2D::type_
private

Definition at line 447 of file globjects.hh.

◆ width_

GLsizei ACG::Texture2D::width_
private

Definition at line 446 of file globjects.hh.


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