src/video/windowsrt/Direct3DBase.h
author David Ludwig <dludwig@pobox.com>
Sun, 28 Oct 2012 20:47:33 -0400
changeset 8332 ea83d191cc17
parent 8322 839cd578a474
child 8350 ecc8c88ed82e
permissions -rw-r--r--
WinRT: added mouse button event support
     1 #pragma once
     2 
     3 #include "DirectXHelper.h"
     4 
     5 // Helper class that initializes DirectX APIs for 3D rendering.
     6 ref class Direct3DBase abstract
     7 {
     8 internal:
     9 	Direct3DBase();
    10 
    11 public:
    12 	virtual void Initialize(Windows::UI::Core::CoreWindow^ window);
    13 	virtual void HandleDeviceLost();
    14 	virtual void CreateDeviceResources();
    15 	virtual void CreateWindowSizeDependentResources();
    16 	virtual void UpdateForWindowSizeChange();
    17 	virtual void Render() = 0;
    18 	virtual void Present();
    19 	virtual float ConvertDipsToPixels(float dips);
    20 
    21 protected private:
    22 	// Direct3D Objects.
    23 	Microsoft::WRL::ComPtr<ID3D11Device1> m_d3dDevice;
    24 	Microsoft::WRL::ComPtr<ID3D11DeviceContext1> m_d3dContext;
    25 	Microsoft::WRL::ComPtr<IDXGISwapChain1> m_swapChain;
    26 	Microsoft::WRL::ComPtr<ID3D11RenderTargetView> m_renderTargetView;
    27 	Microsoft::WRL::ComPtr<ID3D11DepthStencilView> m_depthStencilView;
    28 
    29 	// Cached renderer properties.
    30 	D3D_FEATURE_LEVEL m_featureLevel;
    31 	Windows::Foundation::Size m_renderTargetSize;
    32 	Windows::Foundation::Rect m_windowBounds;
    33 	Platform::Agile<Windows::UI::Core::CoreWindow> m_window;
    34 	Windows::Graphics::Display::DisplayOrientations m_orientation;
    35 
    36 	// Transform used for display orientation.
    37 	DirectX::XMFLOAT4X4 m_orientationTransform3D;
    38 };