Keypress nightmare
Posted: Tue Oct 19, 2004 5:56 pm
I've been trying for days to get this simple code right "#$#%&#$%/&:
Here are declarations:
Here is on KeyInput event in wich I am trying to change varMove from true to false (but it's not working):
and here is setting camera and trying to increase variable varRotate based on state of varMove (wich is working except for commented line) :
Please help me because I am on the verge of nervous breakdown.
Here are declarations:
Code: Select all
bool varMove=true;
int varRotate=0;
Code: Select all
bool OnEvent(SEvent event){
if (event.EventType == EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown){
switch(event.KeyInput.Key){
case KEY_ESCAPE:
{
varMove = false;
return true;
}break;
}
}
return false;
}
Code: Select all
scene::ICameraSceneNode *camera = smgr->addCameraSceneNode(0, core::vector3df(0,0,0), core::vector3df(0,0,0));
driver->beginScene(true, true, video::SColor(0,200,200,200));
smgr->drawAll();
if (varMove==false){ //varMove isn't changing on escape press. Why?
varRotate+=1;
}
camera->setPosition(core::vector3df(varRotate,50,50));
driver->endScene();