okay.. so i'm sort of making this game (not really.. it's mostly just to get the hang of allegro). i've got a class 'player' (first class i've done in C++, though i've used them in java before, so i get the idea). i need to use a timer for some stuff, but i'm having trouble with it.. here's some code.
in player.h:
Code:
#ifndef PLAYER_H
#define PLAYER_H
class player
{
public:
//public stuff
private:
//bunch of private stuff
int count; //for use with timer
//private functions
void countUp(); //to increment count
void setup(); //to set stuff up
};
#endif
okay.. so far so good (i think/hope).
so here's some of the player.cpp (namely setup() and countUp())
Code:
void player::setup()
{
allegro_init();
install_timer();
install_int_ex(countUp, BPS_TO_TIMER(100));
}
void player::countUp()
{
++count;
}
i got rid of the stuff i didn't think was relavent.
so here's the problem.. when i try to compile it, i get this:
Code:
C:\Development\C\game\player.cpp(36) : error C2664: 'install_int_ex' : cannot convert parameter 1 from 'void (void)' to 'void (__cdecl *)(void)'
None of the functions with this name in scope match the target type
any ideas? i've tried putting player::countUp in the install_int_ex, changing variables/functions to public, among other things, but nothing seems to work.
help is appreciated.
btw, i've gotten a timer like this to work before.. just not in a class i made myself.