video.gltexturebackend
- package alias GLTexturePage;
Alias for default texture page to use with OpenGL code.
- struct GLTextureBackend;
OpenGL texture backend.
Encapsulates an OpenGL texture and operates on it. Used by TexturePage.
- this(const(Vector2!(uint)) size, const(ColorFormat) format);
Construct a GLTextureBackend.
Parameters:const(Vector2!(uint)) size Size of the texture. const(ColorFormat) format Color format of the texture. - void subImage(ref const Image image, const Vector2u offset);
Insert an image into the texture.
Parameters:Image image Image to insert. Vector2u offset Offset of the image relative to the texture in pixels. - void start();
Start using this texture for upcoming draws.
- static void glColorFormat(const ColorFormat format, out GLenum glFormat, out GLenum type, out GLint internalFormat);
Convert a ColorFormat to OpenGL color format parameters.
Parameters:ColorFormat format ColorFormat to convert. GLenum glFormat GL format of the data (RGBA, luminance, etc) will be written here. GLenum type GL data type (unsigned byte, etc) will be written here. GLint internalFormat GL internal format (RGBA8, etc) will be written here. - static GLint packAlignment(const ColorFormat format);
Determine OpenGL packing/unpacking alignment needed for specified color format.
GL only supports 1, 2, 4, 8, so using bytes per pixel doesn't work for e.g. RGB8.
Parameters:Returns:ColorFormat format Format to get alignment for. Alignment for specified format.