HoverRace  2.0
SdlSymbolIconView.h
Go to the documentation of this file.
1 
2 // SdlSymbolIconView.h
3 //
4 // Copyright (c) 2013-2015 Michael Imamura.
5 //
6 // Licensed under GrokkSoft HoverRace SourceCode License v1.0(the "License");
7 // you may not use this file except in compliance with the License.
8 //
9 // A copy of the license should have been attached to the package from which
10 // you have taken this file. If you can not find the license you can not use
11 // this file.
12 //
13 //
14 // The author makes no representations about the suitability of
15 // this software for any purpose. It is provided "as is" "AS IS",
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17 // implied.
18 //
19 // See the License for the specific language governing permissions
20 // and limitations under the License.
21 
22 #pragma once
23 
24 #include "SdlDisplay.h"
25 #include "SdlTexture.h"
26 #include "SdlView.h"
27 
28 #if defined(_WIN32) && defined(HR_ENGINE_SHARED)
29 # ifdef MR_ENGINE
30 # define MR_DllDeclare __declspec( dllexport )
31 # else
32 # define MR_DllDeclare __declspec( dllimport )
33 # endif
34 #else
35 # define MR_DllDeclare
36 #endif
37 
38 namespace HoverRace {
39  namespace Display {
40  class SymbolIcon;
41  class TypeLine;
42  }
43 }
44 
45 namespace HoverRace {
46 namespace Display {
47 namespace SDL {
48 
53 class MR_DllDeclare SdlSymbolIconView : public SdlView<SymbolIcon>
54 {
56 
57 public:
59  virtual ~SdlSymbolIconView();
60 
61 public:
62  virtual void OnModelUpdate(int prop);
63 
64 public:
65  virtual Vec3 Measure();
66  virtual void PrepareRender();
67  virtual void Render();
68 
69 private:
70  void UpdateTexture();
71 
72 private:
73  std::unique_ptr<TypeLine> typeLine;
74  int width;
75  int height;
76  double unscaledWidth;
78  boost::signals2::scoped_connection uiScaleChangedConnection;
79 };
80 
81 } // namespace SDL
82 } // namespace Display
83 } // namespace HoverRace
84 
85 #undef MR_DllDeclare
SDL view for SymbolIcon.
Definition: SdlSymbolIconView.h:53
#define MR_DllDeclare
Definition: SdlSymbolIconView.h:35
double unscaledHeight
Definition: SdlSymbolIconView.h:77
boost::signals2::scoped_connection uiScaleChangedConnection
Definition: SdlSymbolIconView.h:78
int height
Definition: SdlSymbolIconView.h:75
One of the predefined icons from the symbol font.
Definition: SymbolIcon.h:49
Definition: Announcement.h:24
Definition: Vec.h:114
int width
Definition: SdlSymbolIconView.h:74
double unscaledWidth
Definition: SdlSymbolIconView.h:76
Base class for views that use SDL for rendering.
Definition: SdlView.h:54
SDL-based software rendering.
Definition: SdlDisplay.h:60
std::unique_ptr< TypeLine > typeLine
Definition: SdlSymbolIconView.h:73