Sign in to follow this  
Moeen

problem in showing mouse cursor

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
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

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