Committing TBB 2019 Update 8 source code
[platform/upstream/tbb.git] / examples / parallel_for / tachyon / msvs / win8ui / tbbTachyonRenderer.h
1 /*
2     Copyright (c) 2005-2019 Intel Corporation
3
4     Licensed under the Apache License, Version 2.0 (the "License");
5     you may not use this file except in compliance with the License.
6     You may obtain a copy of the License at
7
8         http://www.apache.org/licenses/LICENSE-2.0
9
10     Unless required by applicable law or agreed to in writing, software
11     distributed under the License is distributed on an "AS IS" BASIS,
12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13     See the License for the specific language governing permissions and
14     limitations under the License.
15 */
16
17 #pragma once
18
19 #include <wrl.h>
20 #include "DirectXBase.h"
21
22 ref class tbbTachyonRenderer sealed : public DirectXBase
23 {
24 public:
25     tbbTachyonRenderer();
26     virtual void CreateDeviceIndependentResources() override;
27     virtual void CreateDeviceResources() override;
28     virtual void CreateWindowSizeDependentResources() override;
29     virtual void Render() override;
30     void Update(float timeTotal, float timeDelta);
31
32     void UpdateView(Windows::Foundation::Point deltaViewPosition);
33
34 private:
35     Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_Brush;
36     Microsoft::WRL::ComPtr<IDWriteTextFormat> m_textFormat;
37     Microsoft::WRL::ComPtr<ID2D1Bitmap1> m_opacityBitmap;
38     Microsoft::WRL::ComPtr<IDWriteTextLayout> m_textLayout;
39     DWRITE_TEXT_METRICS m_textMetrics;
40     bool m_renderNeeded;
41     ~tbbTachyonRenderer();
42 };