
Added "Controlled" mesh classes Added Global Lighting Class Added Gamepad controls Split terrain nodes into Height and Perlin classes Fixed Splitmesh node stuff
68 lines
1.9 KiB
C++
68 lines
1.9 KiB
C++
#pragma once
|
|
#include <vector>
|
|
#include "Framework.h"
|
|
#include "DirectXCore.h"
|
|
#include "ResourceManager.h"
|
|
#include "SceneGraph.h"
|
|
#include "Camera.h"
|
|
#include "GlobalLighting.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; }
|
|
inline shared_ptr<GlobalLighting> GetGlobalLighting() { return _globalLighting; }
|
|
|
|
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;
|
|
shared_ptr<GlobalLighting> _globalLighting;
|
|
};
|
|
|