-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraphics.cpp
More file actions
43 lines (34 loc) · 932 Bytes
/
graphics.cpp
File metadata and controls
43 lines (34 loc) · 932 Bytes
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
#include "graphics.h"
Graphics::Graphics()
{
d3d_ = new D3DRendering();
}
Graphics::~Graphics()
{
delete d3d_;
}
bool Graphics::Init(HWND hwnd)
{
return d3d_->Init(hwnd);
}
Sprite* Graphics::CreateSprite(const wchar_t* sprite_path, const wchar_t* vertex_shader_path, const wchar_t* pixel_shader_path)
{
//ID3D11Resource* texture = d3d_->CreateSpriteTexture(sprite_path);
//Creating new shader each time for now. Should reuse one compiled shader for all sprites.
ID3D11VertexShader* vertex_shader = d3d_->CreateVertexShader(vertex_shader_path);
ID3D11PixelShader* pixel_shader = d3d_->CreatePixelShader(pixel_shader_path);
ID3D11Resource* texture;
ID3D11ShaderResourceView* texture_view;
ID3D11SamplerState* sampler_state;
Sprite* sprite = new Sprite();
//sprite->Initialize(texture,
return nullptr;
}
void Graphics::BeginFrame()
{
d3d_->ClearBackground();
}
void Graphics::EndFrame()
{
d3d_->EndRender();
}