openMSX
OSDRectangle.hh
Go to the documentation of this file.
1 #ifndef OSDRECTANGLE_HH
2 #define OSDRECTANGLE_HH
3 
4 #include "OSDImageBasedWidget.hh"
5 #include <memory>
6 
7 namespace openmsx {
8 
9 class BaseImage;
10 
11 class OSDRectangle final : public OSDImageBasedWidget
12 {
13 public:
14  OSDRectangle(Display& display, const TclObject& name);
15 
16  std::vector<std::string_view> getProperties() const override;
17  void setProperty(Interpreter& interp,
18  std::string_view name, const TclObject& value) override;
19  void getProperty(std::string_view name, TclObject& result) const override;
20  std::string_view getType() const override;
21 
22 private:
23  bool takeImageDimensions() const;
24 
25  gl::vec2 getSize(const OutputSurface& output) const override;
26  uint8_t getFadedAlpha() const override;
27  std::unique_ptr<BaseImage> createSDL(OutputSurface& output) override;
28  std::unique_ptr<BaseImage> createGL (OutputSurface& output) override;
29  template <typename IMAGE> std::unique_ptr<BaseImage> create(
30  OutputSurface& output);
31 
32  std::string imageName;
33  gl::vec2 size, relSize;
34  float scale, borderSize, relBorderSize;
35  unsigned borderRGBA;
36 };
37 
38 } // namespace openmsx
39 
40 #endif
OSDRectangle(Display &display, const TclObject &name)
Definition: OSDRectangle.cc:22
Represents the output window/screen of openMSX.
Definition: Display.hh:31
A frame buffer where pixels can be written to.
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
std::vector< std::string_view > getProperties() const override
Definition: OSDRectangle.cc:29
void getProperty(std::string_view name, TclObject &result) const override
std::string_view getType() const override
void setProperty(Interpreter &interp, std::string_view name, const TclObject &value) override
Definition: OSDRectangle.cc:40