Jump to content
  • Advertisement
Sign in to follow this  
Moeen

problem in showing mouse cursor

This topic is 4893 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi hope all of u wud b fine. i m making a 3d car racing game n currently working on GUI. i m facin problem in showing the mouse cursor i've captured the mouse as follows Input()->GetDInput()->CreateDevice( GUID_SysMouse, &m_pDevice, NULL ); hr = m_pDevice->SetDataFormat( &c_dfDIMouse ); hr = m_pDevice->SetCooperativeLevel( hWnd, DISCL_EXCLUSIVE | DISCL_FOREGROUND ); hr = m_pDevice->Acquire(); now the cursor is not shown in full screen. i've even set the properties of the mouse as follows Graphics()->GetDevice()->CreateOffscreenPlainSurface(32,32,D3DFMT_A8R8G8B8,D3DPOOL_DEFAULT,&pCursor,NULL); D3DXLoadSurfaceFromFile(pCursor,NULL,NULL,"cursor.bmp", NULL, D3DX_FILTER_NONE,0,&imageInfo); Graphics()->GetDevice()->SetCursorProperties(0,0,pCursor); Graphics()->GetDevice()->ShowCursor(true); The surface for the mouse pointer is loaded n is in the middle of the screen. the problem is that this surface does not move along with the mouse pointer.. moreover there is so much flickering on the surface.... plz help me as i hav to finalize my this BSCS final year project plz if convenient, give me a few lines of code for guidence waiting for prompt reply moeen

Share this post


Link to post
Share on other sites
Advertisement
Once you choose an exclusive mode window's cursor disappears.

You will have to implement mouse drawing and movement by yourself (which is not much complicated)
Or you can use the non-exclusive mode , if that fits you

Share this post


Link to post
Share on other sites
hi
it's better not to use plain screen as your cursor placeholder, as it is not a convenient object to work with (speically in DX 9), instead, try XSprite object and in this way you can even have transparent parts in your cursor,

you can also use a small shader program to mask those areas you need, and then write them using stencil buffer.

visit galaxyroad.com, the first persian game development site, which soon will have english contents too!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!