Page 1 of 1

Cursor setVisible

Posted: Wed Dec 09, 2009 2:54 am
by bobyBola
i'm useing irrlicht 1.6 version... sometimes when i call

Code: Select all

device->getCursorControl()->setVisible(true);
the cursor won't show up, how can i make sure that when i call getCursorControl()->setVisible(true) the cursor will show up??

does this has effect with the code i use to change my cursor image that cause the cursor sometimes won't show up???

Code: Select all

HCURSOR hCursor1 = LoadCursorFromFile("cure1.ani");
HWND hwnd = reinterpret_cast<HWND>(device->getVideoDriver()->getExposedVideoData().D3D9.HWnd);
SetClassLong(hwnd,GCL_HCURSOR,(LONG) hCursor1);
sorry for my bad english~ :oops:

Posted: Wed Dec 09, 2009 3:14 am
by CuteAlien
As long as it finds the cursor I suppost it shouldn't affect this.
Can you post an example with which I can reproduce the problem?
Otherwise it will be difficult to help.

Posted: Wed Dec 09, 2009 7:03 am
by bobyBola
at first, i set the cursor invisible because i wanna display the movie

Image

after finish the movie, the game enter to main main menu and i set the cursor visible.. the cursor is show up but sometimes it isn't ( close the program and run again for several times )

Image

Image

Posted: Wed Dec 09, 2009 7:20 am
by CuteAlien
Your screenshots are very nice. Unfortunately I don't think they help me to find that problem.

I need to have some code to reproduce this. I can start coding an example using LoadCursorFromFile and try to figure out if this affects visibility in some way, but as you can already reproduce the problem it should be a lot less work for you to write such an example so I can just run and test it. Also you might do a lot of other stuff which could be the problem and I can never know about that.

Can you do that?

Posted: Wed Dec 09, 2009 8:11 am
by hybrid
Maybe just use the Irrlicht way, shown in example 6. Render an image at the mouse position with original cursor turned off.

Posted: Wed Dec 09, 2009 8:20 am
by CuteAlien
hybrid wrote:Maybe just use the Irrlicht way, shown in example 6. Render an image at the mouse position with original cursor turned off.
Works somewhat, but limits the cursor to the framerate, so that should rather be avoided usually.

Posted: Wed Dec 09, 2009 10:59 am
by Brainsaw
In my current project I hide and show the cursor, depending on the current state of the program (hidden in main menu, game, visible in options, game setup...). I realized that hiding the cursor works fine, but if I want to make it visible again it only is shown if the cursor was in the application's window when the application's state is changed. Maybe this information can help you.

Posted: Wed Dec 09, 2009 6:54 pm
by CuteAlien
Brainsaw wrote:In my current project I hide and show the cursor, depending on the current state of the program (hidden in main menu, game, visible in options, game setup...). I realized that hiding the cursor works fine, but if I want to make it visible again it only is shown if the cursor was in the application's window when the application's state is changed. Maybe this information can help you.
Oh wow - yes, that does help to know. I will have to check that next weekend.

Posted: Thu Dec 10, 2009 2:22 am
by bobyBola
Brainsaw wrote:In my current project I hide and show the cursor, depending on the current state of the program (hidden in main menu, game, visible in options, game setup...). I realized that hiding the cursor works fine, but if I want to make it visible again it only is shown if the cursor was in the application's window when the application's state is changed. Maybe this information can help you.
yes, i thinks that's the problem.. thanks for the information, the solution i have right now is set the application window into fullscreen >.<

oh, and here a simple program to test the mouse cursor~


http://www.mediafire.com/?yzr4mtynoyk

Posted: Thu Dec 10, 2009 5:24 am
by Lonesome Ducky
If you don't have a problem using windows.h, you can always fall back on the mighty

Code: Select all

ShowCursor(true);
EDIT: Yep, I just tested it out in the sample code you provided, and the problem seems to have been fixed with ShowCursor(true);

Posted: Thu Dec 10, 2009 6:33 am
by Brainsaw
OK, that would be a solution, but I want to keep windows API out of my program, maybe I'll port it to another OS some time far in the future ;).

Posted: Sun Dec 13, 2009 5:42 am
by CuteAlien
Sometimes the Win32 API can be a real #ยง$%&$% ...

It is fixed now in the 1.6 branch of Irrlicht and should be in the 1.6.1 release. The fix in the svn trunk will follow on next merge.

In case you're interested in the patch: http://irrlicht.svn.sourceforge.net/vie ... ision=3050

Posted: Sun Dec 13, 2009 10:33 am
by Brainsaw
Nice to head, but I'll wait for the 1.6.1 release ;)

Posted: Mon Dec 14, 2009 9:22 am
by bobyBola
wow... thanks ^^

Posted: Mon Dec 14, 2009 11:15 am
by Virion
by the way what you use to play video?