class ffw::GLTexture1D
Class List > ffw :: GLTexture1D
OpenGL texture of type GL_TEXTURE_1D.
Inherits the following classes: ffw::GLTexture
Public Functions
Type | Name |
---|---|
GLTexture1D () | |
GLTexture1D (const GLTexture1D & other) = delete | |
GLTexture1D (GLTexture1D && other) | |
virtual | ~GLTexture1D () = default |
GLTexture1D (GLsizei width, GLenum internalformat, GLenum format, GLenum pixelformat, const GLvoid * pixels = nullptr) Allocates the texture. | |
void | resize (GLsizei width, const GLvoid * pixels = nullptr) Resizes the texture. |
void | setPixels (GLint level, const GLvoid * pixels) Sets the pixels of the entire texture. |
void | setPixels (GLint level, GLint xoffset, GLsizei width, const GLvoid * pixels) Sets the pixels of the texture section. |
void | getPixels (void * pixels) const Returns the pixels of the entire texture. |
GLTexture1D & | operator= (const GLTexture1D & other) = delete |
GLTexture1D & | operator= (GLTexture1D && other) |
Public Functions Documentation
function GLTexture1D (1/4)
ffw::GLTexture1D::GLTexture1D ()
function GLTexture1D (2/4)
ffw::GLTexture1D::GLTexture1D (
const GLTexture1D & other
) = delete
function GLTexture1D (3/4)
ffw::GLTexture1D::GLTexture1D (
GLTexture1D && other
)
function ~GLTexture1D
virtual ffw::GLTexture1D::~GLTexture1D () = default
function GLTexture1D (4/4)
ffw::GLTexture1D::GLTexture1D (
GLsizei width,
GLenum internalformat,
GLenum format,
GLenum pixelformat,
const GLvoid * pixels = nullptr
)
Allocates the texture.
Parameters:
- width Specifies the width of the texture image.
- internalformat Specifies the number of color components in the texture.
- format Specifies the format of the pixel data. The following symbolic values are accepted: GL_RED, GL_RG, GL_RGB, GL_BGR, GL_RGBA, GL_BGRA, GL_RED_INTEGER, GL_RG_INTEGER, GL_RGB_INTEGER, GL_BGR_INTEGER, GL_RGBA_INTEGER, GL_BGRA_INTEGER, GL_STENCIL_INDEX, GL_DEPTH_COMPONENT, GL_DEPTH_STENCIL.
- pixelformat Specifies the data type of the pixel data. The following symbolic values are accepted: GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, GL_FLOAT, GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, and GL_UNSIGNED_INT_2_10_10_10_REV. Compressed formats are also supported.
- pixels Optional array to the pixels buffer that will be used to initialise the texture storage. The pixel array must be correct size, otherwise a segmentation fault will occur. If null, the texture storage is not set and initialised with random data.
Exception:
- GLException if something went wrong
The following compressed internalformats are allowed: GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_RED_RGTC1, GL_COMPRESSED_RG_RGTC2, GL_COMPRESSED_SIGNED_RED_RGTC1, GL_COMPRESSED_SIGNED_RG_RGTC2
Note:
The texture is automatically destroyed once destroy() is called, or the instance of this texture class is freed.
function resize
void ffw::GLTexture1D::resize (
GLsizei width,
const GLvoid * pixels = nullptr
)
Resizes the texture.
Parameters:
- width The new width of the texture
- pixels Optional array to the pixels buffer that will be used to initialise the texture storage. The pixel array must be correct size, otherwise a segmentation fault will occur. If null, the texture storage is not set and initialised with random data.
Exception:
- GLException if the texture has not been allocated
Note:
The format, internalformat, and pixelformat are unchanged.
function setPixels (1/2)
void ffw::GLTexture1D::setPixels (
GLint level,
const GLvoid * pixels
)
Sets the pixels of the entire texture.
Parameters:
- level The mipmap level to set. Zero by default.
- pixels Non null pointer to the array of the pixels to upload.
Exception:
- GLException if the texture has not been allocated
function setPixels (2/2)
void ffw::GLTexture1D::setPixels (
GLint level,
GLint xoffset,
GLsizei width,
const GLvoid * pixels
)
Sets the pixels of the texture section.
Parameters:
- level The mipmap level to set. Zero by default.
- xoffset The x offset of the target area to set.
- width The width of the area to set.
- pixels Non null pointer to the array of the pixels to upload.
Exception:
- GLException if the texture has not been allocated
function getPixels
void ffw::GLTexture1D::getPixels (
void * pixels
) const
Returns the pixels of the entire texture.
Parameters:
- pixels Non null pointer to an allocated array that will hold the entire texture data.
Exception:
- GLException if the texture has not been allocated
function operator= (1/2)
GLTexture1D & ffw::GLTexture1D::operator= (
const GLTexture1D & other
) = delete
function operator= (2/2)
GLTexture1D & ffw::GLTexture1D::operator= (
GLTexture1D && other
)
The documentation for this class was generated from the following file: include/ffw/graphics/gltexture1d.h