Split d2d integration into own class.
This commit is contained in:
parent
0d3674faac
commit
0c84a53643
25 changed files with 361 additions and 155 deletions
|
@ -1,11 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
#include <wrl.h>
|
||||
#include <dwrite.h>
|
||||
#include <d2d1_3.h>
|
||||
#include <d3d11on12.h>
|
||||
#include <dxgi1_6.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
class DirectX2dInterface;
|
||||
|
||||
struct ID3D12Device;
|
||||
struct IDXGIFactory7;
|
||||
struct IDXGIAdapter1;
|
||||
|
@ -14,27 +16,21 @@ struct ID3D12CommandQueue;
|
|||
struct ID3D11DeviceContext;
|
||||
struct ID3D11On12Device;
|
||||
|
||||
struct IDWriteFactory;
|
||||
struct ID2D1Factory3;
|
||||
struct ID2D1Device2;
|
||||
struct ID2D1DeviceContext2;
|
||||
|
||||
class DirectXInterface
|
||||
{
|
||||
public:
|
||||
DirectXInterface();
|
||||
|
||||
IDXGIFactory7* getDxgiFactory() const;
|
||||
ID3D12Device* getD3dDevice() const;
|
||||
ID3D12CommandQueue* getCommandQueue() const;
|
||||
|
||||
ID3D11On12Device* get11On12Device() const;
|
||||
ID3D11DeviceContext* getD3d11DeviceContext() const;
|
||||
ID2D1Factory3* getD2dFactory() const;
|
||||
ID2D1DeviceContext2* getD2dContext() const;
|
||||
IDWriteFactory* getDirectWriteFactory() const;
|
||||
|
||||
DirectX2dInterface* getD2dInterface() const;
|
||||
|
||||
void initialize();
|
||||
void initializeD2dStandalone();
|
||||
|
||||
bool isValid() const;
|
||||
|
||||
private:
|
||||
|
@ -44,9 +40,7 @@ private:
|
|||
|
||||
void getHardwareAdapter(IDXGIAdapter1** ppAdapter);
|
||||
|
||||
bool initializeD2d();
|
||||
bool initializeD11on12();
|
||||
bool initializeDirectWrite();
|
||||
|
||||
bool mIsValid{ false };
|
||||
|
||||
|
@ -54,11 +48,8 @@ private:
|
|||
Microsoft::WRL::ComPtr<ID3D12Device> mD3dDevice;
|
||||
Microsoft::WRL::ComPtr<ID3D12CommandQueue> mCommandQueue;
|
||||
|
||||
// 2D Rendering - e.g. text
|
||||
Microsoft::WRL::ComPtr<ID3D11DeviceContext> mD3d11DeviceContext;
|
||||
Microsoft::WRL::ComPtr<ID3D11On12Device> mD3d11On12Device;
|
||||
Microsoft::WRL::ComPtr<ID2D1Factory3> mD2dFactory;
|
||||
Microsoft::WRL::ComPtr<ID2D1Device2> mD2dDevice;
|
||||
Microsoft::WRL::ComPtr<ID2D1DeviceContext2> mD2dDeviceContext;
|
||||
Microsoft::WRL::ComPtr<IDWriteFactory> mDWriteFactory;
|
||||
|
||||
std::unique_ptr<DirectX2dInterface> mD2dInterface;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue