OGLplus (0.52.0) a C++ wrapper for OpenGL

prog_var.hpp
Go to the documentation of this file.
1 
12 #pragma once
13 #ifndef OGLPLUS_ERROR_PROG_VAR_1107121317_HPP
14 #define OGLPLUS_ERROR_PROG_VAR_1107121317_HPP
15 
16 #include <oglplus/error/basic.hpp>
17 #include <oglplus/object/name.hpp>
18 
19 namespace oglplus {
20 
23  : public Error
24 {
25 private:
26 #if !OGLPLUS_ERROR_NO_PROG_NAME
27  GLuint _prog_name;
28 #endif
29 #if !OGLPLUS_ERROR_NO_IDENTIFIER
30  String _identifier;
31 #endif
32 public:
33  ProgVarError(const char* message);
34 
35  ~ProgVarError(void) throw() { }
36 
38  {
39 #if !OGLPLUS_ERROR_NO_PROG_NAME
40  _prog_name = GetGLName(program);
41 #endif
42  (void)program;
43  return *this;
44  }
45 
47  ProgramName Program(void) const;
48 
49  ProgVarError& Identifier(StrCRef identifier)
50  {
51 #if !OGLPLUS_ERROR_NO_IDENTIFIER
52  _identifier.assign(
53  identifier.begin(),
54  identifier.end()
55  );
56 #endif
57  (void)identifier;
58  return *this;
59  }
60 
61  const char* ObjectTypeName(void) const { return "PROGRAM"; }
62 
64  GLint ObjectName(void) const { return GLint(_prog_name); }
65 
67  const char* Identifier(void) const;
68 };
69 
70 } // namespace oglplus
71 
72 #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
73 #include <oglplus/error/prog_var.ipp>
74 #endif
75 
76 #endif // include guard
const_iterator end(void) const
Returns iterator past the last character.
Definition: ref_tpl.hpp:177
const_iterator begin(void) const
Returns iterator to the first character.
Definition: ref_tpl.hpp:170
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
GLint ObjectName(void) const
Returns the GL program name.
Definition: prog_var.hpp:64
Exception class for GL program-variable-related errors.
Definition: prog_var.hpp:22
::std::basic_string< GLchar > String
String class.
Definition: def.hpp:36
Exception class for general OpenGL errors.
Definition: basic.hpp:43
Declaration of basic OGLplus' exceptions.
const char * Identifier(void) const
Returns the program variable identifer.
const char * ObjectTypeName(void) const
Returns the object type name.
Definition: prog_var.hpp:61
Base class for OpenGL "named" objects.
ProgramName Program(void) const
Returns the program.

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).