13 #ifndef OGLPLUS_PROG_VAR_LOCATION_1405052234_HPP
14 #define OGLPLUS_PROG_VAR_LOCATION_1405052234_HPP
24 template <
typename VarTag>
28 template <
typename VarTag>
30 :
public ProgVarLocOps<VarTag>
33 friend GLint GetGLLocation<VarTag>(
ProgVarLoc);
37 void RequireActive(
StrCRef identifier)
const
39 OGLPLUS_HANDLE_ERROR_IF(
42 ProgVarLocOps<VarTag>::MsgUsingInactive(),
45 Identifier(identifier)
49 void RequireActive(
void)
const
56 OGLPLUS_NOEXCEPT(true)
63 OGLPLUS_NOEXCEPT(
true)
71 OGLPLUS_NOEXCEPT(
true)
78 OGLPLUS_NOEXCEPT(
true)
86 , _location(ProgVarLocOps<VarTag>::GetLocation(
92 template <
typename LocOpsParam>
94 : ProgVarLocOps<VarTag>(param)
96 , _location(ProgVarLocOps<VarTag>::GetLocation(
105 , _location(ProgVarLocOps<VarTag>::GetLocation(
111 template <
typename LocOpsParam>
117 ): ProgVarLocOps<VarTag>(param)
119 , _location(ProgVarLocOps<VarTag>::GetLocation(
128 this->_program = that._program;
129 this->_location= that._location;
136 _location = ProgVarLocOps<VarTag>::GetLocation(
146 OGLPLUS_NOEXCEPT(true)
153 OGLPLUS_NOEXCEPT(true)
160 OGLPLUS_NOEXCEPT(true)
162 return _location >= 0;
166 OGLPLUS_EXPLICIT
operator bool (
void) const
167 OGLPLUS_NOEXCEPT(true)
174 OGLPLUS_NOEXCEPT(
true)
176 return (a._program == b._program)&&(a._location == b._location);
181 OGLPLUS_NOEXCEPT(
true)
183 return (a._program != b._program)||(a._location != b._location);
188 OGLPLUS_NOEXCEPT(
true)
190 if(a._program < b._program)
return true;
191 if(a._program == b._program)
return (a._location < b._location);
197 template <
typename VarTag>
200 return variable._location;
205 #endif // include guard
ProgVarLoc(ProgramName program)
Creates variable without specific location in specified program.
Definition: location.hpp:62
OGLPLUS_EXPLICIT ProgVarLoc(GLint location)
Creates variable with specified location without specific program.
Definition: location.hpp:70
ProgVarLoc(ProgramName program, StrCRef identifier)
Creates variable with specified identifier in specified program.
Definition: location.hpp:84
ProgVarLoc(void)
Default construction.
Definition: location.hpp:55
ProgVarLoc(ProgramName program, GLint location)
Creates variable with specified location in specified program.
Definition: location.hpp:77
Wrapper encapsulating program variable location/index.
Definition: fwd.hpp:191
GLint GetGLLocation(ProgVarLoc< VarTag >)
Returns the GL location/index of the specified variable.
Definition: location.hpp:198
friend bool operator==(ProgVarLoc a, ProgVarLoc b)
Equality comparison.
Definition: location.hpp:173
ProgVarLoc(ProgramName program, StrCRef identifier, bool active_only)
Creates variable with specified identifier in specified program.
Definition: location.hpp:103
GLuint GetGLName(ObjectName< ObjTag > named)
Returns the GLuint OpenGL name assigned to named object.
Definition: name.hpp:38
ProgVarLoc & Assign(ProgVarLoc that)
Copy assignment.
Definition: location.hpp:126
String const reference wrapper template.
Definition: ref_tpl.hpp:72
bool IsActive(void) const
Returns true if the variable is active.
Definition: location.hpp:159
ProgVarLoc & BindTo(StrCRef identifier, bool is_active=true)
Late initialization of the variable location from its identifier.
Definition: location.hpp:134
friend bool operator<(ProgVarLoc a, ProgVarLoc b)
Ordering.
Definition: location.hpp:187
friend bool operator!=(ProgVarLoc a, ProgVarLoc b)
Inequality comparison.
Definition: location.hpp:180
Base class for OpenGL "named" objects.
StrCRefTpl< GLchar > StrCRef
String const reference wrapper.
Definition: ref.hpp:21
Declaration of OGLplus program-variable-related error.
GLint Location(void) const
Returns the location of the variable.
Definition: location.hpp:152
ProgramName Program(void) const
The program the variable belongs to.
Definition: location.hpp:145