quick help with non static callback
hi im using the following code to demo a callback:
how can i change the function _renderCallback to become non static?
thanks.
Code:
#include <iostream>
using namespace std;
class MyClass
{
public:
MyClass()
{}
~MyClass() {}
static void _renderCallback(void)
{
cout << "You clicked." << std::endl;
}
};
//------------------------------------------------
typedef void(*t_CallBackFunction)() ;
t_CallBackFunction theCallbackFunc ;
void callback_registration_function( t_CallBackFunction func )
{
theCallbackFunc = func ;
}
void trigger_callback()
{
theCallbackFunc();
}
//------------------------------------------------
int main ()
{
MyClass obj ;
callback_registration_function( MyClass::_renderCallback ) ;
trigger_callback() ;
return 0;
}