Jump to content
  • Advertisement
MarcusAseth

IDXGIFactory::MakeWindowAssociation has no effect

Recommended Posts

bool InitDirect3D::Init()
{
	if (!D3DApp::Init())
	{
		return false;
	}

	//Additional Initialization

	//Disable Alt+Enter Fullscreen Toggle shortkey
	IDXGIFactory* factory;
	CreateDXGIFactory(__uuidof(IDXGIFactory), reinterpret_cast<void**>(&factory));
	factory->MakeWindowAssociation(mhWindow, DXGI_MWA_NO_WINDOW_CHANGES);
	factory->Release();

	return true;
}

 

As stated on the title and displayed on the code above, regardless of it Alt+Enter still takes effect...

I recall something from the book during the swapChain creation, where in order to create it one has to use the same factory used to create the ID3D11Device, therefore I tested and indeed using that same factory indeed it work.

How is that one particular factory related to my window and how come the MakeWindowAssociation won't take effect with a newly created factory?

Also what's even the point of being able to create this Factories if they won't work,?(except from that one associated with the ID3D11Device) :/

Edited by MarcusAseth

Share this post


Link to post
Share on other sites
Advertisement
5 hours ago, Alessio1989 said:

Do you check the function return value?

Just did, returned S_OK so no error there.

Edit: I checked the factory creation, let me check the function below it as well

Thas is S_OK too, no errors.

Edited by MarcusAseth

Share this post


Link to post
Share on other sites

No the flag is correct, it stops ALT+Enter  if the function is called with the same factory used to create the Device, I tested it.

Is stated in the msdn as well, 

Quote

Applications that want to handle mode changes or Alt+Enter themselves should call MakeWindowAssociation with the DXGI_MWA_NO_WINDOW_CHANGES flag after swap chain creation.

Calling MakeWindowAssociation with the DXGI_MWA_NO_WINDOW_CHANGES flag after swapchain creation ensures that DXGI will not interfere with application's handling of window mode changes or Alt+Enter.

Basically is more generic than the Alt Enter flag from what I can tell

Edited by MarcusAseth

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.

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!