light/Engine/src/Platform/GraphicsAPI/DirectX/dxRenderCommand.cpp

42 lines
805 B
C++
Raw Normal View History

2021-06-02 09:07:45 +04:30
#include "ltpch.h"
#include "dxRenderCommand.h"
#include "dxSharedContext.h"
namespace Light {
dxRenderCommand::dxRenderCommand(void* sharedContext)
{
dxSharedContext* dxContext = (dxSharedContext*)sharedContext;
m_DeviceContext = dxContext->deviceContext;
m_SwapChain = dxContext->swapChain;
m_RenderTargetView = dxContext->renderTargetView;
}
dxRenderCommand::~dxRenderCommand()
{
}
void dxRenderCommand::SwapBuffers()
{
m_SwapChain->Present(0, 0);
}
void dxRenderCommand::ClearBackBuffer()
{
float colors[] = { 1.2f, 0.4f, 0.9f, 1.0f };
m_DeviceContext->ClearRenderTargetView(m_RenderTargetView.Get(), colors);
}
void dxRenderCommand::Draw(unsigned int count)
{
2021-06-02 17:20:15 +04:30
m_DeviceContext->Draw(count, 0u);
2021-06-02 09:07:45 +04:30
}
void dxRenderCommand::DrawIndexed(unsigned int count)
{
}
}