HoverRace  2.0
SdlSliderView.h
Go to the documentation of this file.
1 
2 // SdlSliderView.h
3 //
4 // Copyright (c) 2014 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 "SdlView.h"
26 
27 #if defined(_WIN32) && defined(HR_ENGINE_SHARED)
28 # ifdef MR_ENGINE
29 # define MR_DllDeclare __declspec( dllexport )
30 # else
31 # define MR_DllDeclare __declspec( dllimport )
32 # endif
33 #else
34 # define MR_DllDeclare
35 #endif
36 
37 namespace HoverRace {
38  namespace Display {
39  class Slider;
40  }
41 }
42 
43 namespace HoverRace {
44 namespace Display {
45 namespace SDL {
46 
51 class MR_DllDeclare SdlSliderView : public SdlView<Slider>
52 {
54 
55 public:
56  SdlSliderView(SdlDisplay &disp, Slider &model) :
57  SUPER(disp, model) { }
58  virtual ~SdlSliderView() { }
59 
60 public:
61  void OnModelUpdate(int) override { }
62 
63 public:
64  Vec2 GetScreenPos() const override;
65  Vec2 GetScreenSize() const override;
66  Vec3 Measure() override;
67  void PrepareRender() override;
68  void Render() override;
69 };
70 
71 } // namespace SDL
72 } // namespace Display
73 } // namespace HoverRace
74 
75 #undef MR_DllDeclare
SdlSliderView(SdlDisplay &disp, Slider &model)
Definition: SdlSliderView.h:56
Definition: Vec.h:38
A slider for selecting values from a range.
Definition: Slider.h:52
virtual ~SdlSliderView()
Definition: SdlSliderView.h:58
SDL view for value select sliders.
Definition: SdlSliderView.h:51
void OnModelUpdate(int) override
Called by the view model to indicate that a property has changed.
Definition: SdlSliderView.h:61
Definition: Announcement.h:24
Definition: Vec.h:114
#define MR_DllDeclare
Definition: SdlSliderView.h:34
Base class for views that use SDL for rendering.
Definition: SdlView.h:54
SDL-based software rendering.
Definition: SdlDisplay.h:60