1 //
2 //   Copyright 2013 Pixar
3 //
4 //   Licensed under the Apache License, Version 2.0 (the "Apache License")
5 //   with the following modification; you may not use this file except in
6 //   compliance with the Apache License and the following modification to it:
7 //   Section 6. Trademarks. is deleted and replaced with:
8 //
9 //   6. Trademarks. This License does not grant permission to use the trade
10 //      names, trademarks, service marks, or product names of the Licensor
11 //      and its affiliates, except as required to comply with Section 4(c) of
12 //      the License and to reproduce the content of the NOTICE file.
13 //
14 //   You may obtain a copy of the Apache License at
15 //
16 //       http://www.apache.org/licenses/LICENSE-2.0
17 //
18 //   Unless required by applicable law or agreed to in writing, software
19 //   distributed under the Apache License with the above modification is
20 //   distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 //   KIND, either express or implied. See the Apache License for the specific
22 //   language governing permissions and limitations under the Apache License.
23 //
24 
25 #ifndef OPENSUBDIV_EXAMPLES_D3D11_HUD_H
26 #define OPENSUBDIV_EXAMPLES_D3D11_HUD_H
27 
28 #include <D3D11.h>
29 #include "hud.h"
30 
31 class D3D11hud : public Hud
32 {
33 public:
34     D3D11hud(ID3D11DeviceContext *deviceContext);
35     ~D3D11hud();
36 
Init(int width,int height)37     void Init(int width, int height) {
38         Init(width, height, width, height);
39     }
40 
Rebuild(int width,int height)41     void Rebuild(int width, int height) {
42         Rebuild(width, height, width, height);
43     }
44 
45     virtual void Init(int width, int height, int framebufferWidth, int framebufferHeight);
46 
47     virtual void Rebuild(int width, int height,
48                          int framebufferWidth, int framebufferHeight);
49 
50     virtual bool Flush();
51 
52 private:
53     ID3D11DeviceContext *_deviceContext;
54     ID3D11Buffer *_vbo;
55     ID3D11Buffer *_staticVbo;
56     ID3D11Texture2D *_fontTexture;
57     ID3D11InputLayout *_inputLayout;
58     ID3D11ShaderResourceView *_shaderResourceView;
59     ID3D11SamplerState *_samplerState;
60     ID3D11VertexShader *_vertexShader;
61     ID3D11PixelShader *_pixelShader;
62     ID3D11RasterizerState *_rasterizerState;
63     ID3D11Buffer* _constantBuffer;
64     int _staticVboCount;
65 };
66 
67 #endif  // OPENSUBDIV_EXAMPLES_D3D11_HUD_H
68