Hourglass cursor problem

Started by
3 comments, last by LiquidLasse 17 years, 9 months ago
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.
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,
if (*pYou == ASSHOLE) { pYou->Die(); delete pYou; };
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.

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

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.
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 );

This topic is closed to new replies.

Advertisement