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
13namespace globjects
14{
15
16
17class ObjectVisitor;
18class IDResource;
19
26class GLOBJECTS_API Object : public Referenced
27{
28 friend class AbstractObjectNameImplementation;
29
30public:
32 {
33 DebugKHR
34 , Legacy
35 };
36
38
39public:
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
56protected:
57 Object(IDResource * resource);
58 virtual ~Object();
59
60protected:
61 IDResource * m_resource;
62
63 mutable void * m_objectLabelState;
64};
65
66
67} // namespace globjects
Superclass of all wrapped OpenGL objects.
Definition: Object.h:27
virtual void accept(ObjectVisitor &visitor)=0
std::string name() const
bool hasName() const
virtual gl::GLenum objectType() const =0
void setName(const std::string &name)
IDResource * m_resource
Definition: Object.h:61
NameImplementation
Definition: Object.h:32
bool isDefault() const
void * m_objectLabelState
Definition: Object.h:63
gl::GLuint id() const
Object(IDResource *resource)
static void hintNameImplementation(NameImplementation impl)
Implements a Visitor Pattern to iterate over all tracked globjects objects.
Definition: ObjectVisitor.h:30
Superclass for all classes that use reference counting in globjects.
Definition: Referenced.h:23
Contains all the classes that wrap OpenGL functionality.