gdk-graphics 0b051eb9b5c1eaa0658babaa4463dd7a80aa9d2c
Loading...
Searching...
No Matches
gdk::webgl1es2_texture Class Referencefinal
Inheritance diagram for gdk::webgl1es2_texture:
gdk::texture

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
}
 
- Public Types inherited from gdk::texture
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_textureoperator= (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
 
- Public Member Functions inherited from gdk::texture
virtual ~texture ()=default
 trivial destructor
 

Static Public Member Functions

static const std::shared_ptr< gdk::webgl1es2_textureGetCheckerboardOfDeath ()
 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

- Protected Member Functions inherited from gdk::texture
 texture ()=default
 interface type cannot be instantiated
 

Member Enumeration Documentation

◆ magnification_filter

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.

◆ minification_filter

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.
The final webgl1es2_texture value is a weighted average of those two values.

Constructor & Destructor Documentation

◆ webgl1es2_texture()

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.

Exceptions
length,widthof the webgl1es2_texture must be power of 2

Member Function Documentation

◆ update_data() [1/2]

virtual void gdk::webgl1es2_texture::update_data ( const texture_data::view & )
overridevirtual

replace the texture data with new data

Implements gdk::texture.

◆ update_data() [2/2]

virtual void gdk::webgl1es2_texture::update_data ( const texture_data::view & ,
const size_t offsetX,
const size_t offsetY )
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.


The documentation for this class was generated from the following file: