Background class reference
Widget, displays a solid color area. It can be used as a background in sub-widgets or windows.
Specifying a nullptr value as a window is prohibited.
Example (using widget as background for window):
Window window(nullptr, "Bg test", { {250,100}, {980,620}, WindowFlags::AutoInvokeRender});
Background bg(&window, {{0,0}, {0,0}, ResizePolicy::AutoFill});
Functions
Functions documentation
Background(Window* window, constWidget2DProps& props, constBackgroundTheme& rectProps);
Default constructor.
Background(Window* window, constWidget2DProps& props, constTheme& theme);
Delegating constructor with theme application.
Background(constBackground& copy);
Copy constructor.
virtual ~Background();
Destructor.
Background& operator=(Backgroundrhs);
Assignment operator.
friend void swap(Background& first,Background& second) noexcept;
Swap function.
Background* 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 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
BackgroundThemem_RectangleTheme;
Stores information about widget theme.
GLuint m_VertexArrayId;OpenGL Vertex Array Object
GLuint m_VertexBufferId;OpenGL Vertex Buffer object