21 #ifndef FASTUIDRAW_GL_PROGRAM_HPP 22 #define FASTUIDRAW_GL_PROGRAM_HPP 182 action(GLuint glsl_program)
const = 0;
206 action(GLuint glsl_program)
const;
226 action(GLuint glsl_program)
const;
254 action(GLuint glsl_program)
const;
288 transform_feedback_varyings(
void);
296 transform_feedback_varyings(
void)
const;
300 action(GLuint glsl_program)
const;
395 GLenum buffer_mode = GL_INTERLEAVED_ATTRIBS)
399 h->transform_feedback_varyings() = varyings;
408 execute_actions(GLuint glsl_program)
const;
443 perform_initialization(
Program *pr,
bool program_bound)
const = 0;
496 add_uniform_initializer(
c_string uniform_name,
const T &value);
508 add_sampler_initializer(
c_string uniform_name,
int value);
519 add_uniform_block_binding(
c_string uniform_name,
int value);
529 perform_initializations(
Program *pr,
bool program_bound)
const;
648 operator bool()
const 650 return m_d !=
nullptr;
664 glsl_type(
void)
const;
671 shader_variable_src(
void)
const;
698 location(
unsigned int array_element = 0)
const;
715 ubo_index(
void)
const;
728 buffer_offset(
unsigned int array_index = 0,
729 unsigned int leading_array_index = 0)
const;
738 array_stride(
void)
const;
748 matrix_stride(
void)
const;
756 is_row_major(
void)
const;
769 abo_index(
void)
const;
783 shader_storage_buffer_index(
void)
const;
792 shader_storage_buffer_top_level_array_size(
void)
const;
801 shader_storage_buffer_top_level_array_stride(
void)
const;
809 transform_feedback_buffer_index(
void)
const;
840 operator bool()
const 842 return m_d ? true :
false;
855 shader_variable_src(
void)
const;
870 block_index(
void)
const;
878 buffer_size(
void)
const;
891 initial_buffer_binding(
void)
const;
899 number_variables(
void)
const;
912 variable(
unsigned int I);
933 unsigned int *out_array_index =
nullptr,
934 unsigned int *out_leading_array_index =
nullptr);
945 return m_d < rhs.m_d;
975 operator bool()
const 977 return m_d ? true :
false;
1000 buffer_index(
void)
const;
1012 buffer_binding(
void)
const;
1020 buffer_size(
void)
const;
1028 number_variables(
void)
const;
1041 variable(
unsigned int I);
1054 unsigned int *out_array_index =
nullptr);
1065 return m_d < rhs.m_d;
1121 Program(GLuint pname,
bool take_ownership);
1160 program_build_time(
void);
1188 default_uniform_block(
void);
1197 number_active_uniform_blocks(
void);
1210 uniform_block(
unsigned int I);
1222 uniform_block_id(
c_string uniform_block_name);
1240 return uniform_block(uniform_block_id(uniform_block_name));
1259 number_active_shader_storage_blocks(
void);
1272 shader_storage_block(
unsigned int I);
1283 shader_storage_block_id(
c_string shader_storage_block_name);
1301 return shader_storage_block(shader_storage_block_id(shader_storage_block_name));
1310 number_active_atomic_buffers(
void);
1323 atomic_buffer(
unsigned int I);
1333 atomic_buffer_id(
unsigned int binding_point);
1340 find_shader_variable(
c_string name,
1341 unsigned int *out_array_index =
nullptr,
1342 unsigned int *out_leading_array_index =
nullptr);
1351 number_active_attributes(
void);
1365 active_attribute(
unsigned int I);
1378 number_transform_feedbacks(
void);
1392 transform_feedback(
unsigned int I);
1398 number_transform_feedback_buffers(
void);
1406 transform_feedback_buffer_stride(
unsigned int B);
1417 attribute_location(
c_string attribute_name);
1425 num_shaders(GLenum tp)
const;
1434 shader_compile_success(GLenum tp,
unsigned int i)
const;
1443 shader_src_code(GLenum tp,
unsigned int i)
const;
1452 shader_compile_log(GLenum tp,
unsigned int i)
const;
1478 perform_initialization(
Program *pr,
bool program_bound)
const;
1503 unsigned int array_index,
bool program_bound)
const = 0;
1514 template<
typename T>
1533 unsigned int array_index,
bool program_bound)
const 1554 template<
typename T>
1570 for (
unsigned int i = 0; i < value.
size(); ++i)
1572 new (&m_data[i]) T(value[i]);
1580 if (m_data !=
nullptr)
1582 for (
unsigned int i = 0; i < m_value.size(); ++i)
1595 unsigned int array_index,
bool program_bound)
const 1635 m_value(binding_point)
1643 unsigned int array_index,
bool program_bound)
const;
1669 perform_initialization(
Program *pr,
bool program_bound)
const;
1677 template<
typename T>
1701 #ifndef FASTUIDRAW_GL_USE_GLES 1723 perform_initialization(
Program *pr,
bool program_bound)
const;
A shader_variable_info holds the type, size and name of a uniform or an attribute of a GL program...
shader_variable_src_t
Enumeration to describe the backing of a shader variable's value.
block_info shader_storage_block(c_string shader_storage_block_name)
GLint location(unsigned int array_element=0) const
A ShaderSource represents the source code to a GLSL shader, specifying blocks of source code and macr...
Simple Shader utility class providing a simple interface to build GL shader objects using a glsl::Sha...
Shader(const glsl::ShaderSource &src, GLenum pshader_type)
A PreLinkActionArray is a conveniance class wrapper over an array of PreLinkAction handles...
A block_info represents an object from which one can query the members of a uniform or shader storage...
all classes and functions of FastUIDraw are in the namespace fastuidraw.
PreLinkActionArray & add_frag_binding(c_string pname, int plocation, int pindex=0)
A wrapper over a pointer to implement reference counting.
A PreLinkAction is an action to apply to a Program after attaching shaders but before linking...
A ShaderStorageBlockInitializer is used to initalize the binding point used by a shader storage block...
PreLinkActionArray & set_transform_feedback(const string_array &varyings, GLenum buffer_mode=GL_INTERLEAVED_ATTRIBS)
size_type size(void) const
Class to intialize the binding points of samplers. If the uniform is an array, the first element will...
A BindAttribute inherits from PreLinkAction, it's purpose is to bind named attributes to named locati...
PreLinkActionArray & add_binding(c_string pname, int plocation)
ProgramInitializerArray & add_uniform_initializer(c_string uniform_name, const T &value)
void swap(reference_counted_ptr< T > &lhs, reference_counted_ptr< T > &rhs)
c_string source_code(void)
void Uniform(int location, GLsizei count, const vecN< T, N > &v)
Template version for setting array of uniforms.
SamplerInitializer(c_string uniform_name, int binding_point)
Conveniance class to hold an array of handles of ProgramInitializer objects.
#define FASTUIDRAWfree(ptr)
Class for creating and using GLSL programs.
A c_array is a wrapper over a C pointer with a size parameter to facilitate bounds checking and provi...
An atomic_buffer_info represents an object from which one can query the data of an atomic buffer...
Defines default reference counting base classes.
const char * c_string
Conveniant typedef for C-style strings.
ProgramInitializerArray & add_sampler_initializer(c_string uniform_name, int value)
block_info uniform_block(c_string uniform_block_name)
static c_string default_shader_version(void)
bool compile_success(void)
A ProgramSeparable inherits from PreLinkAction, its purpose is to set a GLSL program as separable...
A BindFragDataLocation inherits from PreLinkAction, its purpose is to bind a fragment shader out to a...
c_string compile_log(void)
#define FASTUIDRAWmalloc(size)
static c_string gl_shader_type_label(GLenum ptype)
A ProgramInitializer is a functor object called the first time a Program is bound (i...
void ProgramUniform(GLuint program, int location, GLsizei count, const vecN< T, N > &v)
Template version for setting array of uniforms,.
file reference_counted.hpp
ProgramInitializerArray & add_uniform_block_binding(c_string uniform_name, int value)