globjects  1.0.0.000000000000
Strict OpenGL objects wrapper.
Object.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <string>
5 
6 #include <glbinding/gl/types.h>
7 
9 
10 #include <globjects/globjects_api.h>
11 
12 
13 namespace globjects
14 {
15 
16 
17 class ObjectVisitor;
18 class IDResource;
19 
26 class GLOBJECTS_API Object : public Referenced
27 {
28  friend class AbstractObjectNameImplementation;
29 
30 public:
31  enum class NameImplementation
32  {
33  DebugKHR
34  , Legacy
35  };
36 
37  static void hintNameImplementation(NameImplementation impl);
38 
39 public:
40  virtual void accept(ObjectVisitor & visitor) = 0;
41 
42  gl::GLuint id() const;
43 
44  std::string name() const;
45  void setName(const std::string & name);
46  bool hasName() const;
47 
48  bool isDefault() const;
49 
50  virtual gl::GLenum objectType() const = 0;
51 
54  void detach();
55 
56 protected:
57  Object(IDResource * resource);
58  virtual ~Object();
59 
60 protected:
61  IDResource * m_resource;
62 
63  mutable void * m_objectLabelState;
64 };
65 
66 
67 } // namespace globjects
void * m_objectLabelState
Definition: Object.h:63
IDResource * m_resource
Definition: Object.h:61
NameImplementation
Definition: Object.h:31
Contains all the classes that wrap OpenGL functionality.
Superclass of all wrapped OpenGL objects.
Definition: Object.h:26
Superclass for all classes that use reference counting in globjects.
Definition: Referenced.h:22
Implements a Visitor Pattern to iterate over all tracked globjects objects.
Definition: ObjectVisitor.h:29