globjects  2.0.0.690708773bba
Strict OpenGL objects wrapper.
globjects.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <string>
5 #include <array>
6 #include <set>
7 
8 #include <glbinding/gl/types.h>
9 
10 #include <glbinding/ContextHandle.h>
11 
12 #include <globjects/globjects_api.h>
13 
15 #include <globjects/Buffer.h>
16 #include <globjects/Framebuffer.h>
17 #include <globjects/DebugMessage.h>
18 #include <globjects/Program.h>
19 #include <globjects/Shader.h>
20 #include <globjects/Object.h>
21 #include <globjects/VertexArray.h>
22 
23 
24 namespace glbinding
25 {
26 
27 
28 class Version;
29 
30 
31 } // namespace glbinding
32 
33 
34 namespace globjects
35 {
36 
37 
38 GLOBJECTS_API void init();
39 GLOBJECTS_API void init(glbinding::ContextHandle sharedContextId);
40 
46 GLOBJECTS_API void detachAllObjects();
47 
48 template <typename T, typename... Args>
49 void init(T strategy, Args... args);
50 
51 template <typename T, typename... Args>
52 void init(glbinding::ContextHandle sharedContextId, T strategy, Args... args);
53 
54 GLOBJECTS_API void registerCurrentContext();
55 GLOBJECTS_API void registerCurrentContext(glbinding::ContextHandle sharedContextId);
56 GLOBJECTS_API void setContext(glbinding::ContextHandle contextId);
57 GLOBJECTS_API void setCurrentContext();
58 
59 GLOBJECTS_API std::string getString(gl::GLenum pname);
60 GLOBJECTS_API std::string getString(gl::GLenum pname, gl::GLuint index);
61 
62 GLOBJECTS_API gl::GLint getInteger(gl::GLenum pname);
63 GLOBJECTS_API gl::GLenum getEnum(gl::GLenum pname);
64 GLOBJECTS_API gl::GLfloat getFloat(gl::GLenum pname);
65 GLOBJECTS_API gl::GLdouble getDouble(gl::GLenum pname);
66 GLOBJECTS_API gl::GLboolean getBoolean(gl::GLenum pname);
67 
68 GLOBJECTS_API gl::GLint getInteger(gl::GLenum pname, gl::GLuint index);
69 GLOBJECTS_API gl::GLenum getEnum(gl::GLenum pname, gl::GLuint index);
70 GLOBJECTS_API gl::GLfloat getFloat(gl::GLenum pname, gl::GLuint index);
71 GLOBJECTS_API gl::GLdouble getDouble(gl::GLenum pname, gl::GLuint index);
72 GLOBJECTS_API gl::GLboolean getBoolean(gl::GLenum pname, gl::GLuint index);
73 
74 GLOBJECTS_API std::string vendor();
75 GLOBJECTS_API std::string renderer();
76 GLOBJECTS_API std::string versionString();
77 GLOBJECTS_API glbinding::Version version();
78 GLOBJECTS_API bool isCoreProfile();
79 
80 template <int Count>
81 std::array<gl::GLint, Count> getIntegers(gl::GLenum pname);
82 template <int Count>
83 std::array<gl::GLenum, Count> getEnums(gl::GLenum pname);
84 template <int Count>
85 std::array<gl::GLfloat, Count> getFloats(gl::GLenum pname);
86 template <int Count>
87 std::array<gl::GLdouble, Count> getDoubles(gl::GLenum pname);
88 template <int Count>
89 std::array<gl::GLboolean, Count> getBooleans(gl::GLenum pname);
90 
91 GLOBJECTS_API const std::set<gl::GLextension> & availableExtensions();
92 GLOBJECTS_API const std::set<std::string> & unknownAvailableExtensions();
93 
94 GLOBJECTS_API bool hasExtension(gl::GLextension extension);
95 GLOBJECTS_API bool hasExtension(const std::string & extensionName);
96 GLOBJECTS_API bool isInCoreProfile(gl::GLextension extension, const glbinding::Version & version);
97 GLOBJECTS_API bool isInCoreProfile(gl::GLextension extension);
98 
99 GLOBJECTS_API void enable(gl::GLenum capability);
100 GLOBJECTS_API void disable(gl::GLenum capability);
101 GLOBJECTS_API bool isEnabled(gl::GLenum capability);
102 GLOBJECTS_API void setEnabled(gl::GLenum capability, bool enabled);
103 GLOBJECTS_API void enable(gl::GLenum capability, int index);
104 GLOBJECTS_API void disable(gl::GLenum capability, int index);
105 GLOBJECTS_API bool isEnabled(gl::GLenum capability, int index);
106 GLOBJECTS_API void setEnabled(gl::GLenum capability, int index, bool enabled);
107 
108 GLOBJECTS_API void initializeStrategy(AbstractUniform::BindlessImplementation impl);
109 GLOBJECTS_API void initializeStrategy(Buffer::BindlessImplementation impl);
110 GLOBJECTS_API void initializeStrategy(Framebuffer::BindlessImplementation impl);
111 GLOBJECTS_API void initializeStrategy(DebugMessage::Implementation impl);
112 GLOBJECTS_API void initializeStrategy(Program::BinaryImplementation impl);
113 GLOBJECTS_API void initializeStrategy(Shader::IncludeImplementation impl);
114 GLOBJECTS_API void initializeStrategy(Object::NameImplementation impl);
115 GLOBJECTS_API void initializeStrategy(VertexArray::AttributeImplementation impl);
116 
117 
118 } // namespace globjects
119 
120 
121 #include <globjects/globjects.inl>
std::array< gl::GLdouble, Count > getDoubles(gl::GLenum pname)
Definition: glbindinglogging.h:11
GLOBJECTS_API gl::GLboolean getBoolean(gl::GLenum pname, gl::GLuint index)
GLOBJECTS_API std::string getString(gl::GLenum pname, gl::GLuint index)
GLOBJECTS_API void setContext(glbinding::ContextHandle contextId)
GLOBJECTS_API bool isInCoreProfile(gl::GLextension extension)
GLOBJECTS_API gl::GLenum getEnum(gl::GLenum pname, gl::GLuint index)
GLOBJECTS_API bool isCoreProfile()
Contains all the classes that wrap OpenGL functionality.
std::array< gl::GLfloat, Count > getFloats(gl::GLenum pname)
GLOBJECTS_API gl::GLfloat getFloat(gl::GLenum pname, gl::GLuint index)
GLOBJECTS_API std::string versionString()
GLOBJECTS_API bool isEnabled(gl::GLenum capability, int index)
void init(glbinding::ContextHandle sharedContextId, T strategy, Args...args)
GLOBJECTS_API void disable(gl::GLenum capability, int index)
GLOBJECTS_API void enable(gl::GLenum capability, int index)
GLOBJECTS_API gl::GLint getInteger(gl::GLenum pname, gl::GLuint index)
GLOBJECTS_API void setEnabled(gl::GLenum capability, int index, bool enabled)
GLOBJECTS_API std::string vendor()
std::array< gl::GLboolean, Count > getBooleans(gl::GLenum pname)
GLOBJECTS_API std::string renderer()
GLOBJECTS_API void registerCurrentContext(glbinding::ContextHandle sharedContextId)
GLOBJECTS_API const std::set< gl::GLextension > & availableExtensions()
GLOBJECTS_API gl::GLdouble getDouble(gl::GLenum pname, gl::GLuint index)
std::array< gl::GLint, Count > getIntegers(gl::GLenum pname)
GLOBJECTS_API const std::set< std::string > & unknownAvailableExtensions()
GLOBJECTS_API glbinding::Version version()
GLOBJECTS_API bool hasExtension(const std::string &extensionName)
GLOBJECTS_API void initializeStrategy(VertexArray::AttributeImplementation impl)
GLOBJECTS_API void setCurrentContext()
std::array< gl::GLenum, Count > getEnums(gl::GLenum pname)
GLOBJECTS_API void detachAllObjects()
calls detach on every registered object