-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeviceContext.h
More file actions
46 lines (32 loc) · 1.26 KB
/
DeviceContext.h
File metadata and controls
46 lines (32 loc) · 1.26 KB
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
#pragma once
#include <d3d11.h>
//#include "VertexShader.h"
class SwapChain; // Forward declaration of a class. Acts similar to #include, but can only use pointers / references to that class.
class VertexBuffer;
class IndexBuffer;
class VertexShader;
class PixelShader;
class ConstantBuffer;
class Texture;
class DeviceContext
{
public:
DeviceContext(ID3D11DeviceContext* device_context);
~DeviceContext();
bool release();
void clearRenderTargetColor(SwapChain* swap_chain, float red, float green, float blue, float alpha);
void setVertexBuffer(VertexBuffer* vertex_buffer);
void setVertexShader(VertexShader* vertex_shader);
void setPixelShader(PixelShader* pixel_shader);
void setIndexBuffer(IndexBuffer* index_buffer);
void setRenderConfig(VertexShader* vertexShader, PixelShader* pixelShader);
void setConstantBuffer(ConstantBuffer* buffer);
void setTexture(Texture* texture);
void drawTriangleList(UINT vertex_count, UINT start_vertex_index);
void drawTriangleStrip(UINT vertex_count, UINT start_vertex_index);
void drawIndexedTriangleList(UINT index_count, UINT start_index_location, UINT start_vertex_index);
void setViewportSize(UINT width, UINT height);
ID3D11DeviceContext* getDeviceContext();
private:
ID3D11DeviceContext* m_device_context;
};