Radium Engine  1.5.0
Ra::Engine::Data::TextureParameters Struct Reference

#include <Engine/Data/Texture.hpp>

+ Collaboration diagram for Ra::Engine::Data::TextureParameters:

Public Attributes

std::string name {}
 Name of the texture.
 
GLenum target { GL_TEXTURE_2D }
 OpenGL target.
 
size_t width { 1 }
 width of the texture (s dimension)
 
size_t height { 1 }
 height of the texture (t dimension)
 
size_t depth { 1 }
 width of the texture (p dimension)
 
GLenum format { GL_RGB }
 Format of the external data.
 
GLenum internalFormat { GL_RGB }
 OpenGL internal format (WARNING, for Integer textures, must be GL_XXX_INTEGER)
 
GLenum type { GL_UNSIGNED_BYTE }
 Type of the components in external data.
 
GLenum wrapS { GL_CLAMP_TO_EDGE }
 OpenGL wrap mode in the s direction.
 
GLenum wrapT { GL_CLAMP_TO_EDGE }
 OpenGL wrap mode in the t direction.
 
GLenum wrapP { GL_CLAMP_TO_EDGE }
 OpenGL wrap mode in the p direction.
 
GLenum minFilter { GL_LINEAR }
 OpenGL minification filter ( GL_LINEAR or GL_NEAREST or GL_XXX_MIPMAP_YYY )
 
GLenum magFilter { GL_LINEAR }
 OpenGL magnification filter ( GL_LINEAR or GL_NEAREST )
 
void * texels { nullptr }
 

Detailed Description

Describes the content and parameters of a texture. This structures encapsulates all the states used for creating an OpenGL texture. These parameters describe the image data of the texture :

  • target, width, height, depth, format, internalFormat, type and texels for describing image data
  • wrapS, wrapT, wrapP, minFilter and magFilter for describing the sampler of the texture.

When one wants to create a texture, the first thing to do is to create and fill a Texture parameter structure that will describe the Texture.

The Texture creation could be done either using the TextureManager or directly on the client class/function.

When a texture is created, no OpenGL initialisation is realized. The user must first call initializeGL before being able to use this texture in an OpenGL operation.

MipMap representation of the texture is automatically generated as soon as the minFilter parameter is something else than GL_LINEAR or GL_NEAREST

Note
No coherence checking will be done on the content of this structure. User must ensure coherent data and parameters before creating the OpenGL texture with Texture::initializeGL

Definition at line 42 of file Texture.hpp.

Member Data Documentation

◆ texels

void* Ra::Engine::Data::TextureParameters::texels { nullptr }

External data (ownership is left to caller, not stored after OpenGL texture creation). Note that, for cube-map texture, this is considered as a "void*[6]" array containing the 6 faces of the cube corresponding to the targets.
texels[0] <– GL_TEXTURE_CUBE_MAP_POSITIVE_X
texels[1] <– GL_TEXTURE_CUBE_MAP_NEGATIVE_X
texels[2] <– GL_TEXTURE_CUBE_MAP_POSITIVE_Y
texels[3] <– GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
texels[4] <– GL_TEXTURE_CUBE_MAP_POSITIVE_Z
texels[5] <– GL_TEXTURE_CUBE_MAP_NEGATIVE_Z

Todo:
memory allocated for this pointer might be lost at texture deletion as ownership is unclear.

Definition at line 80 of file Texture.hpp.


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