Files
directx-plane-game/Graphics2/DirectXFramework.h
iDunnoDev 7a57c73ac3 Added the camera class
Added the DDS Texture Loading for future use
Added the gamepad class for future use
Added first child method to the scenegraph
Added RGB to intensity and lerp methods to the shared methods class
Added the terrain node class with normals
Fixed issue with submeshnode not passing the world transform to the actual meshes
2022-04-18 22:33:15 +01:00

65 lines
1.7 KiB
C++

#pragma once
#include <vector>
#include "Framework.h"
#include "DirectXCore.h"
#include "ResourceManager.h"
#include "SceneGraph.h"
#include "Camera.h"
class DirectXFramework : public Framework
{
public:
DirectXFramework();
DirectXFramework(unsigned int width, unsigned int height);
virtual void CreateSceneGraph();
virtual void UpdateSceneGraph();
bool Initialise();
void Update();
void Render();
void OnResize(WPARAM wParam);
void Shutdown();
static DirectXFramework * GetDXFramework();
inline SceneGraphPointer GetSceneGraph() { return _sceneGraph; }
inline ComPtr<ID3D11Device> GetDevice() { return _device; }
inline ComPtr<ID3D11DeviceContext> GetDeviceContext() { return _deviceContext; }
inline shared_ptr<ResourceManager> GetResourceManager() { return _resourceManager; }
XMMATRIX GetProjectionTransformation();
void SetBackgroundColour(XMFLOAT4 backgroundColour);
inline shared_ptr<Camera> GetCamera() { return _camera; }
private:
ComPtr<ID3D11Device> _device;
ComPtr<ID3D11DeviceContext> _deviceContext;
ComPtr<IDXGISwapChain> _swapChain;
ComPtr<ID3D11Texture2D> _depthStencilBuffer;
ComPtr<ID3D11RenderTargetView> _renderTargetView;
ComPtr<ID3D11DepthStencilView> _depthStencilView;
D3D11_VIEWPORT _screenViewport;
// Our vectors and matrices. Note that we cannot use
// XMVECTOR and XMMATRIX for class variables since they need
// to be aligned on 16-byte boundaries and the compiler cannot
// guarantee this for class variables
XMFLOAT4X4 _projectionTransformation;
SceneGraphPointer _sceneGraph;
float _backgroundColour[4];
bool GetDeviceAndSwapChain();
shared_ptr<ResourceManager> _resourceManager;
shared_ptr<Camera> _camera;
};