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
openmsx::OSDRectangle::getProperty
void getProperty(std::string_view name, TclObject &result) const override
Definition: OSDRectangle.cc:105
openmsx::OSDRectangle::setProperty
void setProperty(Interpreter &interp, std::string_view name, const TclObject &value) override
Definition: OSDRectangle.cc:40
openmsx::OSDRectangle::OSDRectangle
OSDRectangle(Display &display, const TclObject &name)
Definition: OSDRectangle.cc:22
openmsx::OSDImageBasedWidget
Definition: OSDImageBasedWidget.hh:12
openmsx::OSDRectangle::getProperties
std::vector< std::string_view > getProperties() const override
Definition: OSDRectangle.cc:29
gl::vecN
Definition: gl_vec.hh:35
openmsx::Display
Represents the output window/screen of openMSX.
Definition: Display.hh:31
OSDImageBasedWidget.hh
openmsx::OutputSurface
A frame buffer where pixels can be written to.
Definition: OutputSurface.hh:19
openmsx::TclObject
Definition: TclObject.hh:21
openmsx::Interpreter
Definition: Interpreter.hh:16
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
openmsx::OSDRectangle
Definition: OSDRectangle.hh:11
openmsx::OSDRectangle::getType
std::string_view getType() const override
Definition: OSDRectangle.cc:130