Khaotic Engine Reborn
Loading...
Searching...
No Matches
d_3d_class.h
1
2// Filename: d3dclass.h
4#ifndef _D3DCLASS_H_
5#define _D3DCLASS_H_
6
7
9// LINKING //
11#pragma comment(lib, "d3d11.lib")
12#pragma comment(lib, "dxgi.lib")
13#pragma comment(lib, "d3dcompiler.lib")
14
15
17// INCLUDES //
19#include "imguiManager.h"
20#include "d3d11.h"
21#include "font_shader_class.h"
22#include "font_class.h"
23#include "text_class.h"
24
25using namespace DirectX;
26
28// Class name: d_3d_class
31{
32public:
33 d_3d_class();
34 d_3d_class(const d_3d_class&);
36
37 virtual bool initialize(int, int, bool, HWND, bool, float, float);
38 void shutdown();
39
40 virtual void begin_scene(float, float, float, float);
41 virtual void end_scene();
42
43 ID3D11Device* get_device();
44 ID3D11DeviceContext* get_device_context();
45 //XMMATRIX get_projection_matrix(XMMATRIX& projectionMatrix);
46 IDXGISwapChain* swap_chain;
47 IDXGISwapChain* get_swap_chain();
48 void resize_swap_chain(int, int);
49 void set_vsync(bool vsync);
50
51
52 XMMATRIX get_projection_matrix() const { return projection_matrix_; };
53 XMMATRIX get_world_matrix() const { return world_matrix_;};
54 XMMATRIX get_ortho_matrix() const { return ortho_matrix_; };
55
56 void get_video_card_info(char*, int&);
57
58 void set_back_buffer_render_target();
59 void reset_viewport();
60
61 void release_resources();
62 void reset_resources(int newWidth, int newHeight);
63
64 void turn_z_buffer_on();
65 void turn_z_buffer_off();
66
67 void enable_alpha_blending();
68 void disable_alpha_blending();
69
70private:
71 bool vsync_enabled_;
72 int video_card_memory_;
73 char video_card_description_[128];
74 ID3D11Device* device_;
75 ID3D11DeviceContext* device_context_;
76 ID3D11RenderTargetView* render_target_view_;
77 ID3D11Texture2D* depth_stencil_buffer_;
78 ID3D11DepthStencilState* depth_stencil_state_;
79 ID3D11DepthStencilView* depth_stencil_view_;
80 ID3D11RasterizerState* raster_state_;
81 XMMATRIX projection_matrix_;
82 XMMATRIX world_matrix_;
83 XMMATRIX ortho_matrix_;
84 D3D11_VIEWPORT viewport_;
85 ID3D11DepthStencilState* depth_disabled_stencil_state_;
86 ID3D11BlendState* alpha_enable_blending_state_;
87 ID3D11BlendState* alpha_disable_blending_state_;
88};
89
90#endif