This repository has been archived on 2024-03-22. You can view files and clone it, but cannot push or open issues or pull requests.
DX11Starter/Game.h

52 lines
1.3 KiB
C++

#pragma once
#include "DXCore.h"
#include "Mesh.h"
#include "Entity.h"
#include <DirectXMath.h>
#include <wrl/client.h> // Used for ComPtr - a smart pointer for COM objects
#include <memory>
#include <vector>
class Game
: public DXCore
{
public:
Game(HINSTANCE hInstance);
~Game();
// Overridden setup and game loop methods, which
// will be called automatically
void Init();
void OnResize();
void Update(float deltaTime, float totalTime);
void Draw(float deltaTime, float totalTime);
private:
// Should we use vsync to limit the frame rate?
bool vsync;
// Initialization helper methods - feel free to customize, combine, etc.
void LoadShaders();
void CreateBasicGeometry();
// Note the usage of ComPtr below
// - This is a smart pointer for objects that abide by the
// Component Object Model, which DirectX objects do
// - More info here: https://github.com/Microsoft/DirectXTK/wiki/ComPtr
// Shaders and shader-related constructs
Microsoft::WRL::ComPtr<ID3D11PixelShader> pixelShader;
Microsoft::WRL::ComPtr<ID3D11VertexShader> vertexShader;
Microsoft::WRL::ComPtr<ID3D11InputLayout> inputLayout;
// Temporary A2 shapes
std::vector<std::shared_ptr<Mesh>> shapes;
// Temporary A3 entities;
std::vector<std::shared_ptr<Entity>> entities;
Microsoft::WRL::ComPtr<ID3D11Buffer> constantBufferVS;
};