Sign in to follow this  
Anddos

I dont understand why the cursor is hidden?

Recommended Posts

Anddos    588

this is the source code name "NetworkGameSkeletonSource"

ive compiled it fine and when it runs the cursor is not showing?

Share this post


Link to post
Share on other sites
Daaark    3553
I googled it, and it looks like someone's example framework. Most likely, the author just told the program not to show the cursor. Do a search in the source code for the word cursor, and look for the line where they set the cursor visibility to be false.

In XNA GS the line would contain IsMouseVisible = false. Comment it out, or change it to = true;

Share this post


Link to post
Share on other sites
Anddos    588
HWND CreateFullscreenWindow( HINSTANCE hInstance, LPCSTR strClassName, LPCSTR strWindowTitle )
{
    // Create the window
    return CreateWindow( strClassName, strWindowTitle, WS_POPUP | WS_SYSMENU | WS_VISIBLE,
                         CW_USEDEFAULT, CW_USEDEFAULT, GetSystemMetrics( SM_CXSCREEN ),
                         GetSystemMetrics( SM_CYSCREEN ), GetDesktopWindow(), NULL,
                         hInstance, NULL );
 
}

Share this post


Link to post
Share on other sites
Anddos    588

i did look for them also , i could not find them in the source , btw thx for the fast replys 

should the cursor be hidden even tho this is set , d3dpp.Windowed = FALSE;

Edited by Anddos

Share this post


Link to post
Share on other sites
Anddos    588
  // Register a standard window class
    WNDCLASS wc = { 0, WndProc, 0, 0, hInstance,
                    LoadIcon( hInstance, MAKEINTRESOURCE(IDI_MAINICON) ),
                    LoadCursor( NULL, IDC_ARROW ),
                    (HBRUSH)GetStockObject(WHITE_BRUSH),
                    NULL, "wnd_ngsunseen" };
    RegisterClass( &wc );

Share this post


Link to post
Share on other sites
mhagain    13430

Add this to your initialize method before base.initialize

 

this.IsMouseVisible = true;

 

Ummm - this is native Win32 code we're talking about here.  There is no "base", no "base.initialize", etc.

Share this post


Link to post
Share on other sites
jrh2365    657

It's most likely caused by this line:

 

FAILED( pMouse->SetCooperativeLevel( hWnd,
            DISCL_FOREGROUND|DISCL_EXCLUSIVE ) ) )

 

See the documentation on SetCooperativeLevel here: http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.setcooperativelevel(v=vs.85).aspx

 

If the system mouse is acquired in exclusive mode, the pointer is removed from the screen until the device is unacquired. This applies only to a mouse created by passing GUID_SysMouse to IDirectInput8::CreateDevice.

Edited by jrh2365

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this