forked from cmuratori/refterm
-
Notifications
You must be signed in to change notification settings - Fork 1
/
refterm_example_d3d11.h
63 lines (50 loc) · 1.7 KB
/
refterm_example_d3d11.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
typedef struct
{
uint32_t CellSize[2];
uint32_t TermSize[2];
uint32_t TopLeftMargin[2];
uint32_t BlinkModulate;
uint32_t MarginColor;
uint32_t StrikeMin;
uint32_t StrikeMax;
uint32_t UnderlineMin;
uint32_t UnderlineMax;
} renderer_const_buffer;
#define RENDERER_CELL_BLINK 0x80000000
typedef struct
{
uint32_t GlyphIndex;
uint32_t Foreground;
uint32_t Background; // NOTE(casey): The top bit of the background flag indicates blinking
} renderer_cell;
typedef struct
{
ID3D11Device *Device;
ID3D11DeviceContext *DeviceContext;
ID3D11DeviceContext1 *DeviceContext1;
IDXGISwapChain2 *SwapChain;
HANDLE FrameLatencyWaitableObject;
ID3D11ComputeShader *ComputeShader;
ID3D11PixelShader *PixelShader;
ID3D11VertexShader *VertexShader;
ID3D11Buffer *ConstantBuffer;
ID3D11RenderTargetView *RenderTarget;
ID3D11UnorderedAccessView *RenderView;
ID3D11Buffer *CellBuffer;
ID3D11ShaderResourceView *CellView;
ID3D11Texture2D *GlyphTexture;
ID3D11ShaderResourceView *GlyphTextureView;
ID3D11Texture2D *GlyphTransfer;
ID3D11ShaderResourceView *GlyphTransferView;
IDXGISurface *GlyphTransferSurface;
// NOTE(casey): These are for DirectWrite
struct ID2D1RenderTarget *DWriteRenderTarget;
struct ID2D1SolidColorBrush *DWriteFillBrush;
uint32_t CurrentWidth;
uint32_t CurrentHeight;
uint32_t MaxCellCount;
int UseComputeShader;
} d3d11_renderer;
static d3d11_renderer AcquireD3D11Renderer(HWND Window, int EnableDebugging);
static void SetD3D11MaxCellCount(d3d11_renderer *Renderer, uint32_t Count);
static void SetD3D11GlyphCacheDim(d3d11_renderer *Renderer, uint32_t Width, uint32_t Height);