OpenPolygon  1.0.0
OpenPolygon is a Rendering Engine
Public Member Functions | Static Public Member Functions | List of all members
Engine::TextureManager Class Reference

The TextureManager class. More...

#include <texturemanager.h>

Public Member Functions

void finish (void)
 TextureManager::finish. More...
 
void getPixelData (Texture *texture)
 TextureManager::getTexImage. More...
 
void getPixelDepthData (Texture *texture)
 
TexturecreateTBOandBindVBO (uint vbo_id)
 createTBOandBindVBO More...
 
TexturecreateTextureArray (const std::string &texture_name, int width, int height, int size)
 createTextureArray More...
 
TexturecreateStorage (Texture *texture_array, GLint format)
 TextureManager::createStorage. More...
 
void addTextureToArray (Texture *array, Texture *texture, int layer)
 
TexturecreateTexture (const std::string &resource_path)
 createTexture More...
 
TexturecreateTexture (Texture *texture, FIBITMAP *bitmap)
 createTexture More...
 
TexturecreateTexture (int width, int height, uchar *pixeldata)
 createTexture More...
 
TexturecreateFloatTexture (int width, int height, float *data)
 createFloatTexture More...
 
TextureaddMatrixToTexture (Texture *float_texture, GLintptr offset, glm::mat4 matrix)
 addMatrixToTexture More...
 
TextureaddVec4ToTexture (Texture *float_texture, GLintptr offset, glm::vec4 vector)
 
TextureaddCharTextureToArray (Texture *array_texture, Texture *add_texture, int layer)
 addCharTextureToArray More...
 
TexturecreateCharTexture (int width, int height, int depth, uchar *pixeldata)
 createCharTexture More...
 
TexturecreateCubemapping (Textures six_textures, const std::string &texture_name)
 createCubemapping More...
 
TexturecreateFrameBufferTexture (int width, int height, GLint format, GLenum output_format)
 TextureManager::createFrameBufferTexture. More...
 
TexturecreateRenderBuffer (int render_width, int render_height, GLenum format)
 TextureManager::createRenderBuffer. More...
 
TexturecreateEmptyTexture (void)
 createEmptyTexture More...
 
bool loadTexture (Texture *texture, bool mipmapping)
 loadTexture More...
 
bool loadFloatTexture (Texture *texture)
 
bool loadFloatTexture1D (Texture *texture)
 
void destroy (Texture *texture)
 destroy More...
 
TexturegetTexture (const std::string &texture_name)
 getTexture More...
 

Static Public Member Functions

static TextureManagergetSingletonPtr (void)
 getSingletonPtr More...
 

Detailed Description

The TextureManager class.

Managemant of Textures

Member Function Documentation

Texture * TextureManager::addCharTextureToArray ( Texture array_texture,
Texture add_texture,
int  layer 
)

addCharTextureToArray

Fill a Char Texture Array

Parameters
array_texture
add_texture
layer
Returns
Texture Array
Texture * TextureManager::addMatrixToTexture ( Texture float_texture,
GLintptr  offset,
glm::mat4  matrix 
)

addMatrixToTexture

Write Matrix Data into the Float Texture

Parameters
float_texture
offset
matrix
Returns
Texture * TextureManager::createCharTexture ( int  width,
int  height,
int  depth,
uchar *  pixeldata 
)

createCharTexture

TextureManager::createCharTexture.

Create Char Texture for Font

Parameters
width
height
depth
pixeldata
Returns

Create a Character Texture by Fonts

Parameters
width: Texture Width
height: Texture Height
depth: default(1)
pixeldata: Character Pixel Data
Returns
Texture * TextureManager::createCubemapping ( Textures  six_textures,
const std::string &  texture_name 
)

createCubemapping

Create Cubemapping Texture - with six Textures

Parameters
six_textures
Returns
Texture * TextureManager::createEmptyTexture ( void  )

createEmptyTexture

Create a Empty Texture with id

Returns
Texture * TextureManager::createFloatTexture ( int  width,
int  height,
float *  data 
)

createFloatTexture

Create float Texture ( RGBA32F ) load with : loadFloatTexture( texture ) Methode

Parameters
width
height
data
Returns
Texture * TextureManager::createFrameBufferTexture ( int  texture_width,
int  texture_height,
GLint  format,
GLenum  output_format 
)

TextureManager::createFrameBufferTexture.

Create FrameBuffer Texture

FrameBuffer Resolution Width FrameBuffer Resolution Height

Format:

-> diffuse format: GL_RGBA -> position format: GL_RGBA32F -> normals format: GL_RGBA16F -> depth format: GL_DEPTH_COMPONENT24

Output Format:

-> diffuse GL_BGRA -> position GL_BGRA -> normals GL_BGRA -> depth GL_DEPTH_COMPONENT

Parameters
texture_width: Image Width
texture_height: Image Height
format: GL_RGBA , GL_RGBA32F , GL_RGBA16F , GL_DEPTH_COMPONENT24
output_format: GL_BGRA , GL_DEPTH_COMPONENT
Returns

Create FrameBuffer Texture

FrameBuffer Width FrameBuffer Height

-> diffuse format: GL_RGBA -> position format: GL_RGBA32F -> normals format: GL_RGBA16F

Parameters
texture_width
texture_height
format
output_format: Default => GL_BGRA , Depth => GL_DEPTH_COMPONENT
Returns
Texture * TextureManager::createRenderBuffer ( int  render_width,
int  render_height,
GLenum  format 
)

TextureManager::createRenderBuffer.

Create RenderBuffer for FrameBuffer (FBO)

-> diffuse format: GL_RGBA -> position format: GL_RGBA32F -> normals format: GL_RGBA16F -> depth format: GL_DEPTH_COMPONENT24

Parameters
render_width
render_height
Returns
Texture * TextureManager::createStorage ( Texture array_texture,
GLint  format 
)

TextureManager::createStorage.

Create Texture Array Storage

-> Texture Target: GL_TEXTURE_2D_ARRAY -> Output Format : GL_BGRA -> Output Type : GL_UNSIGNED_BYTE

Parameters
array_texture: Texture Array
format: GL_RGBA32f
Returns
Texture * TextureManager::createTBOandBindVBO ( uint  vbo_id)

createTBOandBindVBO

TextureManager::createTBOandBindVBO.

Create Vertex Buffer Object and Bind with a VBO ( aka. Vertex Buffer )

Parameters
vbo_id
Returns

Create Texture Buffer Object and Bind it with a VBO ( aka. Vertex Buffer )

Parameters
vbo_id
Returns
Texture * TextureManager::createTexture ( const std::string &  resource_path)

createTexture

Create Texture from a resource

Parameters
resource_path
Returns
Texture * TextureManager::createTexture ( Texture texture,
FIBITMAP *  bitmap 
)

createTexture

Create a Texture from FreeImage Bitmap

Parameters
texture: empty texture ( with generated id )
bitmap: FreeImage Bitmap
Returns
Texture * TextureManager::createTexture ( int  width,
int  height,
uchar *  pixeldata 
)

createTexture

Create a Custom Texture with Pixel Data

Parameters
width
height
pixeldata
Returns
Texture * TextureManager::createTextureArray ( const std::string &  texture_name,
int  width,
int  height,
int  size 
)

createTextureArray

Create Texture Array

Parameters
texture_name: Texture Array Name
width: Image Width
height: Image Height
size: Layer amounts
Returns
void TextureManager::destroy ( Texture texture)

destroy

TextureManager::destroy.

Destroy Texture

Parameters
textureDestroy only a Texture
texture
void TextureManager::finish ( void  )

TextureManager::finish.

Destroy all. TextureManager & Textures

void TextureManager::getPixelData ( Texture texture)

TextureManager::getTexImage.

Read Pixel Data from Memory and write into Texture Container.

:: Return Pixel Data :: uchar * pixels = texture->getPixelData();

Parameters
texture
TextureManager * TextureManager::getSingletonPtr ( void  )
static

getSingletonPtr

Return Texture Manager Instance

Returns
Texture * TextureManager::getTexture ( const std::string &  texture_name)

getTexture

Return Texture Object by Name

Parameters
texture_name
Returns
bool TextureManager::loadTexture ( Texture texture,
bool  mipmapping 
)

loadTexture

Load Texture into GPU Memory with or without mipmapping

  • default Mipmapping ( 3 )
Parameters
texture
mipmapping
Returns

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