WinRT: removed unused 4x4 matrix code from SDL_winrtrenderer
authorDavid Ludwig <dludwig@pobox.com>
Mon, 19 Nov 2012 22:30:00 -0500
changeset 834411fd2e01a070
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
     1.1 --- a/src/video/windowsrt/SDL_WinRTApp.cpp	Mon Nov 19 22:07:06 2012 -0500
     1.2 +++ b/src/video/windowsrt/SDL_WinRTApp.cpp	Mon Nov 19 22:30:00 2012 -0500
     1.3 @@ -127,7 +127,6 @@
     1.4  {
     1.5      if (!m_windowClosed && m_windowVisible)
     1.6  	{
     1.7 -		m_renderer->Update(0.0f, 0.0f);
     1.8  		m_renderer->Render();
     1.9  		m_renderer->Present(); // This call is synchronized to the display frame rate.
    1.10  	}
     2.1 --- a/src/video/windowsrt/SDL_winrtrenderer.cpp	Mon Nov 19 22:07:06 2012 -0500
     2.2 +++ b/src/video/windowsrt/SDL_winrtrenderer.cpp	Mon Nov 19 22:30:00 2012 -0500
     2.3 @@ -55,15 +55,6 @@
     2.4  				&m_pixelShader
     2.5  				)
     2.6  			);
     2.7 -
     2.8 -		CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ModelViewProjectionConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
     2.9 -		DX::ThrowIfFailed(
    2.10 -			m_d3dDevice->CreateBuffer(
    2.11 -				&constantBufferDesc,
    2.12 -				nullptr,
    2.13 -				&m_constantBuffer
    2.14 -				)
    2.15 -			);
    2.16  	});
    2.17  
    2.18  	auto createCubeTask = (createPSTask && createVSTask).then([this] () {
    2.19 @@ -96,18 +87,6 @@
    2.20  	});
    2.21  }
    2.22  
    2.23 -void SDL_winrtrenderer::Update(float timeTotal, float timeDelta)
    2.24 -{
    2.25 -	(void) timeDelta; // Unused parameter.
    2.26 -
    2.27 -	XMVECTOR eye = XMVectorSet(0.0f, 0.7f, 1.5f, 0.0f);
    2.28 -	XMVECTOR at = XMVectorSet(0.0f, -0.1f, 0.0f, 0.0f);
    2.29 -	XMVECTOR up = XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f);
    2.30 -
    2.31 -	XMStoreFloat4x4(&m_constantBufferData.view, XMMatrixIdentity());
    2.32 -	XMStoreFloat4x4(&m_constantBufferData.model, XMMatrixIdentity());
    2.33 -}
    2.34 -
    2.35  void SDL_winrtrenderer::Render()
    2.36  {
    2.37  	const float midnightBlue[] = { 0.098f, 0.098f, 0.439f, 1.000f };
    2.38 @@ -137,15 +116,6 @@
    2.39  		m_depthStencilView.Get()
    2.40  		);
    2.41  
    2.42 -	m_d3dContext->UpdateSubresource(
    2.43 -		m_constantBuffer.Get(),
    2.44 -		0,
    2.45 -		NULL,
    2.46 -		&m_constantBufferData,
    2.47 -		0,
    2.48 -		0
    2.49 -		);
    2.50 -
    2.51  	UINT stride = sizeof(VertexPositionColor);
    2.52  	UINT offset = 0;
    2.53  	m_d3dContext->IASetVertexBuffers(
    2.54 @@ -166,12 +136,6 @@
    2.55  		0
    2.56  		);
    2.57  
    2.58 -	m_d3dContext->VSSetConstantBuffers(
    2.59 -		0,
    2.60 -		1,
    2.61 -		m_constantBuffer.GetAddressOf()
    2.62 -		);
    2.63 -
    2.64  	m_d3dContext->PSSetShader(
    2.65  		m_pixelShader.Get(),
    2.66  		nullptr,
     3.1 --- a/src/video/windowsrt/SDL_winrtrenderer.h	Mon Nov 19 22:07:06 2012 -0500
     3.2 +++ b/src/video/windowsrt/SDL_winrtrenderer.h	Mon Nov 19 22:30:00 2012 -0500
     3.3 @@ -2,13 +2,6 @@
     3.4  
     3.5  #include "Direct3DBase.h"
     3.6  
     3.7 -struct ModelViewProjectionConstantBuffer
     3.8 -{
     3.9 -	DirectX::XMFLOAT4X4 model;
    3.10 -	DirectX::XMFLOAT4X4 view;
    3.11 -	DirectX::XMFLOAT4X4 projection;
    3.12 -};
    3.13 -
    3.14  struct VertexPositionColor
    3.15  {
    3.16  	DirectX::XMFLOAT3 pos;
    3.17 @@ -24,9 +17,6 @@
    3.18  	// Direct3DBase methods.
    3.19  	virtual void CreateDeviceResources() override;
    3.20  	virtual void Render() override;
    3.21 -	
    3.22 -	// Method for updating time-dependent objects.
    3.23 -	void Update(float timeTotal, float timeDelta);
    3.24  
    3.25  private:
    3.26  	bool m_loadingComplete;
    3.27 @@ -39,5 +29,4 @@
    3.28  	Microsoft::WRL::ComPtr<ID3D11RasterizerState> m_rasterState;
    3.29  
    3.30  	uint32 m_vertexCount;
    3.31 -	ModelViewProjectionConstantBuffer m_constantBufferData;
    3.32  };