gdk-graphics 0a0aef92e917cfbac53dffbc32c295e4de914093
Loading...
Searching...
No Matches
gdk::graphics::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::graphics::texture:

Public Types

enum class  wrap_mode { clamped , repeat , mirrored }
 behavior when sampling outside of the normalized texture range (u0-1, v0-1) More...
enum class  filter_mode { sharp , smooth }
 how a texel is chosen when a pixel does not land exactly on one More...
using format = texture_data::format
 format of data in the component_type array.

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 std::size_t offsetX, const std::size_t offsetY)=0
 update a section of texture data
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 Typedef Documentation

◆ format

format of data in the component_type array.

See also
texture_data::format

Member Enumeration Documentation

◆ filter_mode

how a texel is chosen when a pixel does not land exactly on one

Enumerator
sharp 

nearest: the one texel closest to the sample, so texels stay square

smooth 

linear: a weighted average of the texels around the sample

◆ wrap_mode

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::graphics::texture::update_data ( const texture_data::view & )
pure virtual

replace the texture data with new data

Implemented in gdk::graphics::null_texture.

◆ update_data() [2/2]

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

update a section of texture data

Exceptions
gdk::graphics::exceptionthe section is in another format than the texture, or not wholly within it

Implemented in gdk::graphics::null_texture.


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