Loading...
Searching...
No Matches
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::Object
Superclass of all wrapped OpenGL objects.
Definition Object.h:27
globjects::Object::detach
void detach()
globjects::Object::accept
virtual void accept(ObjectVisitor &visitor)=0
globjects::Object::name
std::string name() const
globjects::Object::hasName
bool hasName() const
globjects::Object::objectType
virtual gl::GLenum objectType() const =0
globjects::Object::setName
void setName(const std::string &name)
globjects::Object::m_resource
IDResource * m_resource
Definition Object.h:61
globjects::Object::~Object
virtual ~Object()
globjects::Object::NameImplementation
NameImplementation
Definition Object.h:32
globjects::Object::isDefault
bool isDefault() const
globjects::Object::m_objectLabelState
void * m_objectLabelState
Definition Object.h:63
globjects::Object::id
gl::GLuint id() const
globjects::Object::Object
Object(IDResource *resource)
globjects::Object::hintNameImplementation
static void hintNameImplementation(NameImplementation impl)
globjects::ObjectVisitor
Implements a Visitor Pattern to iterate over all tracked globjects objects.
Definition ObjectVisitor.h:30
globjects::Referenced
Superclass for all classes that use reference counting in globjects.
Definition Referenced.h:23
globjects
Contains all the classes that wrap OpenGL functionality.