Image class reference
Widget that displays an image that uses a loaded texture. Example:
Window window(nullptr, "Image test", { {250,100}, {980,620}, WindowFlags::AutoInvokeRender});
Texture texture("path.png");
Image image(&window, {{500, 250}, {0, 0}, ImageFlags::DetectSize}, ImageTheme(), &texture);
Functions
Functions documentation
Image(Window* window, constWidget2DProps& props =Widget2DProps({ 0,0 }, { 0,0 },Anchor::Left |Anchor::Bottom |ImageFlags::DetectSize), constImageTheme& spriteProps =ImageTheme(),Texture* texture = nullptr );
Default constructor. Specifying a nullptr value as a texture is prohibited.
Image(Window* window, constWidget2DProps& props, constTheme& theme,Texture* texture);
Delegating constructor with theme application.
virtual ~Image();
Destructor.
Image* Clone() const override;
Clones the object (usefull while making copy of object that is casted to its base).
constColor& GetColor() const;
Returns the color of the widget.
void SetColor(Colorcolor);
Sets the color of the widget.
constColor& GetBorderColor() const;
Returns the border color of the widget.
void SetBorderColor(Colorcolor);
Sets the border color of the widget.
constDimension<int>& GetBorderSize() const;
Returns the border size of the widget.
void SetBorderSize(Dimension<int> newBorderSize);
Sets the widget border size.
void SetTexture(Texture* newTexture);
Sets a new texture. New texture should not be nullptr. The widget will recalculate its dimensions according to flags.
constTexture* GetTexture() const;
Returns a pointer to the used texture.
void Render() override;Renders the widget.
void CreateBuffers();Creates OpenGL VAO and VBO.
void BindBuffers() override;Binds the filled-in data arrays that are used in the rendering process.
void Cleanup();Deletes OpenGL VAO and VBO.
Variables documentation
ImageThemem_ImageTheme;
Stores information about widget theme.
GLuint m_VertexArrayId;OpenGL Vertex Array object.
GLuint m_VertexBufferId;OpenGL Vertex Buffer object.
GLuint m_UvBufferId;OpenGL UV Buffer object.