Pioneer
GuiImage.h
Go to the documentation of this file.
1 // Copyright © 2008-2021 Pioneer Developers. See AUTHORS.txt for details
2 // Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
3 
4 #ifndef _GUIIMAGE_H
5 #define _GUIIMAGE_H
6 
7 #include "Color.h"
8 #include "GuiTexturedQuad.h"
9 #include "GuiWidget.h"
10 
11 namespace Gui {
12  class Image : public Widget {
13  public:
14  Image(const char *filename);
15  Image(const char *filename, float renderWidth, float renderHeight);
16  virtual void Draw();
17  virtual void GetSizeRequested(float size[2]);
18  void SetModulateColor(const Color &color) { m_color = color; }
19  void SetRenderDimensions(const float wide, const float high);
20 
21  private:
22  void InitTexture(const char *filename);
23  std::unique_ptr<TexturedQuad> m_quad;
24  Color m_color;
25  float m_width, m_height;
26  };
27 } // namespace Gui
28 
29 #endif /* _GUIIMAGE_H */
Definition: GuiImage.h:12
Image(const char *filename)
Definition: GuiImage.cpp:11
virtual void GetSizeRequested(float size[2])
Definition: GuiImage.cpp:40
virtual void Draw()
Definition: GuiImage.cpp:52
void SetModulateColor(const Color &color)
Definition: GuiImage.h:18
void SetRenderDimensions(const float wide, const float high)
Definition: GuiImage.cpp:46
Definition: GuiWidget.h:14
Definition: Gui.cpp:10
Definition: Color.h:66