globjects  1.0.0.000000000000
Strict OpenGL objects wrapper.
Loading...
Searching...
No Matches
NamedString.h
Go to the documentation of this file.
1
2#pragma once
3
4#include <string>
5
6#include <glbinding/gl/types.h>
7
11
12#include <globjects/globjects_api.h>
13
14
15namespace globjects
16{
17
18
19class AbstractStringSource;
20
21class GLOBJECTS_API NamedString : public Referenced, protected ChangeListener
22{
23public:
24 static NamedString * create(const std::string & name, AbstractStringSource * string);
25 static NamedString * create(const std::string & name, const std::string & string);
26
27 static bool isNamedString(const std::string & name);
28 static NamedString * obtain(const std::string & name);
29
30public:
31 const std::string & name() const;
32 std::string string() const;
33 gl::GLenum type() const;
34
36
37 gl::GLint getParameter(gl::GLenum pname) const;
38
39 virtual void notifyChanged(const Changeable * changeable) override;
40
41protected:
42 static bool hasNativeSupport();
43
44 static NamedString * create(const std::string & name, AbstractStringSource * string, gl::GLenum type);
45 static NamedString * create(const std::string & name, const std::string & string, gl::GLenum type);
46
47protected:
49
52
53 NamedString(const std::string & name, AbstractStringSource * source, gl::GLenum type);
54
55 virtual ~NamedString();
56
59
60protected:
61 std::string m_name;
62
64 gl::GLenum m_type;
65};
66
67
68} // namespace globjects
Superclass for all types of static and dynamic strings, e.g. for the use as Shader code.
Definition AbstractStringSource.h:26
Allows listening to any Changeable.
Definition ChangeListener.h:23
Superclass of all objects that want others to signal that they have changed.
Definition Changeable.h:23
Definition NamedString.h:22
const std::string & name() const
static NamedString * create(const std::string &name, AbstractStringSource *string, gl::GLenum type)
std::string string() const
static NamedString * create(const std::string &name, const std::string &string)
gl::GLenum m_type
Definition NamedString.h:64
static NamedString * obtain(const std::string &name)
gl::GLint getParameter(gl::GLenum pname) const
gl::GLenum type() const
static bool hasNativeSupport()
static NamedString * create(const std::string &name, AbstractStringSource *string)
NamedString(const std::string &name, AbstractStringSource *source, gl::GLenum type)
ref_ptr< AbstractStringSource > m_source
Definition NamedString.h:63
std::string m_name
Definition NamedString.h:61
virtual void notifyChanged(const Changeable *changeable) override
static bool isNamedString(const std::string &name)
AbstractStringSource * stringSource() const
static NamedString * create(const std::string &name, const std::string &string, gl::GLenum type)
Superclass for all classes that use reference counting in globjects.
Definition Referenced.h:23
The ref_ptr class provides the interface for a reference pointer.
Definition ref_ptr.h:33
Contains all the classes that wrap OpenGL functionality.