Object.h
Go to the documentation of this file.
#pragma once
#include <string>
#include <glbinding/gl/types.h>
#include <globjects/base/Referenced.h>
#include <globjects/globjects_api.h>
namespace globjects
{
class ObjectVisitor;
class IDResource;
class GLOBJECTS_API Object : public Referenced
{
friend class AbstractObjectNameImplementation;
public:
enum class NameImplementation
{
DebugKHR
, Legacy
};
static void hintNameImplementation(NameImplementation impl);
public:
virtual void accept(ObjectVisitor & visitor) = 0;
gl::GLuint id() const;
std::string name() const;
void setName(const std::string & name);
bool hasName() const;
bool isDefault() const;
virtual gl::GLenum objectType() const = 0;
void detach();
protected:
Object(IDResource * resource);
virtual ~Object();
protected:
IDResource * m_resource;
mutable void * m_objectLabelState;
};
} // namespace globjects
Referenced.h
globjects
Contains all the classes that wrap OpenGL functionality.
globjects::Object
Superclass of all wrapped OpenGL objects.
Definition: Object.h:26
globjects::Object::m_resource
IDResource * m_resource
Definition: Object.h:61
globjects::Object::m_objectLabelState
void * m_objectLabelState
Definition: Object.h:63
globjects::ObjectVisitor
Implements a Visitor Pattern to iterate over all tracked globjects objects.
Definition: ObjectVisitor.h:29
globjects::Object::NameImplementation
NameImplementation
Definition: Object.h:31
globjects::Referenced
Superclass for all classes that use reference counting in globjects.
Definition: Referenced.h:22