Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Full Screen Issues

This topic is 5784 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

I have a full screen DX app running with Direct Input. I have my cursor (currently a simple polygon) moving around the screen with the mouse. Basically I''m just adding or subtracting the relative movement to the absolute position each time through my input functions. I''m bounding my quad inside of the screen by checking if current input will place it in a legam area (0-width or 0-height). However, if I push it to any extreme corner of the screen, my polygon stops like it should but the windows pointer appears there (even though I have it turned off). If I click on the extreme top (the very last pixel) then the app minimizes because it is clicking the window behind it. Is this common and how would I go about fixing it? I''m running at 800 x 600 but the input adjusts to different resolutions and gives the same problem on all of them. Is there a way to disable the mouse from giving windows any input at all so that my app is the oNLY one to recieve input when it is running? Thanks, Webby

Share this post

Link to post
Share on other sites
make sure and use the EXCLUSIVE flag when you are aquiring the device and all will be well, if that doesnt fix your problem then you are somehow loosing the focus on your app and it is giving the desktop or another app focus.


"To die with your sword still in its sheath is most regrettable" -- Miyomoto Musashi

Share this post

Link to post
Share on other sites
Checked for the EXCLUSIVITY. It''s in there
m_mouse->SetCooperativeLevel(hWnd, DISCL_BACKGROUND |

Any other ideas? I can''t find it still after 1.5 days.

If you need to see how I am doing certain parts of the code just let me know which parts you need to see. It''s a lot of code so I''m not gonna post everything.


Share this post

Link to post
Share on other sites
Are you correctly createing a fullscreen app? Not just a big windowed app, but fullscreen parameters in the device creation code?

Also, does your window specify TOPMOST in its styles? That might be it, too.

I like pie.

Share this post

Link to post
Share on other sites
This isn''t making much sense at all.
Still deactivating my window when I click on the extreem top
left or right corners of the screen. When the Windows cursor gets to withint one pixel of those areas, the windows pointer
becomes visible and clicking when it is visible makes my game
minimize and gives focus to whatever window was just below it.
Any ideas? All the code I think is relevant is posted below. Thanks to anyone who can help.



Fullscreen present paramaters are
m_ppFullscreen.BackBufferHeight = FSHeight(); //600

m_ppFullscreen.BackBufferWidth = FSWidth(); //800

m_ppFullscreen.BackBufferFormat = D3DFMT_A8R8G8B8;
m_ppFullscreen.BackBufferCount = 1;
m_ppFullscreen.MultiSampleType = D3DMULTISAMPLE_NONE;
m_ppFullscreen.MultiSampleQuality = 0;
m_ppFullscreen.SwapEffect = D3DSWAPEFFECT_DISCARD;
m_ppFullscreen.hDeviceWindow = GethWnd();
m_ppFullscreen.Windowed = false;
m_ppFullscreen.EnableAutoDepthStencil = true;
m_ppFullscreen.AutoDepthStencilFormat = D3DFMT_D16;
m_ppFullscreen.FullScreen_RefreshRateInHz = RefreshRate(); //85

m_ppFullscreen.PresentationInterval =

//Device created with

m_pD3D->CreateDevice(m_iCurrentAdapterIndex, D3DDEVTYPE_HAL,
&m_ppFullscreen, &m_pd3ddCurrentDevice);

Main window created before DX takes over

m_hInst = GetModuleHandle(NULL);
m_sGameName = "Game";
m_sClassName = "Game Class";
m_sWindowCaption = "The Game";

m_iStyle = 281673728 //WS_OVERLAPPED|



m_iXPos = 0;
m_iYPos = 0;
m_iWidth = 800;
m_iHeight = 600;
// Set default WNDCLASSEX structure

m_wcex.cbSize = sizeof(WNDCLASSEX);
m_wcex.style = CS_CLASSDC;
m_wcex.lpfnWndProc = AppWindowProc;
m_wcex.cbClsExtra = 0;
m_wcex.cbWndExtra = 0;
m_wcex.hInstance = m_hInst;
m_wcex.hIcon = LoadIcon(NULL, IDI_APPLICATION);
m_wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
m_wcex.hbrBackground = NULL;
m_wcex.lpszMenuName = NULL;
m_wcex.lpszClassName = m_sClassName.c_str();
m_wcex.hIconSm = LoadIcon(NULL, IDI_APPLICATION);

Reading the mouse buffered like this

switch (m_odMouse[i].dwOfs)
// Mouse horizontal motion

case DIMOFS_X:
if(m_absPosition.x >= 0 &&
m_absPosition.x <= GetGameWidth() &&
m_absPosition.x + m_odMouse[i].dwData >= 0 &&
m_absPosition.x + m_odMouse[i].dwData <=
m_absPosition.x += m_odMouse[i].dwData;
m_relPosition.x = m_odMouse[i].dwData;
Test to try and keep the cursor on the game screen
since I''m never letting the m_absPositions go below
0 or above GameWidth - 1 or GameHeight - 1
// Mouse vertical motion

case DIMOFS_Y:
if(m_absPosition.y >= 0 &&
m_absPosition.y <= GetGameHeight() &&
m_absPosition.y + m_odMouse[i].dwData >= 0 &&
m_absPosition.y + m_odMouse[i].dwData <=
GetGameHeight() )
m_absPosition.y += m_odMouse[i].dwData;
m_relPosition.y = m_odMouse[i].dwData;
//Test to try and keep cursor on the screen


Share this post

Link to post
Share on other sites
Finally found it.

I was setting up the style to WS_POPUP|WS_VISIBLE and was storing it inside a private member of my graphics class.
BUT, I was never calling SetWindowLong in my startup procedure.
I was doing it when switching screen modes and when minimizing/maximizing but never on the initial startup!.

Well, thanks all, the lead led to the right place


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!