🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

DDraw

Started by
1 comment, last by Spur 24 years, 5 months ago
OK, here is something that may be simple, but I don''t know how to fix it. When I initialize DirectDraw object and DDPrimarysurface and DDBackSurface it is all OK. Then I put some bitmaps on both surfaces. Now the problem: when I flip on DDBackSurface it is ok, when I am on DDPrimarySurface every move of the mouse makes mouse pointers visible, any thing Windows updates is drawn over my bitmaps(only on Primary Surface). How do you fix that? I have exclusive mode. After initialization is back surface blank, primary surface contains windows crap(desktop, delphi....). How do you make primary surface blank like back surface after initializing?
Advertisement
The problem here is that the mouse is concidered by Windows to be a topmost object. But it is easily fised. You need to tell Windows to hide the cursor when you start your program and to show the cursor when you exit. This can easily be done in your main window procedure. Here''s some code...

LRESULT CALLBACK WindowProcedure(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{

// Catch Any Messages We Want To Handle
switch(uMsg)
{

case WM_CREATE:

// Hide Our Mouse
ShowCursor(FALSE);
return 0;

break;

case WM_DESTROY:

// Show Our Mouse
ShowCursor(TRUE);

// We Have To Post The WM_QUIT Message Ourselves
PostQuitMessage(0);
return 0;

break;

} // End Of Switch

// Allow Windows To Process Any Uncaught Messages
return DefWindowProc(hWnd, uMsg, wParam, lParam);

}
I-Shaolin is correct just make sure that you hide the mouse cursor '' showcursor(FALSE)''

Erick

This topic is closed to new replies.

Advertisement