This exception will be thrown if Texture2D.from_image fails to open the image.
Every Texture-Class will mixin this template.
Deletes the texture.
Sets a texture parameter.
Queries a texture parameter from OpenGL.
Generates mipmaps for the textre (also binds it)
Binds the texture.
Activates the texture to unit, passed to the function.
Activates the texture to unit, the struct member.
Binds the texture and activates it to unit, passed to the function.
Binds the texture and activates it to unit, the struct member.
Unbinds the texture.
Interface every Texture implements.
Represents an OpenGL 1D texture. The constructor must be used to avoid segmentation faults.
The OpenGL texture name.
Holds the internal format passed to the constructor.
Holds the format of the pixel data.
Holds the OpenGL data type of the pixel data.
Holds the texture unit.
Generates the OpenGL texture and initializes the struct.
unit_ | Specifies the OpenGL texture uinit. |
Sets the texture data.
data | A pointer to the image data or an array of the image data. |
internal_format | Specifies the number of color components in the texture. |
width | If data is an array and width is -1, the width will be infered from the array, otherwise it must be valid. |
format | Specifies the format of the pixel data. |
type | Specifies the data type of the pixel data. |
Represents an OpenGL 2D texture. The constructor must be used to avoid segmentation faults.
The OpenGL texture name.
Holds the internal format passed to the constructor.
Holds the texture width.
Holds the texture height.
Holds the format of the pixel data.
Holds the OpenGL data type of the pixel data.
Holds the texture unit.
If true (default) mipmaps will be generated with glGenerateMipmap.
Generates the OpenGL texture and initializes the struct.
GLenum unit | Specifies the OpenGL texture uinit. |
Sets the texture data.
data | A pointer to the image data or an array of the image data. |
internal_format | Specifies the number of color components in the texture. |
width | Specifies the width of the texture image. |
height | Specifies the height of the texture image. |
format | Specifies the format of the pixel data. |
type | Specifies the data type of the pixel data. |
mipmaps | Enables mipmap-generation. |
level | Specifies the level-of-detail number. Level 0 is the base image level. Level n is the n th mipmap reduction image. |
Loads an image with DevIL and afterwards loads it into a Texture2D struct. DevIL must be loaded and initialized manually!
Base class, which represents an OpenGL 3D or 2D array texture. The constructor must be used to avoid segmentation faults.
The OpenGL texture name.
Holds the internal format passed to the constructor.
Holds the format of the pixel data.
Holds the OpenGL data type of the pixel data.
Holds the texture unit.
Generates the OpenGL texture and initializes the struct.
GLenum unit | Specifies the OpenGL texture uinit. |
Sets the texture data.
data | A pointer to the image data or an array of the image data. |
internal_format | Specifies the number of color components in the texture. |
width | Specifies the width of the texture image. |
height | Specifies the height of the texture image. |
depth | Specifies the depth of the texture image, or the number of layers in a texture array. |
format | Specifies the format of the pixel data. |
type | Specifies the data type of the pixel data. |