NamedString.h
Go to the documentation of this file.
#pragma once
#include <string>
#include <glbinding/gl/types.h>
#include <globjects/base/ChangeListener.h>
#include <globjects/base/ref_ptr.h>
#include <globjects/base/Referenced.h>
#include <globjects/globjects_api.h>
namespace globjects
{
class AbstractStringSource;
class GLOBJECTS_API NamedString : public Referenced, protected ChangeListener
{
public:
static NamedString * create(const std::string & name, AbstractStringSource * string);
static NamedString * create(const std::string & name, const std::string & string);
static bool isNamedString(const std::string & name);
static NamedString * obtain(const std::string & name);
public:
const std::string & name() const;
std::string string() const;
gl::GLenum type() const;
AbstractStringSource * stringSource() const;
gl::GLint getParameter(gl::GLenum pname) const;
virtual void notifyChanged(const Changeable * changeable) override;
protected:
static bool hasNativeSupport();
static NamedString * create(const std::string & name, AbstractStringSource * string, gl::GLenum type);
static NamedString * create(const std::string & name, const std::string & string, gl::GLenum type);
protected:
void updateString();
void createNamedString();
void deleteNamedString();
NamedString(const std::string & name, AbstractStringSource * source, gl::GLenum type);
virtual ~NamedString();
void registerNamedString();
void deregisterNamedString();
protected:
std::string m_name;
ref_ptr<AbstractStringSource> m_source;
gl::GLenum m_type;
};
} // namespace globjects
globjects::NamedString
Definition: NamedString.h:21
Referenced.h
globjects::ref_ptr
The ref_ptr class provides the interface for a reference pointer.
Definition: LogMessageBuilder.h:20
globjects::NamedString::m_type
gl::GLenum m_type
Definition: NamedString.h:64
globjects
Contains all the classes that wrap OpenGL functionality.
globjects::ChangeListener
Allows listening to any Changeable.
Definition: ChangeListener.h:22
globjects::NamedString::m_name
std::string m_name
Definition: NamedString.h:61
globjects::NamedString::m_source
ref_ptr< AbstractStringSource > m_source
Definition: NamedString.h:63
globjects::Referenced
Superclass for all classes that use reference counting in globjects.
Definition: Referenced.h:22
ref_ptr.h
globjects::AbstractStringSource
Superclass for all types of static and dynamic strings, e.g. for the use as Shader code.
Definition: AbstractStringSource.h:25
globjects::Changeable
Superclass of all objects that want others to signal that they have changed.
Definition: Changeable.h:22
ChangeListener.h