Start aligning Dx and OpenGl approaches.
This commit is contained in:
parent
d1ec8b4f68
commit
d99a36f24f
22 changed files with 899 additions and 366 deletions
37
src/graphics/directx/DirectXTextPainter.h
Normal file
37
src/graphics/directx/DirectXTextPainter.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
#pragma once
|
||||
|
||||
#include <wrl.h>
|
||||
#include <dwrite.h>
|
||||
#include <d2d1_3.h>
|
||||
#include <d2d1_1.h>
|
||||
|
||||
#include <unordered_map>
|
||||
#include <memory>
|
||||
|
||||
class DrawingContext;
|
||||
class DirectXShaderProgram;
|
||||
|
||||
class TextData;
|
||||
class SceneText;
|
||||
|
||||
struct ID2D1DeviceContext2;
|
||||
struct ID2D1SolidColorBrush;
|
||||
struct IDWriteFactory;
|
||||
|
||||
class DirectXTextPainter
|
||||
{
|
||||
public:
|
||||
DirectXTextPainter();
|
||||
|
||||
void paint(SceneText* text, DrawingContext* context);
|
||||
|
||||
void paint(ID2D1DeviceContext2* d2dContext, float width, float height);
|
||||
|
||||
void initializeBrush(ID2D1DeviceContext2* d2dContext);
|
||||
|
||||
void initializeTextFormat(IDWriteFactory* directWriteFactory);
|
||||
|
||||
private:
|
||||
Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> mTextBrush;
|
||||
Microsoft::WRL::ComPtr<IDWriteTextFormat> mTextFormat;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue