I've been a games programmer for several years, but using C rather than C++. I know this question is due to lack of C++ knowledge rather than anything wrong with GapiDraw, but it's driving me mad:
I have a drawing function/method (PlotCard) for a game. It needs to go inside the CMyApplication class so as to have access to protected variables and methods. However, I can't access that function from outside the class directly from my C code (because it's not a member of the global name space)and I can't call it by a call to myapp.PlotCard because myapp isn't a global variable (and I don't see how you *can* have a global instance of an object because it has to be constructed at runtime).
I suppose I *could* dump all my game code into the CMyApplication object (or make a dummy 'friend' object)... but that seems really over the top. All I want is some way for my C functions to access the GapiDraw drawing functions from outside the CMyApplication object, or of calling a method within that object.
I know my problem comes from lack of C++ knowledge. But I would appreciate any help.
Cheers,
Tom