Alex Chan wrote:
>I do not know how to communicate my instance object when an operation is complete since upSL takes in a function pointer and not a members function pointer. The only thing I can think of is to use a static variable to communicate between the C callbacks and my instance members, but I don’t think that is a very good idea. Anyone have any thoughts?
Hello, as author of upSL i can say that we use static variables(Singleton pattern or global variable, not so important). Btw, on Blackberry Scorelooop have C-style API
For example Achievements callback can be:
void LoadAchievementsComplete(int error_code)
if (error_code == ErrorCode::Ok)
AchievementManager::Instance()->AchievementsLoaded(); // store something important for game logic, displays notification, etc.
AchievementsLayer* achievements_layer = AchievementManager::Instance();
if (achievements_layer) // if user currently have opened "Achievements" screen opened
I have only wish have void* pointer to controller in all callbacks. Will look how make it if i have enough time.