Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include "Direct3DBase.h"
- #include "Asteroid.h"
- #include "Placement.h"
- #include "AccelerometerDelegate.h"
- #include "Rotation.h"
- #include "ppltasks.h" // Concurrency::task
- #include <vector>
- using std::vector;
- struct ModelViewProjectionConstantBuffer
- {
- DirectX::XMFLOAT4X4 model;
- DirectX::XMFLOAT4X4 view;
- DirectX::XMFLOAT4X4 projection;
- };
- struct VertexPositionColor
- {
- DirectX::XMFLOAT3 pos;
- DirectX::XMFLOAT3 color;
- };
- // This class renders a simple spinning cube.
- ref class Renderer sealed : public Direct3DBase
- {
- public:
- Renderer();
- // Direct3DBase methods.
- virtual void CreateDeviceResources() override;
- virtual void CreateWindowSizeDependentResources() override;
- virtual void Render() override;
- // Method for updating time-dependent objects.
- void RenderBackground();
- void Update( Placement^ placement );
- void UpdateAsteroid( Placement^ placement);
- void ComposeFrame();
- void SetUpViewingAngle();
- void GetBuffer();
- void PreparePlayer();
- void PrepareAsteroids( int index );
- private: // Methods
- void PrepareObjects( Concurrency::task<void> createPSTask, Concurrency::task<void> createVSTask );
- private: // Properties
- bool m_playerLoadComplete;
- bool m_asteroidsLoadComplete;
- Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout;
- // Player Buffers
- Microsoft::WRL::ComPtr<ID3D11Buffer> playerVertexBuffer;
- Microsoft::WRL::ComPtr<ID3D11Buffer> playerIndexBuffer;
- uint32 playerIndexCount;
- // Asteroid Buffers
- vector<Microsoft::WRL::ComPtr<ID3D11Buffer>> asteroidVertexBuffers;
- vector<Microsoft::WRL::ComPtr<ID3D11Buffer>> asteroidIndexBuffers;
- vector<uint32> asteroidIndexCounts;
- Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader;
- Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShader;
- Microsoft::WRL::ComPtr<ID3D11Buffer> m_constantBuffer;
- ModelViewProjectionConstantBuffer m_constantBufferData;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement