glbinding  3.3.0.0
A C++ binding for the OpenGL API, generated using the gl.xml specification.
Loading...
Searching...
No Matches
glbinding.h
Go to the documentation of this file.
1
2#pragma once
3
4
5#include <set>
6#include <string>
7#include <vector>
8#include <functional>
9
10#include <glbinding/glbinding_api.h>
11#include <glbinding/glbinding_features.h>
12
16
17
18namespace glbinding
19{
20
21
22class AbstractFunction;
23class FunctionCall;
24
25
26using SimpleFunctionCallback = std::function<void(const AbstractFunction &)>;
27using FunctionCallback = std::function<void(const FunctionCall &)>;
28using FunctionLogCallback = std::function<void(FunctionCall *)>;
29using ContextSwitchCallback = std::function<void(ContextHandle)>;
30
61GLBINDING_API void initialize(glbinding::GetProcAddress functionPointerResolver, bool resolveFunctions = true);
62
80GLBINDING_API void initialize(ContextHandle context, glbinding::GetProcAddress functionPointerResolver, bool useContext = true, bool resolveFunctions = true);
81
89GLBINDING_API void useCurrentContext();
90
98GLBINDING_API void useContext(ContextHandle context);
99
107GLBINDING_API void releaseCurrentContext();
108
116GLBINDING_API void releaseContext(ContextHandle context);
117
128GLBINDING_API void registerAdditionalFunction(AbstractFunction * function);
129
137GLBINDING_API ProcAddress resolveFunction(const char * name);
138
143GLBINDING_API void resolveFunctions();
144
152GLBINDING_API void setCallbackMask(CallbackMask mask);
153
163GLBINDING_API void setCallbackMaskExcept(CallbackMask mask, const std::set<std::string> & blackList);
164
172GLBINDING_API void addCallbackMask(CallbackMask mask);
173
183GLBINDING_API void addCallbackMaskExcept(CallbackMask mask, const std::set<std::string> & blackList);
184
192GLBINDING_API void removeCallbackMask(CallbackMask mask);
193
203GLBINDING_API void removeCallbackMaskExcept(CallbackMask mask, const std::set<std::string> & blackList);
204
216
231
243
257GLBINDING_API void setBeforeCallback(FunctionCallback callback);
258
270
284GLBINDING_API void setAfterCallback(FunctionCallback callback);
285
297
311GLBINDING_API void setLogCallback(FunctionLogCallback callback);
312
321
322
323} // namespace glbinding
The AbstractFunction represents an OpenGL API function by its name and entry point after dynamic addr...
Definition AbstractFunction.h:30
A FunctionCall represents a function call of an OpenGL API function, including the parameter and retu...
Definition FunctionCall.h:27
Contains all the classes of glbinding.
void addCallbackMask(CallbackMask mask)
Updates the callback mask of all registered OpenGL functions in the current state to include the pass...
void useCurrentContext()
Update the current context state in glbinding.
void setAfterCallback(FunctionCallback callback)
Updates the after callback that is called after the actual OpenGL function invocation.
void releaseCurrentContext()
Removes the current context from the state of glbinding.
std::function< void(const FunctionCall &)> FunctionCallback
The signature of the before and after callbacks.
Definition glbinding.h:27
std::function< void(const AbstractFunction &)> SimpleFunctionCallback
The signature of the unresolved callback.
Definition glbinding.h:26
std::function< ProcAddress(const char *)> GetProcAddress
The signature for the getProcAddress function.
Definition ProcAddress.h:24
void releaseContext(ContextHandle context)
Removes the current context from the state of glbinding.
void addCallbackMaskExcept(CallbackMask mask, const std::set< std::string > &blackList)
Updates the callback mask of all registered OpenGL functions in the current state to include the pass...
void useContext(ContextHandle context)
Update the current context state in glbinding.
void initialize(glbinding::GetProcAddress functionPointerResolver, bool resolveFunctions=true)
Initializes the binding for the current active OpenGL context.
std::function< void(FunctionCall *)> FunctionLogCallback
The signature of the log callback.
Definition glbinding.h:28
void resolveFunctions()
Resolves the funtion pointers of all registered OpenGL functions immediately for the current context.
void removeCallbackMask(CallbackMask mask)
Updates the callback mask of all registered OpenGL functions in the current state to exclude the pass...
void addContextSwitchCallback(ContextSwitchCallback callback)
Registers an additional callback that gets called each time the context is switched using the useCont...
ProcAddress resolveFunction(const char *name)
Resolve a single function pointer by given name.
long long int ContextHandle
Type for storing context handles.
Definition ContextHandle.h:9
void setBeforeCallback(FunctionCallback callback)
Updates the before callback that is called before the actual OpenGL function invocation.
FunctionCallback afterCallback()
After callback accessor.
void registerAdditionalFunction(AbstractFunction *function)
Registers an additional function for the additional features.
void setLogCallback(FunctionLogCallback callback)
Updates the logging callback that is called to log the actual OpenGL function invocation.
void setCallbackMaskExcept(CallbackMask mask, const std::set< std::string > &blackList)
Updates the callback mask of all registered OpenGL functions in the current state,...
FunctionCallback beforeCallback()
Before callback accessor.
void setCallbackMask(CallbackMask mask)
Updates the callback mask of all registered OpenGL functions in the current state.
FunctionLogCallback logCallback()
Logging callback accessor.
std::function< void(ContextHandle)> ContextSwitchCallback
The signature of the context switch callback.
Definition glbinding.h:29
SimpleFunctionCallback unresolvedCallback()
Unresolved callback accessor.
void setUnresolvedCallback(SimpleFunctionCallback callback)
Updates the unresolved callback that is called upon invocation of an OpenGL function which have no co...
void(*)() ProcAddress
The generic pointer to a function.
Definition ProcAddress.h:18
CallbackMask
The CallbackMask is a bitfield to encode the states of callbacks for the OpenGL API function calls.
Definition CallbackMask.h:18
void removeCallbackMaskExcept(CallbackMask mask, const std::set< std::string > &blackList)
Updates the callback mask of all registered OpenGL functions in the current state to exclude the pass...