Allolib
1.0
C++ Components For Interactive Multimedia
|
Public Member Functions | |
void | create1D (GLsizei width, GLint internal=GL_RGBA8, GLenum format=GL_RGBA, GLenum type=GL_UNSIGNED_BYTE) |
void | create2D (unsigned int width, unsigned int height, int internal=GL_RGBA8, unsigned int format=GL_RGBA, unsigned int type=GL_UNSIGNED_BYTE) |
void | create2DArray (unsigned int width, unsigned int height, unsigned int depth, int internal=GL_RGBA8, unsigned int format=GL_RGBA, unsigned int type=GL_UNSIGNED_BYTE) |
void | createCubemap (unsigned int size, int internal=GL_RGBA8, unsigned int format=GL_RGBA, unsigned int type=GL_UNSIGNED_BYTE) |
void | bind (int binding_point=0) |
void | bind_temp () |
void | unbind (int binding_point=0) |
Unbind the texture (from a multitexture unit) | |
void | unbind_temp () |
unsigned int | target () const |
Get target type (e.g., TEXTURE_2D) | |
int | internalFormat () const |
Get internal format. | |
unsigned int | format () const |
Get pixel (color) format. | |
unsigned int | type () const |
Get pixel component data type. | |
unsigned int | width () const |
Get width, in pixels. | |
unsigned int | height () const |
Get height, in pixels. | |
unsigned int | depth () const |
Get depth, in pixels. | |
int | filterMin () const |
Get minification filter type. | |
int | filterMag () const |
Get magnification filter type. | |
int | wrapS () const |
Get S wrapping type. | |
int | wrapT () const |
Get T wrapping type. | |
int | wrapR () const |
Get R wrapping type. | |
bool | mipmap () const |
void | resize (unsigned w) |
Get number of components per pixel. More... | |
bool | resize (unsigned int w, unsigned int h, int internal, unsigned int format, unsigned int type) |
Resize 2D texture. | |
bool | resize (unsigned int w, unsigned int h) |
void | resize (unsigned w, unsigned h, unsigned d) |
Resize 3D texture. | |
void | filter (int v) |
Set minification and magnification filter types all at once. | |
void | filterMin (int v) |
Set minification filter type. | |
void | filterMag (int v) |
Set magnification filter type. | |
void | wrap (int S, int T, int R) |
Set 3D wrapping modes. | |
void | wrap (int S, int T) |
Set 2D wrapping modes. | |
void | wrap (int v) |
Set wrapping mode for all dimensions. | |
void | wrapS (int v) |
void | wrapT (int v) |
void | wrapR (int v) |
void | mipmap (bool b) |
Set whether to generate mipmaps. | |
void | submit (const void *pixels, unsigned int format, unsigned int type) |
void | submit (const void *pixels) |
void | generateMipmap () |
void | disableMipmap () |
void | copyFrameBuffer (int w=-1, int h=-1, int fbx=0, int fby=0, int texx=0, int texy=0, int texz=0) |
Copy pixels from current frame buffer to texture texels. More... | |
unsigned | numComponents () const |
Get number of components per pixel. | |
bool | created () const |
Returns whether object has been created. | |
void | create () |
Creates object on GPU. | |
void | destroy () |
Destroys object on GPU. | |
unsigned long | id () const |
Returns the assigned object id. | |
void | id (unsigned long v) |
void | validate () |
Ensure that the GPUObject is ready to use. More... | |
void | invalidate () |
Triggers re-creation of object safely. | |
Static Public Member Functions | |
static void | unbind (int binding_point, unsigned int target) |
static int | numComponents (Texture::Format v) |
Returns number of components for given color type. | |
Protected Member Functions | |
void | onCreate () override |
Called when currently assigned context is created. | |
void | onDestroy () override |
Called when currently assigned context is destroyed. | |
void | update_filter () |
void | update_wrap () |
void | update_mipmap () |
template<class T > | |
void | update_param (const T &v, T &var, bool &flag) |
A simple wrapper around an OpenGL Texture
Definition at line 90 of file al_Texture.hpp.
void al::Texture::bind | ( | int | binding_point = 0 | ) |
Bind the texture (to a multitexture unit) also update params and mipmap if changed
void al::Texture::bind_temp | ( | ) |
use last binding point so it doesn't collide with user's binding also bind without updating params
void al::Texture::copyFrameBuffer | ( | int | w = -1 , |
int | h = -1 , |
||
int | fbx = 0 , |
||
int | fby = 0 , |
||
int | texx = 0 , |
||
int | texy = 0 , |
||
int | texz = 0 |
||
) |
Copy pixels from current frame buffer to texture texels.
[in] | w | width of region to copy; w<0 uses w + 1 + texture.width |
[in] | h | height of region to copy; h<0 uses h + 1 + texture.height |
[in] | fbx | pixel offset from left edge of frame buffer |
[in] | fby | pixel offset from bottom edge of frame buffer |
[in] | texx | texel offset in x direction |
[in] | texy | texel offset in y direction (2D/3D only) |
[in] | texz | texel offset in z direction (3D only) |
|
inline |
Get number of components per pixel.
Get total number of elements (components x width x height x depth) Get total number of pixels Resize 1D texture
Definition at line 263 of file al_Texture.hpp.
void al::Texture::submit | ( | const void * | pixels, |
unsigned int | format, | ||
unsigned int | type | ||
) |
Copy client pixels to GPU texels NOTE: the graphics context (e.g. Window) must have been created If pixels is NULL, then the only effect is to resize the texture remotely.
|
inherited |
Ensure that the GPUObject is ready to use.
This is typically placed before any rendering implementation. If the object has been invalidated, the object will be destroyed and then created again. Otherwise, the object will simply be created if not already created.