globjects  2.0.0.4363356ae2ef
Strict OpenGL objects wrapper.
Loading...
Searching...
No Matches
Object.h
Go to the documentation of this file.
1
2#pragma once
3
4
5#include <string>
6#include <memory>
7
8#include <glbinding/gl/types.h>
9
10#include <globjects/globjects_api.h>
11
12
13namespace globjects
14{
15
16
17class ObjectVisitor;
18class IDResource;
19
20
27class GLOBJECTS_API Object
28{
29 friend class AbstractObjectNameImplementation;
30
31
32public:
34 {
35 Legacy,
36 DebugKHR
37 };
38
40
41
42public:
43 gl::GLuint id() const;
44
45 std::string name() const;
46 void setName(const std::string & name);
47 bool hasName() const;
48
49 bool isDefault() const;
50
51 virtual gl::GLenum objectType() const = 0;
52
55 void detach();
56
57
58protected:
59 Object(std::unique_ptr<IDResource> && resource);
60 virtual ~Object();
61
62
63protected:
64 std::unique_ptr<IDResource> m_resource;
65
66 mutable void * m_objectLabelState;
67};
68
69
70} // namespace globjects
Superclass of all wrapped OpenGL objects.
Definition: Object.h:28
std::string name() const
bool hasName() const
virtual gl::GLenum objectType() const =0
void setName(const std::string &name)
NameImplementation
Definition: Object.h:34
Object(std::unique_ptr< IDResource > &&resource)
bool isDefault() const
void * m_objectLabelState
Definition: Object.h:66
std::unique_ptr< IDResource > m_resource
Definition: Object.h:64
gl::GLuint id() const
static void hintNameImplementation(NameImplementation impl)
Contains all the classes that wrap OpenGL functionality.