OSDN Git Service

Boost.MSMでメニュー部分を実装
[shooting3/shootinggame.git] / ShootingGame / SampleOverlay.h
1 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
2 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
4 //// PARTICULAR PURPOSE.
5 ////
6 //// Copyright (c) Microsoft Corporation. All rights reserved
7
8 #pragma once
9
10 #include "DirectXSample.h"
11
12 ref class SampleOverlay
13 {
14 internal:
15     SampleOverlay();
16
17     void Initialize(
18         _In_ ID2D1Device*         d2dDevice, 
19         _In_ ID2D1DeviceContext*  d2dContext,
20         _In_ IWICImagingFactory*  wicFactory,
21         _In_ IDWriteFactory*      dwriteFactory,
22         _In_ Platform::String^    caption
23         );
24
25     void ResetDirectXResources();
26
27     void UpdateForWindowSizeChange();
28
29     void Render();
30
31     float GetTitleHeightInDips();
32
33 private:
34
35     Microsoft::WRL::ComPtr<ID2D1Factory1>           m_d2dFactory;
36     Microsoft::WRL::ComPtr<ID2D1Device>             m_d2dDevice;
37     Microsoft::WRL::ComPtr<ID2D1DeviceContext>      m_d2dContext;
38     Microsoft::WRL::ComPtr<IDWriteFactory>          m_dwriteFactory;
39     Microsoft::WRL::ComPtr<ID2D1SolidColorBrush>    m_whiteBrush;
40     Microsoft::WRL::ComPtr<ID2D1DrawingStateBlock>  m_stateBlock;
41
42     Microsoft::WRL::ComPtr<IWICImagingFactory>      m_wicFactory;
43     Microsoft::WRL::ComPtr<ID2D1Bitmap>             m_logoBitmap;
44     Microsoft::WRL::ComPtr<IDWriteTextLayout>       m_textLayout;
45
46     UINT                                            m_idIncrement;
47     bool                                            m_drawOverlay;
48     Platform::String^                               m_sampleName;
49     float                                           m_padding;
50     float                                           m_textVerticalOffset;
51     D2D1_SIZE_F                                     m_logoSize;
52     float                                           m_overlayWidth;
53 };