src/video/windowsrt/CubeRenderer.h
author David Ludwig <dludwig@pobox.com>
Sun, 28 Oct 2012 20:47:33 -0400
changeset 8332 ea83d191cc17
parent 8322 839cd578a474
permissions -rw-r--r--
WinRT: added mouse button event support
     1 #pragma once
     2 
     3 #include "Direct3DBase.h"
     4 
     5 struct ModelViewProjectionConstantBuffer
     6 {
     7 	DirectX::XMFLOAT4X4 model;
     8 	DirectX::XMFLOAT4X4 view;
     9 	DirectX::XMFLOAT4X4 projection;
    10 };
    11 
    12 struct VertexPositionColor
    13 {
    14 	DirectX::XMFLOAT3 pos;
    15 	DirectX::XMFLOAT3 color;
    16 };
    17 
    18 // This class renders a simple spinning cube.
    19 ref class CubeRenderer sealed : public Direct3DBase
    20 {
    21 public:
    22 	CubeRenderer();
    23 
    24 	// Direct3DBase methods.
    25 	virtual void CreateDeviceResources() override;
    26 	virtual void CreateWindowSizeDependentResources() override;
    27 	virtual void Render() override;
    28 	
    29 	// Method for updating time-dependent objects.
    30 	void Update(float timeTotal, float timeDelta);
    31 
    32 private:
    33 	bool m_loadingComplete;
    34 
    35 	Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout;
    36 	Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer;
    37 	Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer;
    38 	Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader;
    39 	Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShader;
    40 	Microsoft::WRL::ComPtr<ID3D11Buffer> m_constantBuffer;
    41 
    42 	uint32 m_indexCount;
    43 	ModelViewProjectionConstantBuffer m_constantBufferData;
    44 };