Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

WinRT: removed unused 4x4 matrix code from SDL_winrtrenderer

  • Loading branch information
DavidLudwig committed Nov 20, 2012
1 parent 863fbf6 commit 58489e2e97af5411774c87ba9ae9c1659a9954a1
@@ -127,7 +127,6 @@ void SDL_WinRTApp::UpdateWindowFramebuffer(SDL_Surface * surface, SDL_Rect * rec
{
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.
}
@@ -55,15 +55,6 @@ void SDL_winrtrenderer::CreateDeviceResources()
&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::CreateDeviceResources()
});
}

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 @@ void SDL_winrtrenderer::Render()
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 @@ void SDL_winrtrenderer::Render()
0
);

m_d3dContext->VSSetConstantBuffers(
0,
1,
m_constantBuffer.GetAddressOf()
);

m_d3dContext->PSSetShader(
m_pixelShader.Get(),
nullptr,
@@ -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 @@ ref class SDL_winrtrenderer sealed : public Direct3DBase
// 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 @@ ref class SDL_winrtrenderer sealed : public Direct3DBase
Microsoft::WRL::ComPtr<ID3D11RasterizerState> m_rasterState;

uint32 m_vertexCount;
ModelViewProjectionConstantBuffer m_constantBufferData;
};

0 comments on commit 58489e2

Please sign in to comment.