mirror of
https://github.com/yawut/SDL.git
synced 2026-07-19 09:21:40 -05:00
WinRT: removed unused 4x4 matrix code from SDL_winrtrenderer
This commit is contained in:
parent
76324a8dc3
commit
8f625d0105
|
|
@ -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 @@ public:
|
|||
// 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 @@ private:
|
|||
Microsoft::WRL::ComPtr<ID3D11RasterizerState> m_rasterState;
|
||||
|
||||
uint32 m_vertexCount;
|
||||
ModelViewProjectionConstantBuffer m_constantBufferData;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user