Module dagon.graphics.texture
Provides a texture class and corresponding utilities.
Description
The dagon
module defines the Texture
class
for managing 1D, 2D, 3D, and cube map textures, supporting compressed
and uncompressed formats, mipmapping, filtering, and OpenGL resource management.
The module also includes utility functions for texture format conversion.
Functions
Name | Description |
---|---|
cubeFaceBit(face)
|
Returns a corresponding CubeFaceBit for a given CubeFace
|
cubeFaceCameraMatrix(cf, pos)
|
Returns the world space transformation matrix for a cubemap face at a given position. |
cubeFaceMatrix(cf)
|
Returns the transformation matrix for a cubemap face. |
detectTextureFormat(img, tf)
|
Detects the supported texture format from a SuperImage .
|
dxgiFormatToGLFormat(fmt, tf)
|
Converts DirectX texture format to OpenGL texture format. |
equirectProj(dir)
|
Projects a 3D direction vector to equirectangular UV coordinates. |
glFormatToVkFormat(internalFormat)
|
Converts OpenGL internal format to Vulkan texture format. |
vkFormatToGLFormat(vkFormat, tf)
|
Converts Vulkan texture format to OpenGL texture format. |
Classes
Name | Description |
---|---|
Texture
|
Represents an OpenGL texture object. |
Structs
Name | Description |
---|---|
TextureBuffer
|
Intermediate texture data storage. Used to create textures loaded from container formats, such as DDS and KTX, from custom formats, or directly from memory. |
TextureFormat
|
Describes the format and layout of a texture. |
TextureSize
|
Represents the size of a texture in pixels. |
Enums
Name | Description |
---|---|
CubeFace
|
The faces of a cube map texture. |
CubeFaceBit
|
Bitmask for cube map faces. |
TextureDimension
|
Specifies the dimension of a texture. |