21template <
typename ReturnType,
typename... Arguments>
26 return reinterpret_cast<typename
glbinding::Function<ReturnType, Arguments...
>::Signature>(function->address())(std::forward<Arguments>(arguments)...);
34template <
typename... Arguments>
35struct BasicCallHelper<
glbinding::Boolean8, Arguments...>
45template <
typename ReturnType,
typename... Arguments>
61 if (function->beforeCallback())
63 function->beforeCallback()(std::forward<Arguments>(
arguments)...);
67 auto value = BasicCallHelper<ReturnType, Arguments ...>::call(function, std::forward<Arguments>(
arguments)...);
78 if (function->afterCallback())
80 function->afterCallback()(value, std::forward<Arguments>(
arguments)...);
110 if (function->beforeCallback())
112 function->beforeCallback()(std::forward<Arguments>(
arguments)...);
116 BasicCallHelper<void, Arguments ...>::call(function, std::forward<Arguments>(arguments)...);
122 if (function->afterCallback())
124 function->afterCallback()(std::forward<Arguments>(
arguments)...);
136template <
typename ReturnType,
typename... Arguments>
178 return BasicCallHelper<ReturnType, Arguments...>::call(
this, std::forward<Arguments>(
arguments)...);
182template <
typename ReturnType,
typename... Arguments>
185 if (address() ==
nullptr)
190 return BasicCallHelper<ReturnType, Arguments...>::call(
this, std::forward<Arguments>(
arguments)...);
202 m_beforeCallback =
nullptr;
208 m_afterCallback = std::move(
callback);
214 m_afterCallback =
nullptr;
220 return m_beforeCallback;
226 return m_afterCallback;
253 return m_states.at(
pos);
259 m_states.resize(
static_cast<std::size_t
>(
count));
The AbstractFunction represents an OpenGL API function by its name and entry point after dynamic addr...
Definition AbstractFunction.h:30
static void unresolved(const AbstractFunction *function)
Call unresolved callback.
static void before(const FunctionCall &call)
Call before callback.
static int currentPos()
Get index of current state.
static int maxPos()
Get highest state index currently used.
static void log(FunctionCall &&call)
Call log callback.
static void after(const FunctionCall &call)
Call after callback.
The State struct represents the configuration of a single OpenGL function for one thread....
Definition AbstractState.h:21
Boolean type based on an 8-bit integer.
Definition Boolean8.h:20
A FunctionCall represents a function call of an OpenGL API function, including the parameter and retu...
Definition FunctionCall.h:27
The Function represents an OpenGL API function with additional features.
Definition Function.h:78
void setAfterCallback(AfterCallback callback)
Register a callback that is triggered after a function call to the OpenGL driver.
Definition Function.inl:206
AfterCallback afterCallback() const
The accessor for the afterCallback.
Definition Function.inl:224
ReturnType operator()(Arguments &... arguments) const
Executes a function call on the resolved function pointer and passes the arguments.
Definition Function.inl:145
ReturnType call(Arguments &... arguments) const
Executes a function call on the resolved function pointer and passes the arguments.
Definition Function.inl:151
ReturnType directCall(Arguments... arguments) const
Executes a function call on the resolved function pointer and passes the arguments.
Definition Function.inl:183
typename CallbackType< ReturnType, Arguments... >::type AfterCallback
The callback type for the after callback.
Definition Function.h:84
virtual AbstractState & state() const override
Get current state.
Definition Function.inl:242
Function(const char *name)
Constructor.
Definition Function.inl:137
void setBeforeCallback(BeforeCallback callback)
Register a callback that is triggered before a function call to the OpenGL driver.
Definition Function.inl:194
void clearBeforeCallback()
Clears any previously registered before callback.
Definition Function.inl:200
void clearAfterCallback()
Clears any previously registered after callback.
Definition Function.inl:212
virtual void resizeStates(int count) override
Resize internal cache of states.
Definition Function.inl:257
BeforeCallback beforeCallback() const
The accessor for the beforeCallback.
Definition Function.inl:218
virtual bool hasState() const override
Checks for existence of the current configured state.
Definition Function.inl:230
typename CallbackType< void, Arguments... >::type BeforeCallback
The callback type for the before callback.
Definition Function.h:83
The Value class represents a printable wrapper around an OpenGL data type.
Definition Value.h:30
Contains all the classes of glbinding.
std::vector< std::unique_ptr< AbstractValue > > createValues(Arguments &&... arguments)
A wrapper around the creation of a vector of arguments.
Definition Value.inl:64
@ 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.
@ Before
Enables the before callbacks.
@ ReturnValue
Enables the provision of a return value in the after callback.
std::unique_ptr< AbstractValue > createValue(const Argument &argument)
A wrapper around the type deduction and memory allocation of a specific argument.
Definition Value.inl:58
Helper struct for calling GL functions and registered callbacks.
Definition Function.inl:47
static ReturnType call(const glbinding::Function< ReturnType, Arguments... > *function, Arguments &&... arguments)
Definition Function.inl:48