This repository was archived by the owner on Jun 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplication.h
More file actions
95 lines (78 loc) · 1.97 KB
/
Copy pathApplication.h
File metadata and controls
95 lines (78 loc) · 1.97 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#pragma once
//libraries
#include <windows.h>
#include <d3d11_1.h>
#include <d3dcompiler.h>
#include <directxmath.h>
#include <directxcolors.h>
#include <fstream>
#include <vector>
#include <string>
//libraries
#include "resource.h"
#include "DDSTextureLoader.h"
#include "OBJLoader.h"
#include "XMLLoader.h"
//classes
#include "Structures.h"
#include "Input.h"
#include "Camera.h"
#include "GameObject.h"
using namespace DirectX;
class Application
{
private:
//hardware pipeline
HINSTANCE _hInst;
HWND _hWnd;
D3D_DRIVER_TYPE _driverType;
D3D_FEATURE_LEVEL _featureLevel;
//render pipeline
ID3D11Device* _pd3dDevice;
ID3D11DeviceContext* _pImmediateContext;
IDXGISwapChain* _pSwapChain;
ID3D11RenderTargetView* _pRenderTargetView;
ID3D11VertexShader* _pVertexShader;
ID3D11PixelShader* _pPixelShader;
ID3D11InputLayout* _pVertexLayout;
ID3D11Buffer* _pConstantBuffer;
ID3D11RasterizerState* _solid;
ID3D11RasterizerState* _wireFrame;
ID3D11Texture2D* _depthStencilBuffer;
ID3D11DepthStencilView* _depthStencilView;
//mesh
ID3D11Buffer* _pCubeVertexBuffer;
ID3D11Buffer* _pCubeIndexBuffer;
ID3D11Buffer* _pPyramidVertexBuffer;
ID3D11Buffer* _pPyramidIndexBuffer;
//i/o
int _pCurrentCamera = 0;
Input* _pInput;
//objects
std::vector<Camera*> _pCameras;
std::vector<GameObject*> _pObjects;
std::vector<LightData> _pLights;
//texture
ID3D11SamplerState* _pSamplerLinear;
ID3D11ShaderResourceView* _pTexture; //built in texture
//world
XMFLOAT4X4 _world;
//fog
FogSettings _fog;
private:
HRESULT InitWindow(HINSTANCE hInstance, int nCmdShow);
HRESULT InitDevice();
void Cleanup();
HRESULT CompileShaderFromFile(WCHAR* szFileName, LPCSTR szEntryPoint, LPCSTR szShaderModel, ID3DBlob** ppBlobOut);
HRESULT InitShadersAndInputLayout();
HRESULT InitVertexBuffer();
HRESULT InitIndexBuffer();
UINT _WindowWidth;
UINT _WindowHeight;
public:
Application();
~Application();
HRESULT Initialise(HINSTANCE hInstance, int nCmdShow);
void Update();
void Draw();
};