Jump to content
  • Advertisement
Sign in to follow this  
Letters90

Borderless Windowed Mode configuration

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

Hello!

 

I'm trying to mod a rather old game to enable it to run in windowed mode, specifically borderless window mode. Can you guys help me with the step of configuring direct x and the windows api window settings? I would be truly grateful. 

 

Regard Letters.

Share this post


Link to post
Share on other sites
Advertisement

I can only speak for d3d9 (for now);

 

- make sure you set the windowed flag in the d3d parameters to true

- after creating the window, use ShowWindow and UpdateWindow (to present the window)

- in the windowclass make sure the used style (for creating the window, i.e. CreateWindowEx) has the flag "WS_POP"

	mWc.style			= CS_HREDRAW | CS_VREDRAW;
	mWc.lpfnWndProc		= (WNDPROC)pWindowProc;
	mWc.cbClsExtra		= 0;
	mWc.cbWndExtra		= 0;
	mWc.hInstance		= pHinstance;
	mWc.hIcon			= LoadIcon(0, IDI_APPLICATION);
	mWc.hCursor			= LoadCursor(0, IDC_ARROW);
	mWc.lpszMenuName	= 0;
	mWc.lpszClassName	= L"WindowClass";
	mWc.cbSize			= sizeof(WNDCLASSEX);
	
	ShowCursor(FALSE);
	style = WS_POPUP;									// borderless window (no difference fullscreen/windowed, no borders / rect issues

	if(0 == (RegisterClassEx(&mWc))) return false;

	if(NULL == (mHwnd = CreateWindowEx(NULL,L"WindowClass", L"Crealysm", style,
							 		 0, 0, mSettings.GetScreenWidth(), mSettings.GetScreenHeight(),
									 NULL, NULL, pHinstance, NULL))) return false;
	if(mSettings.GetWindowed())
	{
		ShowWindow(mHwnd, pNcmdShow);
		UpdateWindow(mHwnd);
	}

// another snippet

	if(!mSettings.GetWindowed()) 
	{
		mD3dpp.BackBufferFormat = mAdapterFormat;
		mD3dpp.Windowed = false;
		mD3dpp.BackBufferWidth = mSettings.GetScreenWidth();
		mD3dpp.BackBufferHeight = mSettings.GetScreenHeight();
		mD3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
	}
	else mD3dpp.Windowed = true;

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!