OGLplus (0.52.0) a C++ wrapper for OpenGL

program.hpp
Go to the documentation of this file.
1 
12 #pragma once
13 #ifndef OGLPLUS_PROGRAM_1107121519_HPP
14 #define OGLPLUS_PROGRAM_1107121519_HPP
15 
16 #include <oglplus/config/compiler.hpp>
21 #include <oglplus/data_type.hpp>
25 #include <oglplus/face_mode.hpp>
26 #include <oglplus/glsl_source.hpp>
28 #include <oglplus/detail/base_range.hpp>
29 
30 #include <vector>
31 #include <cassert>
32 #include <tuple>
33 
34 namespace oglplus {
35 
36 class VertexAttribOps;
37 
39 
46 template <>
47 class ObjGenDelOps<tag::Program>
48 {
49 protected:
50  static void Gen(tag::Create, GLsizei count, GLuint* names)
51  {
52  assert(names != nullptr);
53  for(GLsizei i=0; i<count; ++i)
54  {
55  names[i] = OGLPLUS_GLFUNC(CreateProgram)();
56  OGLPLUS_CHECK_SIMPLE(CreateProgram);
57  }
58  }
59 
60  static void Delete(GLsizei count, GLuint* names)
61  {
62  assert(names != nullptr);
63  for(GLsizei i=0; i<count; ++i)
64  {
65  OGLPLUS_GLFUNC(DeleteProgram)(names[i]);
66  OGLPLUS_VERIFY_SIMPLE(DeleteProgram);
67  }
68  }
69 
70  static GLboolean IsA(GLuint name)
71  {
72  assert(name != 0);
73  GLboolean result = OGLPLUS_GLFUNC(IsProgram)(name);
74  OGLPLUS_VERIFY_SIMPLE(IsProgram);
75  return result;
76  }
77 };
78 
79 template <>
80 struct ObjGenTag<tag::DirectState, tag::Program>
81 {
82  typedef tag::Create Type;
83 };
84 
86 template <>
87 class ObjBindingOps<tag::Program>
88 {
89 protected:
90  static GLuint _binding(void)
91  {
92  GLint name = 0;
93  OGLPLUS_GLFUNC(GetIntegerv)(GL_CURRENT_PROGRAM, &name);
94  OGLPLUS_VERIFY(
95  GetIntegerv,
96  Error,
97  EnumParam(GLenum(GL_CURRENT_PROGRAM))
98  );
99  return name;
100  }
101 public:
103 
107  static ProgramName Binding(void)
108  {
109  return ProgramName(_binding());
110  }
111 
113 
117  static void Bind(ProgramName program)
118  {
119  OGLPLUS_GLFUNC(UseProgram)(GetGLName(program));
120  OGLPLUS_VERIFY(
121  UseProgram,
122  ObjectError,
123  Object(program)
124  );
125  }
126 };
127 
129 
132 template <>
134  : public ProgramName
135  , public ObjBindingOps<tag::Program>
136 {
137 protected:
138  ObjCommonOps(void){ }
139 public:
141 
143 
151  void Bind(void) const
152  {
153  Bind(*this);
154  }
155 
157 
165  void Use(void) const
166  {
167  Bind(*this);
168  }
169 };
170 
171 
173 
175 template <>
176 class ObjectOps<tag::DirectState, tag::Program>
177  : public ObjZeroOps<tag::DirectState, tag::Program>
178 {
179 protected:
180  ObjectOps(void){ }
181 public:
182  GLint GetIntParam(GLenum query) const
183  {
184  GLint result;
185  OGLPLUS_GLFUNC(GetProgramiv)(_name, query, &result);
186  OGLPLUS_VERIFY(
187  GetProgramiv,
188  ObjectError,
189  Object(*this).
190  EnumParam(query)
191  );
192  return result;
193  }
194 
195 #if GL_VERSION_4_0 || GL_ARB_shader_subroutine
196  GLint GetStageIntParam(GLenum stage, GLenum query) const
197  {
198  GLint result;
199  OGLPLUS_GLFUNC(GetProgramStageiv)(_name, stage, query, &result);
200  OGLPLUS_VERIFY(
201  GetProgramStageiv,
202  ObjectError,
203  Object(*this).
204  EnumParam(query)
205  );
206  return result;
207  }
208 #endif
209 
211 
215  ObjectOps& AttachShader(ShaderName shader);
216 
218  ObjectOps& AttachShaders(const Sequence<ShaderName>& shaders);
219 
221 
225  ObjectOps& DetachShader(ShaderName shader);
226 
228 
236  bool IsLinked(void) const
237  {
238  return GetIntParam(GL_LINK_STATUS) == GL_TRUE;
239  }
240 
242 
250  String GetInfoLog(void) const;
251 
253 
263  ObjectOps& Link(void);
264 
266 
280  ObjectOps& Build(void);
281 
282 #if OGLPLUS_DOCUMENTATION_ONLY ||\
283  GL_ARB_shading_language_include
284 
286 
300  ObjectOps& BuildInclude(
301  GLsizei count,
302  const GLchar* const* paths,
303  const GLint* lengths
304  );
305 
306  ObjectOps& BuildInclude(GLSLString&& incl)
307  {
308  return BuildInclude(
309  incl.Count(),
310  incl.Parts(),
311  incl.Lengths()
312  );
313  }
314 
315  ObjectOps& BuildInclude(GLSLStrings&& incl)
316  {
317  return BuildInclude(
318  incl.Count(),
319  incl.Parts(),
320  incl.Lengths()
321  );
322  }
323 
324  ObjectOps& BuildInclude(const GLSLSource&& incl)
325  {
326  return BuildInclude(
327  incl.Count(),
328  incl.Parts(),
329  incl.Lengths()
330  );
331  }
332 #endif
333 
335 
342  bool IsValid(void) const
343  {
344  return GetIntParam(GL_VALIDATE_STATUS) == GL_TRUE;
345  }
346 
348 
358  ObjectOps& Validate(void);
359 
361 
367  void TransformFeedbackVaryings(
368  GLsizei count,
369  const GLchar** varyings,
371  );
372 
374 
380  void TransformFeedbackVarying(const GLchar* varying)
381  {
382  TransformFeedbackVaryings(
383  1, &varying,
385  );
386  }
387 
388  template <typename std::size_t N>
389  void TransformFeedbackVaryings(
390  const GLchar* (&varyings)[N],
392  )
393  {
394  TransformFeedbackVaryings(N, varyings, mode);
395  }
396 
398 
404  void TransformFeedbackVaryings(
405  const std::vector<String>& varyings,
407  ) const;
408 
409 #if OGLPLUS_DOCUMENTATION_ONLY
410 
415  class ActiveVariableInfo
416  {
417  public:
419  GLuint Index(void) const;
420 
422  const String& Name(void) const;
423 
425  const GLint Size(void) const;
426 
428  const SLDataType Type(void) const;
429  };
430 
432 
443 
446 
457 #else
458  typedef aux::ActiveVariableInfo ActiveVariableInfo;
459  typedef aux::ProgramInterfaceContext InterfaceContext;
460 
461 #if GL_VERSION_4_3
462  typedef aux::ContextElementRange<
463  aux::ProgramInterfaceContext,
466 #endif
467 
468  typedef aux::ContextElementRange<
469  aux::ProgramInterfaceContext,
470  aux::ActiveAttribInfo
472 
473  typedef aux::ContextElementRange<
474  aux::ProgramInterfaceContext,
475  aux::ActiveUniformInfo
477 
478 #if GL_VERSION_4_0 || GL_ARB_shader_subroutine
479  typedef aux::ContextElementRange<
480  aux::ProgramInterfaceContext,
481  aux::ActiveSubroutineInfo
482  > ActiveSubroutineRange;
483 
484  typedef aux::ContextElementRange<
485  aux::ProgramInterfaceContext,
486  aux::ActiveSubroutineUniformInfo
488 #endif
489  typedef aux::ContextElementRange<
490  aux::ProgramInterfaceContext,
491  aux::TransformFeedbackVaryingInfo
493 
494  struct ShaderIterationContext
495  {
496  std::vector<GLuint> _shader_names;
497 
498  ShaderIterationContext(GLuint name, GLuint count);
499 
500  ShaderIterationContext(ShaderIterationContext&& temp)
501  : _shader_names(std::move(temp._shader_names))
502  { }
503  };
504 
505  struct IteratedShaderName
506  : ShaderName
507  {
508  IteratedShaderName(
509  const ShaderIterationContext& context,
510  unsigned index
511  ): ShaderName(context._shader_names.at(index))
512  { }
513  };
514 
515  typedef aux::ContextElementRange<
516  ShaderIterationContext,
517  IteratedShaderName
518  > ShaderRange;
519 #endif // !OGLPLUS_DOCUMENTATION_ONLY
520 
521 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_3
522 
526  InterfaceContext ActiveResourceContext(ProgramInterface intf) const;
527 
529 
538  ActiveResourceRange ActiveResources(ProgramInterface intf) const;
539 #endif
540 
542 
545  InterfaceContext ActiveAttribContext(void) const;
546 
548 
554  ActiveAttribRange ActiveAttribs(void) const;
555 
557 
560  InterfaceContext ActiveUniformContext(void) const;
561 
563 
569  ActiveUniformRange ActiveUniforms(void) const;
570 
571 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_0 || GL_ARB_shader_subroutine
572 
574 
577  InterfaceContext ActiveSubroutineContext(ShaderType stage) const;
578 
580 
588  ActiveSubroutineRange ActiveSubroutines(ShaderType stage) const;
589 
591 
594  InterfaceContext ActiveSubroutineUniformContext(ShaderType stage) const;
595 
597 
605  ActiveSubroutineUniformRange ActiveSubroutineUniforms(ShaderType stage) const;
606 #endif
607 
609 
612  InterfaceContext TransformFeedbackVaryingContext(void) const;
613 
615 
621  TransformFeedbackVaryingRange TransformFeedbackVaryings(void) const;
622 
624  ShaderRange AttachedShaders(void) const;
625 
626 #if OGLPLUS_DOCUMENTATION_ONLY
627 
633  class ActiveUniformBlockInfo
634  {
636  GLuint Index(void) const;
637 
639  const String& Name(void) const;
640 
641  // TODO: active uniform indices, etc.
642  };
643 
646 #else
647  typedef aux::ContextElementRange<
648  aux::ProgramInterfaceContext,
649  aux::ActiveUniformBlockInfo
650  > ActiveUniformBlockRange;
651 #endif
652 
654 
660  ActiveUniformBlockRange ActiveUniformBlocks(void) const;
661 
662 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_1 || GL_ARB_separate_shader_objects
663 
669  ObjectOps& MakeSeparable(bool para = true);
670 #endif // separate shader objects
671 
672 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_1 || GL_ARB_get_program_binary
673 
681  ObjectOps& MakeRetrievable(bool para = true);
682 
684 
694  void GetBinary(std::vector<GLubyte>& binary, GLenum& format) const;
695 
697 
705  void Binary(const std::vector<GLubyte>& binary, GLenum format);
706 #endif // get program binary
707 
709 
715  {
716  return TransformFeedbackMode(
717  GetIntParam(GL_TRANSFORM_FEEDBACK_BUFFER_MODE)
718  );
719  }
720 
721 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_3_2
722 
728  GLint GeometryVerticesOut(void) const
729  {
730  return GetIntParam(GL_GEOMETRY_VERTICES_OUT);
731  }
732 #endif
733 
734 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_1 || GL_ARB_gpu_shader5
735 
737 
743  GLint GeometryShaderInvocations(void) const
744  {
745  return GetIntParam(GL_GEOMETRY_SHADER_INVOCATIONS);
746  }
747 #endif // gpu shader 5
748 
749 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_3_2
750 
752 
759  {
760  return PrimitiveType(GetIntParam(GL_GEOMETRY_INPUT_TYPE));
761  }
762 
764 
771  {
772  return PrimitiveType(GetIntParam(GL_GEOMETRY_OUTPUT_TYPE));
773  }
774 #endif
775 
776 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_0 || GL_ARB_tessellation_shader
777 
779 
786  {
787  return FaceOrientation(GetIntParam(GL_TESS_GEN_VERTEX_ORDER));
788  }
789 
791 
798  {
799  return TessGenPrimitiveType(GetIntParam(GL_TESS_GEN_MODE));
800  }
801 
803 
810  {
811  return TessGenPrimitiveSpacing(GetIntParam(GL_TESS_GEN_SPACING));
812  }
813 
815 
821  bool TessGenPointMode(void) const
822  {
823  return GetIntParam(GL_TESS_GEN_POINT_MODE) == GL_TRUE;
824  }
825 #endif // tessellation shader
826 
828 
833  VertexAttribSlot vertex_attrib_slot,
834  StrCRef identifier
835  )
836  {
837  OGLPLUS_GLFUNC(BindAttribLocation)(
838  _name,
839  GLuint(vertex_attrib_slot),
840  identifier.c_str()
841  );
842  OGLPLUS_CHECK(
843  BindAttribLocation,
844  ProgVarError,
845  Program(*this).
846  Identifier(identifier).
847  Index(GLuint(vertex_attrib_slot))
848  );
849  }
850 };
851 
853 typedef ObjectOps<tag::DirectState, tag::Program>
855 
857 
860 typedef ObjectZero<ObjZeroOps<tag::DirectState, tag::Program>>
862 
864 
867 typedef Object<ProgramOps> Program;
868 
869 // syntax-sugar operators
870 
871 inline ProgramOps& operator << (
872  ProgramOps& program,
873  ShaderName shader
874 )
875 {
876  program.AttachShader(shader);
877  return program;
878 }
879 
880 struct ProgAndXFBMode
881 {
882  ProgramOps& prog;
884 
885  ProgAndXFBMode(ProgramOps& p, TransformFeedbackMode m)
886  : prog(p)
887  , mode(m)
888  { }
889 };
890 
891 inline ProgAndXFBMode operator << (
892  ProgramOps& prog,
894 )
895 {
896  return ProgAndXFBMode(prog, mode);
897 }
898 
899 template <std::size_t N>
900 inline ProgramOps& operator << (
901  ProgAndXFBMode pam,
902  const GLchar* (&varyings)[N]
903 )
904 {
905  pam.prog.TransformFeedbackVaryings(varyings, pam.mode);
906  return pam.prog;
907 }
908 
909 struct ProgXFBModeAndNames
910 {
911  ProgramOps& prog;
913  std::vector<const GLchar*> names;
914 
915  ProgXFBModeAndNames(ProgAndXFBMode pam, const GLchar* name)
916  : prog(pam.prog)
917  , mode(pam.mode)
918  {
919  names.reserve(8);
920  names.push_back(name);
921  }
922 
923  ProgXFBModeAndNames(ProgXFBModeAndNames&& pman, const GLchar* name)
924  : prog(pman.prog)
925  , mode(pman.mode)
926  , names(std::move(pman.names))
927  {
928  names.push_back(name);
929  }
930 
931  ProgXFBModeAndNames(ProgXFBModeAndNames&& tmp)
932  : prog(tmp.prog)
933  , mode(tmp.mode)
934  , names(std::move(tmp.names))
935  { }
936 
937 
938 #if !OGLPLUS_NO_DELETED_FUNCTIONS
939  ProgXFBModeAndNames(const ProgXFBModeAndNames&) = delete;
940 #else
941 private:
942  ProgXFBModeAndNames(const ProgXFBModeAndNames&);
943 public:
944 #endif
945 
946  ~ProgXFBModeAndNames(void)
947  {
948  if(!names.empty())
949  {
950  prog.TransformFeedbackVaryings(
951  names.size(),
952  names.data(),
953  mode
954  );
955  }
956  }
957 };
958 
959 inline ProgXFBModeAndNames operator << (
960  ProgAndXFBMode pam,
961  const GLchar* name
962 )
963 {
964  return ProgXFBModeAndNames(pam, name);
965 }
966 
967 inline ProgXFBModeAndNames operator << (
968  ProgXFBModeAndNames&& pman,
969  const GLchar* name
970 )
971 {
972  return ProgXFBModeAndNames(std::move(pman), name);
973 }
974 
975 
976 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_1 || GL_ARB_separate_shader_objects
977 
985  : public Program
986 {
987 private:
988  static ProgramName _make(
989  ShaderType shader_type,
990  GLsizei count,
991  const GLchar* const* strings
992  );
993 
994  template <typename Src>
995  static ProgramName _make(ShaderType shader_type, const Src& source)
996  {
997  return _make(shader_type, source.Count(), source.Parts());
998  }
999 
1000  void _check(void);
1001 public:
1003 
1007  ShaderType shader_type,
1008  GLSLString&& source
1009  ): Program(_make(shader_type, source))
1010  { _check(); }
1011 
1013 
1017  ShaderType shader_type,
1018  GLSLString&& source,
1019  ObjectDesc&& object_desc
1020  ): Program(_make(shader_type, source), std::move(object_desc))
1021  { _check(); }
1022 
1024 
1028  ShaderType shader_type,
1029  GLSLStrings&& source
1030  ): Program(_make(shader_type, source))
1031  { _check(); }
1032 
1034 
1038  ShaderType shader_type,
1039  GLSLStrings&& source,
1040  ObjectDesc&& object_desc
1041  ): Program(_make(shader_type, source), std::move(object_desc))
1042  { _check(); }
1043 
1045 
1049  ShaderType shader_type,
1050  const GLSLSource& glsl_source
1051  ): Program(_make(shader_type, glsl_source.Count(), glsl_source.Parts()))
1052  { _check(); }
1053 
1055 
1059  ShaderType shader_type,
1060  const GLSLSource& glsl_source,
1061  ObjectDesc&& object_desc
1062  ): Program(
1063  _make(shader_type, glsl_source.Count(), glsl_source.Parts()),
1064  std::move(object_desc)
1065  )
1066  { _check(); }
1067 };
1068 #endif
1069 
1071 
1077  : public Program
1078 {
1079 public:
1082  {
1083  AttachShaders(shaders);
1084  Link();
1085  Use();
1086  }
1087 
1090  ObjectDesc&& object_desc,
1091  const Sequence<ShaderName>& shaders
1092  ): Program(std::move(object_desc))
1093  {
1094  AttachShaders(shaders);
1095  Link();
1096  Use();
1097  }
1098 
1099 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_1 || GL_ARB_separate_shader_objects
1100 
1104  QuickProgram(bool separable, const Sequence<ShaderName>& shaders)
1105  {
1106  AttachShaders(shaders);
1107  if(separable) MakeSeparable();
1108  Link();
1109  Use();
1110  }
1111 
1113 
1117  ObjectDesc&& object_desc,
1118  bool separable,
1119  const Sequence<ShaderName>& shaders
1120  ): Program(std::move(object_desc))
1121  {
1122  AttachShaders(shaders);
1123  if(separable) MakeSeparable();
1124  Link();
1125  Use();
1126  }
1127 #endif
1128 };
1129 
1130 } // namespace oglplus
1131 
1132 #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
1133 #include <oglplus/program.ipp>
1134 #endif // OGLPLUS_LINK_LIBRARY
1135 
1136 #endif // include guard
Range< ActiveUniformBlockInfo > ActiveUniformRange
The type of the range for traversing active uniform blocks.
Definition: program.hpp:645
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
Information about a single active program resource.
Definition: program_resource.hpp:46
static ProgramName Binding(void)
Returns the currently bound (active) Program.
Definition: program.hpp:107
Common base class for Object name sequences.
Definition: fwd.hpp:139
TessGenPrimitiveSpacing
Tesselation primitive spacing.
Definition: primitive_type.hpp:61
ObjectOps & AttachShader(ShaderName shader)
Attaches the shader to this program.
USE_MISSING_GLYPH_NV.
Range< ActiveVariableInfo > ActiveAttribRange
The type of the range for traversing active vertex attributes.
Definition: program.hpp:448
Wrapper class for all ranges that can be used for Element traversal.
Definition: ranges.hpp:39
ShaderProgram(ShaderType shader_type, GLSLString &&source, ObjectDesc &&object_desc)
Creates a program with a single shader with specified type and source.
Definition: program.hpp:1016
void Use(void) const
Uses this program object.
Definition: program.hpp:165
QuickProgram(const Sequence< ShaderName > &shaders)
Attaches shaders, links and uses the program.
Definition: program.hpp:1081
A class that allows to build programs in the constructor.
Definition: program.hpp:1076
VertexAttribSlot object.
Range< ActiveVariableInfo > ActiveUniformRange
The type of the range for traversing active uniforms.
Definition: program.hpp:450
void TransformFeedbackVarying(const GLchar *varying)
Sets the variable that will be captured during transform feedback.
Definition: program.hpp:380
TessGenPrimitiveType TessGenMode(void) const
Returns the tesselation generator output primitive type.
Definition: program.hpp:797
bool IsValid(void) const
Returns true if the program is validated, false otherwise.
Definition: program.hpp:342
ShaderProgram(ShaderType shader_type, GLSLString &&source)
Creates a program with a single shader with specified type and source.
Definition: program.hpp:1006
ShaderProgram(ShaderType shader_type, const GLSLSource &glsl_source, ObjectDesc &&object_desc)
Creates a single shader program with specified type, source and desc.
Definition: program.hpp:1058
PrimitiveType
Primitive type enumeration.
Definition: primitive_type.hpp:29
bool TessGenPointMode(void) const
Returns true if point mode is enabled in tesslation eval. shader.
Definition: program.hpp:821
Class storing source code in GLSL.
Definition: glsl_source.hpp:22
Program errors.
Generic OpenGL object wrapper.
static void Bind(ProgramName program)
Binds (uses) the specified program.
Definition: program.hpp:117
OpenGL primitive type-related declarations.
ShaderProgram(ShaderType shader_type, GLSLStrings &&source)
Creates a program with a single shader with specified type and source.
Definition: program.hpp:1027
Implements operations applicable to named (non-zero) objects.
Definition: wrap_tpl.hpp:45
A standalone program with a single shader of a specified type from GLSL source.
Definition: program.hpp:984
GLint GeometryShaderInvocations(void) const
Returns the number of invocations of geometry shader per primitive.
Definition: program.hpp:743
PrimitiveType GeometryOutputType(void) const
Returns the geometry shader output primitive type.
Definition: program.hpp:770
GLuint GetGLName(ObjectName< ObjTag > named)
Returns the GLuint OpenGL name assigned to named object.
Definition: name.hpp:38
FaceOrientation
Face orientation enumeration.
Definition: face_mode.hpp:62
Range< ActiveVariableInfo > ActiveSubroutineUniformRange
The type of the range for traversing active subroutine uniforms.
Definition: program.hpp:452
OpenGL face type-related enumeration.
ObjectZero< ObjZeroOps< tag::DirectState, tag::Program > > NoProgram
Class that can be used to unbind the currently active program.
Definition: program.hpp:861
ProgramInterface
Program interface enumeration.
Definition: program_interface.hpp:33
QuickProgram(ObjectDesc &&object_desc, bool separable, const Sequence< ShaderName > &shaders)
Attaches shaders, makes separable, links and uses the program.
Definition: program.hpp:1116
Class for passing a set of strings as a Source to a Shader.
Definition: glsl_string.hpp:94
Sequence of Object names.
OpenGL program resource wrapper.
String const reference wrapper template.
Definition: ref_tpl.hpp:72
TessGenPrimitiveType
Tesselation generation stage primitive type.
Definition: primitive_type.hpp:45
void Bind(void) const
Binds (uses) this program object.
Definition: program.hpp:151
Implements operations applicable to any object including object 0 (zero)
Definition: fwd.hpp:157
Data type-related declarations.
Exception class for GL program-variable-related errors.
Definition: prog_var.hpp:22
Type for the vertex attribute slot (implementation-dependent limited) number.
Definition: vertex_attrib_slot.hpp:27
TransformFeedbackMode enumeration.
Unspecified InterfaceContext
Helper class for efficient iteration of Program interface items.
Definition: program.hpp:442
::std::basic_string< GLchar > String
String class.
Definition: def.hpp:36
Range< ActiveVariableInfo > TransformFeedbackVaryingRange
The type of the range for traversing transform feedback varyings.
Definition: program.hpp:454
ObjectOps< tag::DirectState, tag::Program > ProgramOps
Program operations with direct state access.
Definition: program.hpp:854
Exception class for general OpenGL errors.
Definition: basic.hpp:43
Exception class for GL object-related errors.
Definition: object.hpp:24
Object< ProgramOps > Program
An oglplus_object encapsulating the program object functionality.
Definition: program.hpp:867
TransformFeedbackMode TransformFeedbackBufferMode(void) const
Returns the transform feedback buffer mode.
Definition: program.hpp:714
GLint GeometryVerticesOut(void) const
Returns the number of vertices that the geometry shader will output.
Definition: program.hpp:728
ShaderProgram(ShaderType shader_type, GLSLStrings &&source, ObjectDesc &&object_desc)
Creates a program with a single shader with specified type and source.
Definition: program.hpp:1037
void BindLocation(VertexAttribSlot vertex_attrib_slot, StrCRef identifier)
Binds the location of a SL variable to the vertex_attrib.
Definition: program.hpp:832
Helper class storing source code in GLSL.
TessGenPrimitiveSpacing TessGenSpacing(void) const
Returns the tesselation generator primitive spacing mode.
Definition: program.hpp:809
QuickProgram(ObjectDesc &&object_desc, const Sequence< ShaderName > &shaders)
Attaches shaders, links, uses and describes the program.
Definition: program.hpp:1089
TransformFeedbackMode
The mode used to capture the varying variables in TF.
Definition: transform_feedback_mode.hpp:25
Unspecified internal type.
Definition: doc.hpp:364
Class wrapping program functions (with direct state access)
Definition: program.hpp:176
Implements operations applicable to any object and any operation kind.
Definition: fwd.hpp:151
SLDataType
OpenGL Shading Language data type enumeration.
Definition: data_type.hpp:123
QuickProgram(bool separable, const Sequence< ShaderName > &shaders)
Attaches shaders, makes separable, links and uses the program.
Definition: program.hpp:1104
bool IsLinked(void) const
Returns true if the program is already linked, false otherwise.
Definition: program.hpp:236
Declaration of OGLplus program-variable-related error.
Class for passing a single string as a Source to a Shader.
Definition: glsl_string.hpp:31
FaceOrientation TessGenVertexOrder(void) const
Returns the vertex order in tesselation evaluation shader.
Definition: program.hpp:785
PrimitiveType GeometryInputType(void) const
Returns the geometry shader input primitive type.
Definition: program.hpp:758
ShaderProgram(ShaderType shader_type, const GLSLSource &glsl_source)
Creates a program with a single shader with specified type and source.
Definition: program.hpp:1048
Range< Managed< Shader > > ShaderRange
The type of the range for traversing program's shaders.
Definition: program.hpp:456
Range< ProgramResource > ActiveResourceRange
The type of the range for traversing program resource information.
Definition: program.hpp:445

Copyright © 2010-2014 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Mon Sep 22 2014 by Doxygen (version 1.8.6).