HoverRace  2.0
SdlWallpaperView.h
Go to the documentation of this file.
1 
2 // SdlWallpaperView.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 Wallpaper;
40  }
41 }
42 
43 namespace HoverRace {
44 namespace Display {
45 namespace SDL {
46 
51 class MR_DllDeclare SdlWallpaperView : public SdlView<Wallpaper>
52 {
54  public:
55  SdlWallpaperView(SdlDisplay &disp, Wallpaper &model);
56  virtual ~SdlWallpaperView() { }
57 
58  public:
59  void OnModelUpdate(int prop) override;
60 
61  public:
62  Vec3 Measure() override;
63  void PrepareRender() override;
64  void Render() override;
65 
66  private:
67  void Update();
68 
69  private:
73  SDL_Rect destRect;
74  const SDL_Rect *destRectPtr;
75  std::shared_ptr<SdlTexture> texture;
76  boost::signals2::connection displayConfigChangedConn;
77 };
78 
79 } // namespace SDL
80 } // namespace Display
81 } // namespace HoverRace
82 
83 #undef MR_DllDeclare
bool opacityChanged
Definition: SdlWallpaperView.h:71
Paints a texture across the entire screen.
Definition: Wallpaper.h:53
SDL_Rect destRect
Definition: SdlWallpaperView.h:73
SdlView< Wallpaper > SUPER
Definition: SdlWallpaperView.h:53
MR_UInt8 computedAlpha
Definition: SdlWallpaperView.h:72
#define MR_DllDeclare
Definition: SdlWallpaperView.h:34
bool fillChanged
Definition: SdlWallpaperView.h:70
SDL view for Wallpaper.
Definition: SdlWallpaperView.h:51
boost::signals2::connection displayConfigChangedConn
Definition: SdlWallpaperView.h:76
virtual ~SdlWallpaperView()
Definition: SdlWallpaperView.h:56
Definition: Announcement.h:24
Definition: Vec.h:114
const SDL_Rect * destRectPtr
Definition: SdlWallpaperView.h:74
uint8_t MR_UInt8
Definition: MR_Types.h:40
Base class for views that use SDL for rendering.
Definition: SdlView.h:54
SDL-based software rendering.
Definition: SdlDisplay.h:60
std::shared_ptr< SdlTexture > texture
Definition: SdlWallpaperView.h:75