![]() |
AireEngine
A 3D Open-World Game Engine
|
Cubemap Texture class. More...
#include <texture.h>


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 | |
| TextureCubemap & | operator= (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 char * | getImageData () |
| 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 char * | imageData |
Protected Attributes inherited from Aire::Resource | |
| ResourceState | resourceState |
Cubemap Texture class.
Create a new Cubemap Texture See: https://registry.khronos.org/OpenGL-Refpages/gl4/html/glTexSubImage3D.xhtml
| width | Width of the texture in number of pixels (texels). |
| height | Height of the texture in number of pixels (texels). |
| levels | Number 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. |
| internalformat | The format of the texture data. See link for details. |
| 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
| face | Specifies the target faces which will be affected by the changes |
| xOffset | The x-coordinate of the lower-left corner of the pixel region to be updated. Must be non-negative but smaller than texture width. |
| yOffset | The y-coordinate of the lower-left corner of the pixel region to be updated. Must be non-negative but smaller than texture height. |
| width | The width of the pixel region to be updated. |
| height | The height of the pixel region to be updated. |
| data | A pointer to the image data (a row-major 2D array assumed, with the appropriate width and height). |
| format | The format of the image data. Defaults to 4-channel GL_RGBA. |
| type | The type of the image data. Defaults to GL_UNSIGNED_BYTE. |
| level | The level in the mipmap hierarchy. |