WinRT: removed unused 4x4 matrix code from SDL_winrtrenderer
authorDavid Ludwig <dludwig@pobox.com>
Mon, 19 Nov 2012 22:30:00 -0500
changeset 8344 11fd2e01a070
parent 8343 f593baeea84c
child 8345 a7bbc0d7f381
WinRT: removed unused 4x4 matrix code from SDL_winrtrenderer
src/video/windowsrt/SDL_WinRTApp.cpp
src/video/windowsrt/SDL_winrtrenderer.cpp
src/video/windowsrt/SDL_winrtrenderer.h
--- a/src/video/windowsrt/SDL_WinRTApp.cpp	Mon Nov 19 22:07:06 2012 -0500
+++ b/src/video/windowsrt/SDL_WinRTApp.cpp	Mon Nov 19 22:30:00 2012 -0500
@@ -127,7 +127,6 @@
 {
     if (!m_windowClosed && m_windowVisible)
 	{
-		m_renderer->Update(0.0f, 0.0f);
 		m_renderer->Render();
 		m_renderer->Present(); // This call is synchronized to the display frame rate.
 	}
--- a/src/video/windowsrt/SDL_winrtrenderer.cpp	Mon Nov 19 22:07:06 2012 -0500
+++ b/src/video/windowsrt/SDL_winrtrenderer.cpp	Mon Nov 19 22:30:00 2012 -0500
@@ -55,15 +55,6 @@
 				&m_pixelShader
 				)
 			);
-
-		CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ModelViewProjectionConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
-		DX::ThrowIfFailed(
-			m_d3dDevice->CreateBuffer(
-				&constantBufferDesc,
-				nullptr,
-				&m_constantBuffer
-				)
-			);
 	});
 
 	auto createCubeTask = (createPSTask && createVSTask).then([this] () {
@@ -96,18 +87,6 @@
 	});
 }
 
-void SDL_winrtrenderer::Update(float timeTotal, float timeDelta)
-{
-	(void) timeDelta; // Unused parameter.
-
-	XMVECTOR eye = XMVectorSet(0.0f, 0.7f, 1.5f, 0.0f);
-	XMVECTOR at = XMVectorSet(0.0f, -0.1f, 0.0f, 0.0f);
-	XMVECTOR up = XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f);
-
-	XMStoreFloat4x4(&m_constantBufferData.view, XMMatrixIdentity());
-	XMStoreFloat4x4(&m_constantBufferData.model, XMMatrixIdentity());
-}
-
 void SDL_winrtrenderer::Render()
 {
 	const float midnightBlue[] = { 0.098f, 0.098f, 0.439f, 1.000f };
@@ -137,15 +116,6 @@
 		m_depthStencilView.Get()
 		);
 
-	m_d3dContext->UpdateSubresource(
-		m_constantBuffer.Get(),
-		0,
-		NULL,
-		&m_constantBufferData,
-		0,
-		0
-		);
-
 	UINT stride = sizeof(VertexPositionColor);
 	UINT offset = 0;
 	m_d3dContext->IASetVertexBuffers(
@@ -166,12 +136,6 @@
 		0
 		);
 
-	m_d3dContext->VSSetConstantBuffers(
-		0,
-		1,
-		m_constantBuffer.GetAddressOf()
-		);
-
 	m_d3dContext->PSSetShader(
 		m_pixelShader.Get(),
 		nullptr,
--- a/src/video/windowsrt/SDL_winrtrenderer.h	Mon Nov 19 22:07:06 2012 -0500
+++ b/src/video/windowsrt/SDL_winrtrenderer.h	Mon Nov 19 22:30:00 2012 -0500
@@ -2,13 +2,6 @@
 
 #include "Direct3DBase.h"
 
-struct ModelViewProjectionConstantBuffer
-{
-	DirectX::XMFLOAT4X4 model;
-	DirectX::XMFLOAT4X4 view;
-	DirectX::XMFLOAT4X4 projection;
-};
-
 struct VertexPositionColor
 {
 	DirectX::XMFLOAT3 pos;
@@ -24,9 +17,6 @@
 	// Direct3DBase methods.
 	virtual void CreateDeviceResources() override;
 	virtual void Render() override;
-	
-	// Method for updating time-dependent objects.
-	void Update(float timeTotal, float timeDelta);
 
 private:
 	bool m_loadingComplete;
@@ -39,5 +29,4 @@
 	Microsoft::WRL::ComPtr<ID3D11RasterizerState> m_rasterState;
 
 	uint32 m_vertexCount;
-	ModelViewProjectionConstantBuffer m_constantBufferData;
 };