Jump to content
  • Advertisement
Sign in to follow this  
limpacp

Hourglass cursor problem

This topic is 4462 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I'm not sure it's a directx problem, but anyway... When my game is running in windowed mode (directx 7), the cursor sometimes turns to hourglass. QA says that I need to fix it, but i don't know how. I'm using next line in the WNDCLASSEX: wcex.hCursor = (HCURSOR)LoadImage(NULL,MAKEINTRESOURCE(IDC_ARROW), IMAGE_CURSOR,0,0,LR_SHARED); I'm not sure if it happens in fullscreen mode, but for windowed mode it happens for sure. Please help.

Share this post


Link to post
Share on other sites
Advertisement
Do you use an tight loop??
If you do try calling sleep(0) somewhere in your
game loop to give windows an change to update some other apps that
might give you the hourglass.

Tjaalie,

Share this post


Link to post
Share on other sites
Are you correctly translating and dispatching all windows messages?

Mind, if you use PeekMessage do it inside a second inner while loop. Process ALL windows messages from the queue before doing the game loop.

Share this post


Link to post
Share on other sites
There is no Sleep(0) in the game loop. But i need to find a way to make a static cursor, that will not turn to any others, like hourglass or smt.

Share this post


Link to post
Share on other sites
I think you will need to handle the WM_SETCURSOR - message. This gets called each time windows thinks it time to update the cursor.. (when it's over your app's windows and it is in focus at least).

If you are using directx cursor you might need to reset it to the one you want when you handle that message. I'm not sure about directx7 but in DX9 it would be something like:

HRESULT res = m_pDevice->SetCursorProperties(Hotspot.X,
Hotspot.y,
pYourSurface);
res = m_pDevice->ShowCursor( true );

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!