![]() |
gdk-graphics 0b051eb9b5c1eaa0658babaa4463dd7a80aa9d2c
|
Public Types | |
enum class | minification_filter { linear , nearest , nearest_mipmap_nearest , linear_mipmap_nearest , nearest_mipmap_linear , linear_mipmap_linear } |
enum class | magnification_filter { nearest , linear } |
enum class | format { alpha , depth , luminance_alpha , rgb , rgba } |
![]() | |
enum class | format { grey , rg , rgb , rgba } |
format of data in the component_type array More... | |
enum class | wrap_mode { clamped , repeat , mirrored } |
behavior when sampling outside of the normalized texture range (u0-1, v0-1) More... | |
Public Member Functions | |
GLuint | getHandle () const |
returns the handle to the webgl1es2_texture in the opengl context | |
void | activateAndBind (const GLint aUnit) const |
activates the texture in given unit and binds it to GL_TEXTURE_2D, so that it can be manipulated by other opengl calls | |
bool | operator== (const webgl1es2_texture &) const |
equality semantics | |
bool | operator!= (const webgl1es2_texture &) const |
equality semantics | |
webgl1es2_texture & | operator= (webgl1es2_texture &&)=default |
move semantics | |
webgl1es2_texture (webgl1es2_texture &&)=default | |
move semantics | |
webgl1es2_texture (const texture_data::view &aTextureView, const wrap_mode aWrapModeU=wrap_mode::repeat, const wrap_mode aWrapModeV=wrap_mode::repeat, const minification_filter minFilter=minification_filter::linear, const magnification_filter magFilter=magnification_filter::nearest) | |
creates a 2d webgl1es2_texture from decoded image data. | |
webgl1es2_texture (const webgl1es2_texture::format aFormat, const size_t aWidthInTexels, const size_t aHeightInTexels, const texture_data::channel_type *aData, const wrap_mode aWrapModeU=wrap_mode::repeat, const wrap_mode aWrapModeV=wrap_mode::repeat, const minification_filter minFilter=minification_filter::linear, const magnification_filter magFilter=magnification_filter::nearest) | |
external interface | |
virtual void | update_data (const texture_data::view &) override |
replace the texture data with new data | |
virtual void | update_data (const texture_data::view &, const size_t offsetX, const size_t offsetY) override |
![]() | |
virtual | ~texture ()=default |
trivial destructor | |
Static Public Member Functions | |
static const std::shared_ptr< gdk::webgl1es2_texture > | GetCheckerboardOfDeath () |
webgl1es2_texture useful for indicating webgl1es2_texture related failure lazily instantiated. | |
static const GLint | getMaxTextureSize () |
gets the max texture size supported by the current graphics device | |
Additional Inherited Members | |
![]() | |
texture ()=default | |
interface type cannot be instantiated | |
|
strong |
The webgl1es2_texture magnification function is used when the pixel being webgl1es2_textured maps to an area less than or equal to one webgl1es2_texture element
Enumerator | |
---|---|
nearest | Returns the value of the webgl1es2_texture element that is nearest (in Manhattan distance) to the center of the pixel being webgl1es2_textured. |
linear | Returns the weighted average of the four webgl1es2_texture elements that are closest to the center of the pixel being webgl1es2_textured. |
|
strong |
The webgl1es2_texture minifying function is used whenever the pixel being webgl1es2_textured maps to an area greater than one webgl1es2_texture element.
Enumerator | |
---|---|
linear | Returns the value of the webgl1es2_texture element that is nearest (in Manhattan distance) to the center of the pixel being webgl1es2_textured. |
nearest | Returns the weighted average of the four webgl1es2_texture elements that are closest to the center of the pixel being webgl1es2_textured. |
nearest_mipmap_nearest | Chooses the mipmap that most closely matches the size of the pixel being webgl1es2_textured and uses the GL_NEAREST criterion (the webgl1es2_texture element nearest to the center of the pixel) to produce a webgl1es2_texture value. |
linear_mipmap_nearest | Chooses the mipmap that most closely matches the size of the pixel being webgl1es2_textured and uses the GL_LINEAR criterion (a weighted average of the four webgl1es2_texture elements that are closest to the center of the pixel) to produce a webgl1es2_texture value. |
nearest_mipmap_linear | Chooses the two mipmaps that most closely match the size of the pixel being webgl1es2_textured and uses the GL_NEAREST criterion (the webgl1es2_texture element nearest to the center of the pixel) to produce a webgl1es2_texture value from each mipmap. The final webgl1es2_texture value is a weighted average of those two values. |
linear_mipmap_linear | Chooses the two mipmaps that most closely match the size of the pixel being webgl1es2_textured and uses the GL_LINEAR criterion (a weighted average of the four webgl1es2_texture elements that are closest to the center of the pixel) to produce a webgl1es2_texture value from each mipmap. |
gdk::webgl1es2_texture::webgl1es2_texture | ( | const texture_data::view & | aTextureView, |
const wrap_mode | aWrapModeU = wrap_mode::repeat, | ||
const wrap_mode | aWrapModeV = wrap_mode::repeat, | ||
const minification_filter | minFilter = minification_filter::linear, | ||
const magnification_filter | magFilter = magnification_filter::nearest ) |
creates a 2d webgl1es2_texture from decoded image data.
length,width | of the webgl1es2_texture must be power of 2 |
|
overridevirtual |
replace the texture data with new data
Implements gdk::texture.
|
overridevirtual |
update a section of texture data \warn formats must match \warn new data must be kept within bounds of the existing data
Implements gdk::texture.