Antkeeper  0.0.1
Public Member Functions | List of all members
gl::gl_shader_texture_2d Class Reference

2-dimensional texture shader variable implementation using OpenGL. More...

#include <gl-shader-variables.hpp>

Inheritance diagram for gl::gl_shader_texture_2d:
gl::shader_variable

Public Member Functions

 gl_shader_texture_2d (std::size_t size, GLint gl_uniform_location, GLint gl_first_texture_unit_index)
 
constexpr shader_variable_type type () const noexcept override
 Returns the shader variable data type. More...
 
void update (const texture_2d &value) const noexcept override
 Updates the value of the variable. More...
 
void update (const texture_2d &value, std::size_t index) const override
 Updates the value of a single element in an array variable. More...
 
void update (std::span< const texture_2d *const > values, std::size_t index=0) const override
 Updates the values of one or more elements in an array variable. More...
 
void update (std::span< const std::shared_ptr< texture_2d >> values, std::size_t index=0) const override
 Updates the values of one or more elements in an array variable. More...
 
- Public Member Functions inherited from gl::shader_variable
std::size_t size () const noexcept
 Returns the number of elements in an array variable, or 1 if the variable is not an array. More...
 
virtual void update (bool value) const
 Updates the value of the variable. More...
 
virtual void update (const math::bvec2 &value) const
 Updates the value of the variable. More...
 
virtual void update (const math::bvec3 &value) const
 Updates the value of the variable. More...
 
virtual void update (const math::bvec4 &value) const
 Updates the value of the variable. More...
 
virtual void update (int value) const
 Updates the value of the variable. More...
 
virtual void update (const math::ivec2 &value) const
 Updates the value of the variable. More...
 
virtual void update (const math::ivec3 &value) const
 Updates the value of the variable. More...
 
virtual void update (const math::ivec4 &value) const
 Updates the value of the variable. More...
 
virtual void update (unsigned int value) const
 Updates the value of the variable. More...
 
virtual void update (const math::uvec2 &value) const
 Updates the value of the variable. More...
 
virtual void update (const math::uvec3 &value) const
 Updates the value of the variable. More...
 
virtual void update (const math::uvec4 &value) const
 Updates the value of the variable. More...
 
virtual void update (float value) const
 Updates the value of the variable. More...
 
virtual void update (const math::fvec2 &value) const
 Updates the value of the variable. More...
 
virtual void update (const math::fvec3 &value) const
 Updates the value of the variable. More...
 
virtual void update (const math::fvec4 &value) const
 Updates the value of the variable. More...
 
virtual void update (const math::fmat2 &value) const
 Updates the value of the variable. More...
 
virtual void update (const math::fmat3 &value) const
 Updates the value of the variable. More...
 
virtual void update (const math::fmat4 &value) const
 Updates the value of the variable. More...
 
virtual void update (const texture_1d &value) const
 Updates the value of the variable. More...
 
virtual void update (const texture_3d &value) const
 Updates the value of the variable. More...
 
virtual void update (const texture_cube &value) const
 Updates the value of the variable. More...
 
virtual void update (bool value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (const math::bvec2 &value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (const math::bvec3 &value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (const math::bvec4 &value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (int value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (const math::ivec2 &value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (const math::ivec3 &value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (const math::ivec4 &value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (unsigned int value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (const math::uvec2 &value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (const math::uvec3 &value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (const math::uvec4 &value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (float value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (const math::fvec2 &value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (const math::fvec3 &value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (const math::fvec4 &value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (const math::fmat2 &value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (const math::fmat3 &value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (const math::fmat4 &value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (const texture_1d &value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (const texture_3d &value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (const texture_cube &value, std::size_t index) const
 Updates the value of a single element in an array variable. More...
 
virtual void update (std::span< const bool > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const math::bvec2 > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const math::bvec3 > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const math::bvec4 > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const int > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const math::ivec2 > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const math::ivec3 > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const math::ivec4 > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const unsigned int > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const math::uvec2 > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const math::uvec3 > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const math::uvec4 > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const float > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const math::fvec2 > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const math::fvec3 > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const math::fvec4 > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const math::fmat2 > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const math::fmat3 > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const math::fmat4 > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const texture_1d *const > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const texture_3d *const > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const texture_cube *const > values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const std::shared_ptr< texture_1d >> values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const std::shared_ptr< texture_3d >> values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 
virtual void update (std::span< const std::shared_ptr< texture_cube >> values, std::size_t index=0) const
 Updates the values of one or more elements in an array variable. More...
 

Additional Inherited Members

- Protected Member Functions inherited from gl::shader_variable
 shader_variable (std::size_t size) noexcept
 Constructs a shader variable. More...
 

Detailed Description

2-dimensional texture shader variable implementation using OpenGL.

Definition at line 458 of file gl-shader-variables.hpp.

Constructor & Destructor Documentation

◆ gl_shader_texture_2d()

gl::gl_shader_texture_2d::gl_shader_texture_2d ( std::size_t  size,
GLint  gl_uniform_location,
GLint  gl_first_texture_unit_index 
)

Definition at line 495 of file gl-shader-variables.cpp.

Member Function Documentation

◆ type()

constexpr shader_variable_type gl::gl_shader_texture_2d::type ( ) const
inlineconstexproverridevirtualnoexcept

Returns the shader variable data type.

Implements gl::shader_variable.

Definition at line 463 of file gl-shader-variables.hpp.

◆ update() [1/4]

void gl::gl_shader_texture_2d::update ( const texture_2d value) const
overridevirtualnoexcept

Updates the value of the variable.

If the variable is an array, the value of the first element will be updated.

Parameters
valueUpdate value.
Exceptions
std::invalid_argumentShader variable type mismatch.

Reimplemented from gl::shader_variable.

Definition at line 503 of file gl-shader-variables.cpp.

◆ update() [2/4]

void gl::gl_shader_texture_2d::update ( const texture_2d value,
std::size_t  index 
) const
overridevirtual

Updates the value of a single element in an array variable.

Parameters
valueUpdate value.
indexIndex of the element to update.
Exceptions
std::invalid_argumentShader variable type mismatch.

Reimplemented from gl::shader_variable.

Definition at line 513 of file gl-shader-variables.cpp.

◆ update() [3/4]

void gl::gl_shader_texture_2d::update ( std::span< const std::shared_ptr< texture_2d >>  values,
std::size_t  index = 0 
) const
overridevirtual

Updates the values of one or more elements in an array variable.

Parameters
valuesContiguous sequence of update values.
indexIndex of the first element to update.
Exceptions
std::invalid_argumentShader variable type mismatch.

Reimplemented from gl::shader_variable.

Definition at line 538 of file gl-shader-variables.cpp.

◆ update() [4/4]

void gl::gl_shader_texture_2d::update ( std::span< const texture_2d *const >  values,
std::size_t  index = 0 
) const
overridevirtual

Updates the values of one or more elements in an array variable.

Parameters
valuesContiguous sequence of update values.
indexIndex of the first element to update.
Exceptions
std::invalid_argumentShader variable type mismatch.

Reimplemented from gl::shader_variable.

Definition at line 525 of file gl-shader-variables.cpp.


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