AireEngine
A 3D Open-World Game Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Aire::TextureCubemap Class Reference

Cubemap Texture class. More...

#include <texture.h>

Inheritance diagram for Aire::TextureCubemap:
Inheritance graph
[legend]
Collaboration diagram for Aire::TextureCubemap:
Collaboration graph
[legend]

Public Member Functions

 TextureCubemap (int width, int height, GLsizei levels, GLenum internalformat)
 
void setData (int face, int xOffset, int yOffset, int width, int height, const unsigned char *data, GLenum format=GL_RGBA, GLenum type=GL_UNSIGNED_BYTE, int level=0)
 
void generateMipmaps ()
 Generate mipmaps. It is assumed that there is allocated memory for all levels.
 
 TextureCubemap (const TextureCubemap &)=delete
 
TextureCubemapoperator= (const TextureCubemap &)=delete
 
- Public Member Functions inherited from Aire::Texture
 Texture ()
 Create the texture.
 
uint32_t getSize ()
 
GLuint getHandle () const
 
virtual ~Texture ()=0
 Destroy the texture.
 
void bindTexUnit (GLint textureUnit)
 
void setFiltering (GLint minFilter, GLint maxFilter)
 
void setWrapping (GLint wrapS, GLint wrapT, GLint wrapR)
 
unsigned chargetImageData ()
 
void setImageData (unsigned char *)
 
- Public Member Functions inherited from Aire::Resource
 Resource ()
 Default constructor.
 
virtual ~Resource ()
 Default destructor.
 
bool isLoadToGpu ()
 
ResourceState getState ()
 
void setState (ResourceState state)
 

Public Attributes

std::vector< unsigned char * > texDataList
 
int texWidth [6]
 
int texHeight [6]
 
int texChannels [6]
 
- Public Attributes inherited from Aire::Texture
int texWidth
 
int texHeight
 
int texChannels
 
std::string dir
 

Additional Inherited Members

- Protected Attributes inherited from Aire::Texture
GLuint handle
 
unsigned charimageData
 
- Protected Attributes inherited from Aire::Resource
ResourceState resourceState
 

Detailed Description

Cubemap Texture class.

Constructor & Destructor Documentation

◆ TextureCubemap()

TextureCubemap::TextureCubemap ( int width,
int height,
GLsizei levels,
GLenum internalformat )

Create a new Cubemap Texture See: https://registry.khronos.org/OpenGL-Refpages/gl4/html/glTexSubImage3D.xhtml

Parameters
widthWidth of the texture in number of pixels (texels).
heightHeight of the texture in number of pixels (texels).
levelsNumber of levels in the mipmap hierarchy to allocate. If 0, allocate the full hierarchy. Note that this is a custom treatment of the 0 value. A native OpenGL call with levels=0 will produce an error.
internalformatThe format of the texture data. See link for details.

Member Function Documentation

◆ setData()

void TextureCubemap::setData ( int face,
int xOffset,
int yOffset,
int width,
int height,
const unsigned char * data,
GLenum format = GL_RGBA,
GLenum type = GL_UNSIGNED_BYTE,
int level = 0 )

Set the image data for a region of the texture. See: https://registry.khronos.org/OpenGL-Refpages/gl4/html/glTexSubImage3D.xhtml

Parameters
faceSpecifies the target faces which will be affected by the changes
xOffsetThe x-coordinate of the lower-left corner of the pixel region to be updated. Must be non-negative but smaller than texture width.
yOffsetThe y-coordinate of the lower-left corner of the pixel region to be updated. Must be non-negative but smaller than texture height.
widthThe width of the pixel region to be updated.
heightThe height of the pixel region to be updated.
dataA pointer to the image data (a row-major 2D array assumed, with the appropriate width and height).
formatThe format of the image data. Defaults to 4-channel GL_RGBA.
typeThe type of the image data. Defaults to GL_UNSIGNED_BYTE.
levelThe level in the mipmap hierarchy.

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