I have a very small problem, I bet others would have already thought of a better solution to this, so I'll try my luck and post my problem. Sorry, this isn't Irrlicht related but I don't know where else I could post this so I posted it here.
Without much ado, here's the code (greatly condensed):
Code: Select all
namespace ykIrr
{
typedef int (*flowControlFunction)(ykIrr::tIrrlichtEngine, ykIrr::sceneClass, flowControl );
class flowControl
{
private:
typedef struct tState
{
flowControlFunction f; // function
} tState;
tState S;
public:
int addState( flowControlFunction f)
{
S.f = f;
return 1;
}
};
}
Code: Select all
typedef int (*flowControlFunction)(ykIrr::tIrrlichtEngine, ykIrr::sceneClass, flowControl );
Code: Select all
namespace Menu
{
int Main(ykIrr::tIrrlichtEngine I, ykIrr::sceneClass SC, ykIrr::flowControl )
{
//fC.setState("main");
return 1;
}
}
int main()
{
ykIrr::flowControl fC;
fC.addState( &Menu::Main );
}
Thanks and more power to everyone! ^_^ If what I've done (i.e. post this problem here) is wrong, please forgive me and kindly ignore or delete this topic.