Some directx cleaning.

This commit is contained in:
jmsgrogan 2023-01-06 13:03:51 +00:00
parent 850bd6906f
commit 55ed0e9299
19 changed files with 900 additions and 487 deletions

View file

@ -21,7 +21,6 @@
#include "File.h"
#include <windows.h>
#include <directx/d3dx12.h>
#include <iostream>
@ -62,7 +61,7 @@ void DirectXPainter::paint()
{
}
void DirectXPainter::paintBackground(const CD3DX12_CPU_DESCRIPTOR_HANDLE& rtvHandle, ID3D12GraphicsCommandList* commandList)
void DirectXPainter::paintBackground(const D3D12_CPU_DESCRIPTOR_HANDLE& rtvHandle, ID3D12GraphicsCommandList* commandList)
{
const float clearColor[] = { 0.0f, 0.2f, 0.4f, 1.0f };
commandList->ClearRenderTargetView(rtvHandle, clearColor, 0, nullptr);

View file

@ -13,8 +13,6 @@ class DrawingContext;
class DirectXMeshPainter;
class DirectXTextPainter;
struct CD3DX12_CPU_DESCRIPTOR_HANDLE;
class DirectXPainter : public AbstractPainter
{
public:
@ -28,7 +26,7 @@ public:
void initializeText(ID2D1DeviceContext2* d2dContext, IDWriteFactory* directWriteFactory);
void paintBackground(const CD3DX12_CPU_DESCRIPTOR_HANDLE& rtvHandle, ID3D12GraphicsCommandList* commandList);
void paintBackground(const D3D12_CPU_DESCRIPTOR_HANDLE& rtvHandle, ID3D12GraphicsCommandList* commandList);
void paintMesh(ID3D12GraphicsCommandList* commandList);

View file

@ -54,7 +54,7 @@ void DirectXTextPainter::updateTextFormat(IDWriteFactory* directWriteFactory, un
void DirectXTextPainter::paint(SceneText* text, DrawingContext* context, ID2D1DeviceContext2* d2dContext, IDWriteFactory* directWriteFactory)
{
const auto location = text->getTransform().getLocation();
D2D1_RECT_F textRect = D2D1::RectF(location.getX(), location.getY(), location.getX() + 100, location.getY() + 100);
D2D1_RECT_F textRect = D2D1::RectF(location.getX(), location.getY(), location.getX() + 200, location.getY() + 100);
updateTextFormat(directWriteFactory, text->getTextData().mFont.getSize());