13 #ifndef OGLPLUS_UNIFORM_BLOCK_1107121519_HPP
14 #define OGLPLUS_UNIFORM_BLOCK_1107121519_HPP
20 #include <oglplus/prog_var/varpara_fns.hpp>
21 #include <oglplus/prog_var/set_ops.hpp>
30 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_3_1 || GL_ARB_uniform_buffer_object
36 static const char* MsgGettingInactive(
void);
38 static const char* MsgUsingInactive(
void);
48 static GLint GetLocation(
54 GLint result = OGLPLUS_GLFUNC(GetUniformBlockIndex)(
62 Identifier(identifier)
64 OGLPLUS_HANDLE_ERROR_IF(
65 active_only && (result < 0),
70 Identifier(identifier)
78 :
public ProgVarLoc<tag::UniformBlock>
81 static GLenum _translate_ref(
ShaderType shader_type);
82 static GLenum _translate_max(
ShaderType shader_type);
84 ProgVarCommonOps(UniformBlockLoc ubloc)
92 OGLPLUS_GLFUNC(GetIntegerv)(
93 _translate_max(shader_type),
99 EnumParam(_translate_max(shader_type))
102 return GLuint(result);
110 bool ReferencedBy(
ShaderType shader_type)
const
113 OGLPLUS_GLFUNC(GetActiveUniformBlockiv)(
116 _translate_ref(shader_type),
120 GetActiveUniformBlockiv,
122 EnumParam(_translate_ref(shader_type))
124 return result == GL_TRUE;
132 GLuint DataSize(
void)
const
135 OGLPLUS_GLFUNC(GetActiveUniformBlockiv)(
138 GL_UNIFORM_BLOCK_DATA_SIZE,
142 GetActiveUniformBlockiv,
144 EnumParam(GLenum(GL_UNIFORM_BLOCK_DATA_SIZE))
147 return GLuint(result);
155 void Binding(UniformBufferBindingPoint binding)
157 OGLPLUS_GLFUNC(UniformBlockBinding)(
165 Program(ProgramName(this->_program)).
166 Index(GLuint(binding))
186 #endif // uniform buffer object
190 #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
191 #include <oglplus/uniform_block.ipp>
194 #endif // include guard
const Char * c_str(void) const
Returns the null-terminated c-string.
Definition: ref_tpl.hpp:200
ShaderType
The type of a Shader.
Definition: shader_type.hpp:26
Program variable wrapper.
Program variable location wrapper.
ProgVar< tag::ImplicitSel, tag::UniformBlock, tag::NoTypecheck, void > UniformBlock
Encapsulates uniform block operations.
Definition: uniform_block.hpp:184
ProgVarLoc(void)
Default construction.
Definition: location.hpp:55
GLuint GetGLName(ObjectName< ObjTag > named)
Returns the GLuint OpenGL name assigned to named object.
Definition: name.hpp:38
String const reference wrapper template.
Definition: ref_tpl.hpp:72
Helper macro for optional checking of availability of GL function.
Declaration of OGLplus program-variable-related error.
Buffer binding point indices.