Original Post
Hey guys,
I use DX 8.0, using D3D, DInput, and DSound for my game.
I''ve had reports for a while that on Win98 machines, the cursor does not appear. I was using the regular windows cursor with default handling (which works fine on WinXP machines). I figured changing over to a custom cursor might fix this problem.
So I did that. Here''s the initialization code during the D3D init sequence
//create the cursor surface and load it
r = D3DDevice->CreateImageSurface(32, 32, TextureFormat, &CursorBitmap);
GetCurrentDirectory(250, FileName);
lstrcat (FileName, "\\Client\\Graphics\\UserInterface\\Cursor.bmp");
r = D3DXLoadSurfaceFromFile(CursorBitmap, NULL, NULL, FileName, NULL,
D3DX_FILTER_NONE, 0xff000000, NULL);
Then in the message loop:
case WM_SETCURSOR:
{
// Turn off window cursor
SetCursor( NULL );
Direct3D.SetCursor();
return true; // prevent Windows from setting cursor to window
class cursor
}
with:
void D3DClass::SetCursor()
{
Direct3D.D3DDevice->SetCursorProperties(0, 0, CursorBitmap);
Direct3D.D3DDevice->ShowCursor(true);
}
This gives me a custom cursor in WinXP. Alas, I get the same report from my Win98 users, no cursor. They have the *functionality* of a cursor (they can click on stuff) but no graphic. What gives? Do I need to manually draw the damn thing during each scene render?
Advice appreciated! Thanks,
-Ron