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:
36 d_3d_class();
37 d_3d_class(const d_3d_class&);
39
52 virtual bool initialize(int, int, bool, HWND, bool, float, float);
56 void shutdown();
57
66 virtual void begin_scene(float, float, float, float);
70 virtual void end_scene();
71
77 ID3D11Device* get_device();
83 ID3D11DeviceContext* get_device_context();
84 //XMMATRIX get_projection_matrix(XMMATRIX& projectionMatrix);
85 IDXGISwapChain* swap_chain;
90 IDXGISwapChain* get_swap_chain();
96 void resize_swap_chain(int width, int height);
102 void set_vsync(bool vsync);
103
109 XMMATRIX get_projection_matrix() const { return projection_matrix_; };
115 XMMATRIX get_world_matrix() const { return world_matrix_;};
121 XMMATRIX get_ortho_matrix() const { return ortho_matrix_; };
122
128 void get_video_card_info(char* description, int& memory);
129
137 void reset_viewport();
138
142 void release_resources();
148 void reset_resources(int newWidth, int newHeight);
149
153 void turn_z_buffer_on();
157 void turn_z_buffer_off();
158
167
168private:
169 bool vsync_enabled_;
170 int video_card_memory_;
171 char video_card_description_[128];
172 ID3D11Device* device_;
173 ID3D11DeviceContext* device_context_;
174 ID3D11RenderTargetView* render_target_view_;
175 ID3D11Texture2D* depth_stencil_buffer_;
176 ID3D11DepthStencilState* depth_stencil_state_;
177 ID3D11DepthStencilView* depth_stencil_view_;
178 ID3D11RasterizerState* raster_state_;
179 XMMATRIX projection_matrix_;
180 XMMATRIX world_matrix_;
181 XMMATRIX ortho_matrix_;
182 D3D11_VIEWPORT viewport_;
183 ID3D11DepthStencilState* depth_disabled_stencil_state_;
184 ID3D11BlendState* alpha_enable_blending_state_;
185 ID3D11BlendState* alpha_disable_blending_state_;
186};
187
188#endif
void turn_z_buffer_on()
ID3D11Device * get_device()
Gets the Direct3D device.
virtual void end_scene()
Ends the rendering process for the current frame.
void release_resources()
void reset_resources(int newWidth, int newHeight)
XMMATRIX get_world_matrix() const
Definition d_3d_class.h:115
void set_back_buffer_render_target()
ID3D11DeviceContext * get_device_context()
Gets the Direct3D device context.
void reset_viewport()
XMMATRIX get_projection_matrix() const
Definition d_3d_class.h:109
void get_video_card_info(char *description, int &memory)
void enable_alpha_blending()
void resize_swap_chain(int width, int height)
void disable_alpha_blending()
d_3d_class()
Default constructor for d_3d_class.
Definition d_3d_class.cpp:7
XMMATRIX get_ortho_matrix() const
Definition d_3d_class.h:121
IDXGISwapChain * get_swap_chain()
void set_vsync(bool vsync)
Sets the vertical sync state.
void shutdown()
Releases Direct3D resources.
virtual void begin_scene(float, float, float, float)
Begins the rendering process for a new frame.
virtual bool initialize(int, int, bool, HWND, bool, float, float)
Initializes the Direct3D device and related resources.
void turn_z_buffer_off()