hmm, you're right, it's prety strange...
I made a small test prog:
Code: Select all
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
bool mouseDownL;
class MyEventReceiver : public IEventReceiver{
public:
virtual bool OnEvent(const SEvent& event){
if (event.EventType == EET_MOUSE_INPUT_EVENT){
if(event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN){
printf("1\n");
mouseDownL = true;
return false; // doesn't matter is I return true or false
}
if(event.MouseInput.Event == EMIE_LMOUSE_LEFT_UP){
printf("2\n");
mouseDownL = false;
return false; // doesn't matter is I return true or false
}
}
return false;
}
};
int main(){
MyEventReceiver recv;
IrrlichtDevice *device = createDevice(EDT_DIRECT3D9, dimension2d<s32>(640, 480), 16, false, false, false, &recv);
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
while(device->run()){
driver->beginScene(true, true, video::SColor(0,0,0,0));
smgr->drawAll();
driver->endScene();
device->getCursorControl()->setVisible(!mouseDownL);
}
device->drop();
return 0;
}
what happens is: when you press the left mouse button "1" is printed to the console, but the cursor doesn't hide...
when you left the button up "2" is printed and the cursor hides until you move the mouse, then the cursor is shown again...
that's
realy strange !!!