3 #ifndef GDK_GFX_WEBGL1ES2_SHADER_PROGRAM_H 4 #define GDK_GFX_WEBGL1ES2_SHADER_PROGRAM_H 6 #include <gdk/graphics_types.h> 7 #include <gdk/opengl.h> 8 #include <gdk/shader_program.h> 9 #include <gdk/webgl1es2_texture.h> 10 #include <jfc/shared_proxy_ptr.h> 11 #include <jfc/unique_handle.h> 16 #include <unordered_map> 61 const std::string &aAttributeName)
const;
64 bool try_set_uniform(
const std::string &aName,
const GLfloat aValue)
const;
67 const graphics_vector2_type &aValue)
const;
70 const graphics_vector3_type &aValue)
const;
73 const graphics_vector4_type &aValue)
const;
76 const std::vector<GLfloat> &avalue)
const;
79 const std::vector<graphics_vector2_type> &avalue)
const;
82 const std::vector<graphics_vector3_type> &avalue)
const;
85 const std::vector<graphics_vector4_type> &avalue)
const;
88 bool try_set_uniform(
const std::string &aName,
const GLint aValue)
const;
97 bool try_set_uniform(
const std::string &aName,
const std::vector<GLint> &aValue)
const;
99 bool try_set_uniform(
const std::string &aName,
const std::vector<integer2_uniform_type> &aValue)
const;
101 bool try_set_uniform(
const std::string &aName,
const std::vector<integer3_uniform_type> &aValue)
const;
103 bool try_set_uniform(
const std::string &aName,
const std::vector<integer4_uniform_type> &aValue)
const;
134 bool try_set_uniform(
const std::string &aName,
const graphics_mat4x4_type &avalue)
const;
136 bool try_set_uniform(
const std::string &aName,
const std::vector<graphics_mat4x4_type> &avalue)
const;
168 static const jfc::shared_proxy_ptr<gdk::webgl1es2_shader_program>
AlphaCutOff;
178 jfc::unique_handle<GLuint> m_VertexShaderHandle;
181 jfc::unique_handle<GLuint> m_FragmentShaderHandle;
184 jfc::unique_handle<GLuint> m_ProgramHandle;
void useProgram() const
bind an array of textures to the context then assign them to texture uniforms
std::unordered_map< std::string, active_uniform_info > active_uniform_collection_type
Definition: webgl1es2_shader_program.h:49
Specifies drawing behaviours at the programmable stages in the graphics pipeline. ...
Definition: shader_program.h:9
bool operator==(const webgl1es2_shader_program &) const
equality semantics
webgl1es2_shader_program & operator=(webgl1es2_shader_program &&)=default
move semantics
index, size, type of an active attribute used in the shader program
Definition: webgl1es2_shader_program.h:28
std::array< GLint, 4 > integer4_uniform_type
type alias used for setting int4 uniform value
Definition: webgl1es2_shader_program.h:56
a texture generally represents the color of a surface
Definition: webgl1es2_texture.h:18
static const jfc::shared_proxy_ptr< gdk::webgl1es2_shader_program > AlphaCutOff
Definition: webgl1es2_shader_program.h:168
static const size_t MAX_TEXTURE_UNITS
Definition: webgl1es2_shader_program.h:174
GLint count
number of components in the attribute, e.g: 2
Definition: webgl1es2_shader_program.h:33
Specifies drawing behaviours at the two programmable stages in the OpenGL ES 2.0/WebGL 1...
Definition: webgl1es2_shader_program.h:24
bool try_set_uniform(const std::string &aName, const GLfloat aValue) const
assign a float1 uniform from a float
std::array< GLint, 3 > integer3_uniform_type
type alias used for setting int3 uniform value
Definition: webgl1es2_shader_program.h:54
std::optional< active_attribute_info > tryGetActiveAttribute(const std::string &aAttributeName) const
returns a nonnull optional to an attribute info if one with the given name exists ...
GLenum type
type of the attribute's components, e.g: float
Definition: webgl1es2_shader_program.h:31
static const jfc::shared_proxy_ptr< gdk::webgl1es2_shader_program > PinkShaderOfDeath
shader useful for indicating some kind of failure. Performs MVP mul then colors all frags bright pink...
Definition: webgl1es2_shader_program.h:164
bool operator!=(const webgl1es2_shader_program &) const
equality semantics
webgl1es2_shader_program(webgl1es2_shader_program &&)=default
move semantics
GLint location
location of the attribute
Definition: webgl1es2_shader_program.h:30
std::unordered_map< std::string, active_attribute_info > active_attribute_collection_type
Definition: webgl1es2_shader_program.h:46
std::array< GLint, 2 > integer2_uniform_type
type alias used for setting int2 uniform value
Definition: webgl1es2_shader_program.h:52