Archived

This topic is now archived and is closed to further replies.

Jesava

DirectX with Win32 Dialog

Recommended Posts

Hi! I''m trying to make a Direct3D program that renders in a Dialog picture control. But I have a problem with the when-to-render part This is what i''m doing in my dialogs message proc. Some of the code is replaced by comments so it doesnt get so long. { // Get all the dialog items window handles. switch (message) { case WM_INITDIALOG: InitDirectX(); return(TRUE); case WM_COMMAND: switch (LOWORD(wparam)) { // Check button clicks etc etc } return(TRUE); case WM_PAINT: Render(); return(TRUE); } return(FALSE); } The problem occurs when I move the mouse over the dialog window. Then the rendering slows down and the mouse pointer starts to flicker like hell. My question is: How do i fix this? Thanks!

Share this post


Link to post
Share on other sites
Maybe you should do something like this:

1. Just make the cursor disappear when the application starts (ShowCursor(false)) and make it visible again when the application leaves.
2. Maybe you should just follow the mouse, and when it enters the client window, pause the game.

Something like this:

  
POINT pPoint; // The cursor position

GetPointerPos(&pPoint); // Where is the mouse


// Now use GetClientRect() to get the window position and compare it to the position of the mouse...



Or you could use one of the messages generated by the mouse to follow it.



- Goblineye Entertainment
The road to success is always under construction

Share this post


Link to post
Share on other sites