فهرست منبع

Fixed issue with DirectX 11 switching from full screen to windowed

Marko Pintera 11 سال پیش
والد
کامیت
c016a95632

+ 3 - 3
BansheeD3D11RenderSystem/Source/BsD3D11RenderWindow.cpp

@@ -434,7 +434,7 @@ namespace BansheeEngine
 		mHeight = height;
 		mIsFullScreen = false;
 
-		mSwapChainDesc.Windowed = false;
+		mSwapChainDesc.Windowed = true;
 		mSwapChainDesc.BufferDesc.RefreshRate.Numerator = 0;
 		mSwapChainDesc.BufferDesc.RefreshRate.Denominator = 0;
 		mSwapChainDesc.BufferDesc.Width = mWidth;
@@ -449,8 +449,8 @@ namespace BansheeEngine
 		modeDesc.RefreshRate.Denominator = 0;
 		modeDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
 
-		mSwapChain->ResizeTarget(&modeDesc);
 		mSwapChain->SetFullscreenState(false, nullptr);
+		mSwapChain->ResizeTarget(&modeDesc);
 	}
 
 	void D3D11RenderWindow::getCustomAttribute( const String& name, void* pData ) const
@@ -583,7 +583,7 @@ namespace BansheeEngine
 		unsigned int width = rc.right - rc.left;
 		unsigned int height = rc.bottom - rc.top;
 
-		if (width == 0) 
+		if (width == 0)
 			width = 1;
 
 		if (height == 0)

+ 1 - 1
BansheeD3D11RenderSystem/Source/BsD3D11VideoModeInfo.cpp

@@ -9,8 +9,8 @@ namespace BansheeEngine
 		IDXGIOutput* output = nullptr;
 		while (dxgiAdapter->EnumOutputs(outputIdx, &output) != DXGI_ERROR_NOT_FOUND)
 		{
-			outputIdx++;
 			mOutputs.push_back(bs_new<D3D11VideoOutputInfo>(output, outputIdx));
+			outputIdx++;
 		}
 	}
 

+ 1 - 1
ExampleProject/Main/Main.cpp

@@ -409,7 +409,7 @@ namespace BansheeEngine
 		rightLayout.addElement(toggleFullscreenButton);
 
 		// Add a profiler overlay object that is resposible for displaying CPU and GPU profiling GUI
-		//profilerOverlay = guiSO->addComponent<ProfilerOverlay>(guiCamera->getViewport());
+		profilerOverlay = guiSO->addComponent<ProfilerOverlay>(guiCamera->getViewport());
 
 		// Set up video mode list box
 		// First get a list of output devices

+ 4 - 0
Polish.txt

@@ -3,6 +3,7 @@ Polish TODO:
   - Ensure that going fullscreen and windowed works fine
  - Add an example model
  - Test if example shuts down fine
+ - Add readme to Git
 
  - Add license text to all files
 
@@ -18,6 +19,9 @@ Polish TODO:
  - Test checking out source and extracting dependencies and see if it compiles
  - Test compiling on another PC
 
+ - Updates links in git readme
+ - Update links in license text
+
 Automatically release resources on shutdown instead of forcing the user to manually call unload() and set handles to nullptr.
  - e.g. just invalidate all handles automatically