Cursor setVisible

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
bobyBola
Posts: 28
Joined: Wed Jan 07, 2009 5:02 am
Location: Indonesia

Cursor setVisible

Post 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:
hai adik2 semua mari kita belajar sambil bermain bersama saya si BOBBY BOLA di edugames bermacam pelajaran bisa didapat ad berhitung menggambar mewarnai tidak ketinggalan dapat belajar nyanyi juga belajar huruf angka & logika bersama BOBBY BOLA semua bisa
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post 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.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
bobyBola
Posts: 28
Joined: Wed Jan 07, 2009 5:02 am
Location: Indonesia

Post 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
hai adik2 semua mari kita belajar sambil bermain bersama saya si BOBBY BOLA di edugames bermacam pelajaran bisa didapat ad berhitung menggambar mewarnai tidak ketinggalan dapat belajar nyanyi juga belajar huruf angka & logika bersama BOBBY BOLA semua bisa
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post 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?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Maybe just use the Irrlicht way, shown in example 6. Render an image at the mouse position with original cursor turned off.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post 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.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post 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.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post 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.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
bobyBola
Posts: 28
Joined: Wed Jan 07, 2009 5:02 am
Location: Indonesia

Post 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
hai adik2 semua mari kita belajar sambil bermain bersama saya si BOBBY BOLA di edugames bermacam pelajaran bisa didapat ad berhitung menggambar mewarnai tidak ketinggalan dapat belajar nyanyi juga belajar huruf angka & logika bersama BOBBY BOLA semua bisa
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post 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);
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post 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 ;).
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post 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
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Nice to head, but I'll wait for the 1.6.1 release ;)
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
bobyBola
Posts: 28
Joined: Wed Jan 07, 2009 5:02 am
Location: Indonesia

Post by bobyBola »

wow... thanks ^^
hai adik2 semua mari kita belajar sambil bermain bersama saya si BOBBY BOLA di edugames bermacam pelajaran bisa didapat ad berhitung menggambar mewarnai tidak ketinggalan dapat belajar nyanyi juga belajar huruf angka & logika bersama BOBBY BOLA semua bisa
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

by the way what you use to play video?
Post Reply