gdk-graphics 0b051eb9b5c1eaa0658babaa4463dd7a80aa9d2c
Loading...
Searching...
No Matches
gdk::texture Class Referenceabstract

uniform color data, usually used to color the surface of a 3d model, but also used for height maps, volumetric lights etc. More...

#include <texture.h>

Inheritance diagram for gdk::texture:
gdk::webgl1es2_texture

Public Types

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

virtual void update_data (const texture_data::view &)=0
 replace the texture data with new data
 
virtual void update_data (const texture_data::view &, const size_t offsetX, const size_t offsetY)=0
 
virtual ~texture ()=default
 trivial destructor
 

Protected Member Functions

 texture ()=default
 interface type cannot be instantiated
 

Detailed Description

uniform color data, usually used to color the surface of a 3d model, but also used for height maps, volumetric lights etc.

Member Enumeration Documentation

◆ format

enum class gdk::texture::format
strong

format of data in the component_type array

Enumerator
grey 

a sequence of 1 channel, single byte color: grey, ...

rg 

a sequence of 2 channels, single byte colors: red, green, ...

rgb 

a sequence of 3 channels, single byte colors: red, green, blue, ...

rgba 

a sequence of 4 channels, single byte colors: red, green, blue, alpha, ...

◆ wrap_mode

enum class gdk::texture::wrap_mode
strong

behavior when sampling outside of the normalized texture range (u0-1, v0-1)

Enumerator
clamped 

returns the closest value in range. e.g: {0, 2} OR {0, 1.1} would sample {0, 1}

repeat 

sampled values repeat. e.g: {2,2}, {3,3}, 100,100} would all sample {1,1}

mirrored 

every odd whole value flips the index of the sampled value. {1.25, 0.5} would sample {0.75, 0.5}

Member Function Documentation

◆ update_data() [1/2]

virtual void gdk::texture::update_data ( const texture_data::view & )
pure virtual

replace the texture data with new data

Implemented in gdk::webgl1es2_texture.

◆ update_data() [2/2]

virtual void gdk::texture::update_data ( const texture_data::view & ,
const size_t offsetX,
const size_t offsetY )
pure virtual

update a section of texture data \warn formats must match \warn new data must be kept within bounds of the existing data

Implemented in gdk::webgl1es2_texture.


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