Eulerian Smoke Simulation on the GPU
Texture2D Class Reference

A class for creating 2D textures. More...

#include <Texture2D.h>

Inheritance diagram for Texture2D:
Texture

List of all members.

Public Member Functions

 Texture2D (GLenum _target, int _width, int _height, GLint _internalFormat, GLenum _format, GLenum _dataType, GLenum _minFilter, GLenum _magFilter, GLenum _wrapMode, int _samplerIndex, GLint _mipLevel=0, void *_data=0)
 Constructor.
bool write (GLint _mipLevel, GLint _xOffset, GLint _yOffset, GLsizei _width, GLsizei _height, GLenum _format, GLenum _type, void *_data)
 Loads data to the texture.
bool writeFromPBO (GLint _mipLevel, GLint _xOffset, GLint _yOffset, GLsizei _width, GLsizei _height, GLenum _format, GLenum _type, GLuint _pboHandle)
 Loads data to the texture.
bool loadImage (const std::string &_fileName, GLint _mipLevel)
 Loads an image to the texture.
GLsizei getWidth () const
 Accessor for the texture's width.
GLsizei getHeight () const
 Accessor for the texture's height.

Detailed Description

A class for creating 2D textures.

Author:
Nikolaos Verigakis
Version:
1.0
Date:
14/07/11 Revision History : Initial Version 14/07/11

Constructor & Destructor Documentation

Texture2D::Texture2D ( GLenum  _target,
int  _width,
int  _height,
GLint  _internalFormat,
GLenum  _format,
GLenum  _dataType,
GLenum  _minFilter,
GLenum  _magFilter,
GLenum  _wrapMode,
int  _samplerIndex,
GLint  _mipLevel = 0,
void *  _data = 0 
)

Constructor.

Parameters:
[in]_targetthe target texture (must be GL_TEXTURE_2D, GL_PROXY_TEXTURE_2D)
[in]_widththe texture's width
[in]_heightthe texture's height
[in]_internalFormatthe number of colour components in the texture
[in]_formatthe format of the pixel data
[in]_dataTypethe data type of the pixel data
[in]_minFilterthe minification filter
[in]_magFilterthe magnification filter
[in]_wrapModethe texture wrapping mode
[in]_samplerIndexthe texture image unit to assign the texture sampler
[in]_mipLevelthe texture's mipmap level
[in]_dataa pointer to the texture data in memory

Member Function Documentation

bool Texture2D::loadImage ( const std::string &  _fileName,
GLint  _mipLevel 
)

Loads an image to the texture.

Parameters:
[in]_fileNamethe image's file name
[in]_mipLevelthe mimap level to assign the image
bool Texture2D::write ( GLint  _mipLevel,
GLint  _xOffset,
GLint  _yOffset,
GLsizei  _width,
GLsizei  _height,
GLenum  _format,
GLenum  _type,
void *  _data 
)

Loads data to the texture.

Parameters:
[in]_mipLevelthe mipmap level of the texture sub-image
[in]_xOffseta texel offset in the x direction within the texture array
[in]_yOffseta texel offset in the y direction within the texture array
[in]_widththe width of the texture sub-image
[in]_heightthe height of the texture sub-image
[in]_formatthe format of the texture sub-image
[in]_typethe type of the texture sub-image
[in]_datathe data to load
bool Texture2D::writeFromPBO ( GLint  _mipLevel,
GLint  _xOffset,
GLint  _yOffset,
GLsizei  _width,
GLsizei  _height,
GLenum  _format,
GLenum  _type,
GLuint  _pboHandle 
)

Loads data to the texture.

Parameters:
[in]_mipLevelthe mipmap level of the texture sub-image
[in]_xOffseta texel offset in the x direction within the texture array
[in]_yOffseta texel offset in the y direction within the texture array
[in]_widththe width of the texture sub-image
[in]_heightthe height of the texture sub-image
[in]_formatthe format of the texture sub-image
[in]_typethe type of the texture sub-image
[in]_pboHandlethe PBO's handle

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables