Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / dbChangeMouse

Author
Message
i cant believe its not fabio
18
Years of Service
User Offline
Joined: 10th Feb 2006
Location:
Posted: 9th Jul 2007 20:40
I think i did things right, then again being new to programming i might have made some silly mistakes too...

I just can't seem to get the custom cursor to work. The cursor image is within the resource files. when i run the program it doesn't even show the cursor, it's just hidden as if i used the dbHideMouse command... which i obviously didn't...

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 9th Jul 2007 21:05
i recall dbp having an issue with the mouse cursor images, something like the index of the image array was off by one because the ide used "count" and the engine uses "index". Not sure if this is a related issue tho

My DBP plugins page is now hosted [href]here[/href]
i cant believe its not fabio
18
Years of Service
User Offline
Joined: 10th Feb 2006
Location:
Posted: 9th Jul 2007 21:11
so... Dark GDK inherited the same issue?

Is there any other way to display a custom cursor then?
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 9th Jul 2007 21:14
Make a few different images in a row, and play with the mouse command and sere if ANY of the images show. Then you might find a quirk (Which would break if this is actually a bug and ever fixed) Where you load TWO IMAGES, for your cursor, and the code seems to WORK on Imagwe 2 but actually Image one gets displayed.

I'd load 3 images in a row, and then play with it, make images look like #'s 1,2, and 3 so you know what's going on

Just a guess.

Jason

Know way too many languages - Master of none
i cant believe its not fabio
18
Years of Service
User Offline
Joined: 10th Feb 2006
Location:
Posted: 9th Jul 2007 23:50
i tried three different images but the result is the same, the cursor disappears completely, i can't even see the default windows cursor. I am thinking out loud here, but what if it's a problem with back/front buffer? Perhaps should i use some code to manipulate the buffer and make the cursor visible?
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 10th Jul 2007 00:49
Went over my head here. I don't know - or even have a guess. I DO KNOW that "GENERALLY" Speaking, in "Windows", that the mouse cursor can be set on a per "window" basis. I haven't done it other than with VB6, however I've seen enough API code to know you can change the "resource" (Same as a loaded image kinda) to control how the mouse looks.

It is also very possible that the way a mouse cursor is handled under DirectX or Specifically handled in DarkGDK/DBPro is way different. It could be like you said a No Z Buffer thingy - a sprite over (on top) everything else.

also - because DarkGDK "hides" the main loop from you - I think you'd have to get fancy by "learning" the HWND for the Game Window and then trying to use the Windows API somehow.

The SIMPLIST solution MIGHT be to simply make your own "Sprite" and Do your own ZBUFFER thing and hide the real mouse cursor - and position the sprite where the mouse cursor should be or where you think it should be from polling the mouse yourself. This needs to be in your main loop to work right - but could be the trick you need to move forward quick rather than writing a ton of tests on various API functions etc.

Good Luck.

Jason P Sage

Know way too many languages - Master of none
i cant believe its not fabio
18
Years of Service
User Offline
Joined: 10th Feb 2006
Location:
Posted: 11th Jul 2007 07:50
well... a tiny step forqward was made today:

The following code is responsible for the custom cursor to appear on the screen, problem is the cursor won't move!

This reminds me of a similar issue i had on CoolBasic where i had to find a work around to have the position of the mouse being followed by the custom cursor... i'll try to look for that thread if i can find it, meanwhile is there something else you guys might know that would help?



i cant believe its not fabio
18
Years of Service
User Offline
Joined: 10th Feb 2006
Location:
Posted: 11th Jul 2007 08:31
mmh... perhaps i should put in the wishlist a working version of dbChangeMouse? Why is it even there if all it does is making the mouse pointer disappear? lol
i cant believe its not fabio
18
Years of Service
User Offline
Joined: 10th Feb 2006
Location:
Posted: 11th Jul 2007 11:33
done!

I figured i needed a loop to keep the custom cursor refreshed so since i had the while loop available i thought i'd put the custom cursor code in there, dbChangeMouse still doesn't work (perhaps it needs other things?) but dbSprite does the trick!


jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 11th Jul 2007 13:29 Edited at: 11th Jul 2007 13:29
I don't THINK you need the HideMouse INSIDE the loop. I think once ought to do.

Know way too many languages - Master of none
i cant believe its not fabio
18
Years of Service
User Offline
Joined: 10th Feb 2006
Location:
Posted: 19th Jul 2007 04:02
ur rite, still learning here

Login to post a reply

Server time is: 2024-11-16 18:09:58
Your offset time is: 2024-11-16 18:09:58