Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
WinRT: removed unused 4x4 matrix code from SDL_winrtrenderer
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLudwig committed Nov 20, 2012
1 parent 863fbf6 commit 58489e2
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 48 deletions.
1 change: 0 additions & 1 deletion src/video/windowsrt/SDL_WinRTApp.cpp
Expand Up @@ -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.
}
Expand Down
36 changes: 0 additions & 36 deletions src/video/windowsrt/SDL_winrtrenderer.cpp
Expand Up @@ -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] () {
Expand Down Expand Up @@ -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 };
Expand Down Expand Up @@ -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(
Expand All @@ -166,12 +136,6 @@ void SDL_winrtrenderer::Render()
0
);

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

m_d3dContext->PSSetShader(
m_pixelShader.Get(),
nullptr,
Expand Down
11 changes: 0 additions & 11 deletions src/video/windowsrt/SDL_winrtrenderer.h
Expand Up @@ -2,13 +2,6 @@

#include "Direct3DBase.h"

struct ModelViewProjectionConstantBuffer
{
DirectX::XMFLOAT4X4 model;
DirectX::XMFLOAT4X4 view;
DirectX::XMFLOAT4X4 projection;
};

struct VertexPositionColor
{
DirectX::XMFLOAT3 pos;
Expand All @@ -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;
Expand All @@ -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.