15template <
typename ReturnType,
typename... Arguments>
21 return reinterpret_cast<typename
glbinding::Function<ReturnType, Arguments...
>::Signature>(function->
address())(std::forward<Arguments>(arguments)...);
28template <
typename... Arguments>
29struct BasicCallHelper<
gl::GLboolean, Arguments...>
33 return reinterpret_cast<typename
glbinding::Function<gl::GLboolean::underlying_type, Arguments...
>::Signature>(function->
address())(std::forward<Arguments>(arguments)...);
38template <
typename ReturnType,
typename... Arguments>
52 function->
before(*functionCall);
60 auto value = BasicCallHelper<ReturnType, Arguments ...>::call(function, std::forward<Arguments>(arguments)...);
69 function->
after(*functionCall);
73 function->
afterCallback()(value, std::forward<Arguments>(arguments)...);
87template <
typename... Arguments>
88struct FunctionHelper<void, Arguments...>
101 function->
before(*functionCall);
105 function->
beforeCallback()(std::forward<Arguments>(arguments)...);
109 BasicCallHelper<void, Arguments ...>::call(function, std::forward<Arguments>(arguments)...);
113 function->
after(*functionCall);
117 function->
afterCallback()(std::forward<Arguments>(arguments)...);
137template <
typename ReturnType,
typename... Arguments>
140, m_beforeCallback{nullptr}
141, m_afterCallback{nullptr}
145template <
typename ReturnType,
typename... Arguments>
148 return call(arguments...);
151template <
typename ReturnType,
typename... Arguments>
154 const auto myAddress = address();
156 if (myAddress ==
nullptr)
168 return FunctionHelper<ReturnType, Arguments...>().call(
this, std::forward<Arguments>(arguments)...);
172 return BasicCallHelper<ReturnType, Arguments...>::call(
this, std::forward<Arguments>(arguments)...);
176template <
typename ReturnType,
typename... Arguments>
179 return BasicCallHelper<ReturnType, Arguments...>::call(
this, std::forward<Arguments>(arguments)...);
182template <
typename ReturnType,
typename... Arguments>
185 m_beforeCallback = std::move(callback);
188template <
typename ReturnType,
typename... Arguments>
191 m_beforeCallback =
nullptr;
194template <
typename ReturnType,
typename... Arguments>
197 m_afterCallback = std::move(callback);
200template <
typename ReturnType,
typename... Arguments>
203 m_afterCallback =
nullptr;
206template <
typename ReturnType,
typename... Arguments>
209 return m_beforeCallback;
212template <
typename ReturnType,
typename... Arguments>
215 return m_afterCallback;
The AbstractFunction represents an OpenGL API function.
Definition AbstractFunction.h:24
bool isAnyEnabled(CallbackMask mask) const
Check if any bit of the parameter is set in the currently configured callback mask of the current sta...
ProcAddress address() const
Function pointer accessor.
void before(const FunctionCall &call) const
Triggers a call of the before callback, passing the parameters.
bool isEnabled(CallbackMask mask) const
Check if all bits of the parameter are set in the currently configured callback mask of the current s...
void after(const FunctionCall &call) const
Triggers a call of the after callback, passing the parameters and return value.
The Function represents an OpenGL API function with additional features, including:
Definition Function.h:63
void setAfterCallback(AfterCallback callback)
Register a callback that is triggered after a function call to the OpenGL driver.
Definition Function.inl:195
AfterCallback afterCallback() const
The accessor for the afterCallback.
Definition Function.inl:213
ReturnType operator()(Arguments &... arguments) const
Executes a function call on the resolved function pointer and passes the arguments.
Definition Function.inl:146
ReturnType call(Arguments &... arguments) const
Executes a function call on the resolved function pointer and passes the arguments.
Definition Function.inl:152
ReturnType directCall(Arguments... arguments) const
Executes a function call on the resolved function pointer and passes the arguments.
Definition Function.inl:177
typename CallbackType< ReturnType, Arguments... >::type AfterCallback
The callback type for the after callback.
Definition Function.h:68
Function(const char *name)
Constructor.
Definition Function.inl:138
void setBeforeCallback(BeforeCallback callback)
Register a callback that is triggered before a function call to the OpenGL driver.
Definition Function.inl:183
void clearBeforeCallback()
Clears any previously registered before callback.
Definition Function.inl:189
void clearAfterCallback()
Clears any previously registered after callback.
Definition Function.inl:201
BeforeCallback beforeCallback() const
The accessor for the beforeCallback.
Definition Function.inl:207
typename CallbackType< void, Arguments... >::type BeforeCallback
The callback type for the before callback.
Definition Function.h:67
Definition ContextInfo.h:11
GLBINDING_API void log(LogEntry call)
Add a function call to the log.
Contains all the classes of glbinding.
std::vector< AbstractValue * > createValues(Arguments &&... arguments)
A wrapper around the creation of a vector of arguments.
Definition Value.inl:66
AbstractValue * createValue(const Argument &argument)
A wrapper around the type deduction and memory allocation of a specific argument.
Definition Value.inl:60
@ Parameters
Enables the provision of parameter values in the before and after callbacks.
@ Unresolved
Enables the callback for unresolved function calls.
@ After
Enables the after callbacks.
@ Logging
Enables logging to file.
@ Before
Enables the before callbacks.
@ ReturnValue
Enables the provision of a return value in the after callback.
A FunctionCall represents a function call of an OpenGL API function, including the parameter and retu...
Definition FunctionCall.h:23
std::vector< AbstractValue * > parameters
The list of parameter values; doesn't have to be filled.
Definition FunctionCall.h:83