Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
Loading...
Searching...
No Matches
staticimg.hpp
Go to the documentation of this file.
1#pragma once
2
6#include "client/shader.hpp"
7
8#include <memory>
9
10namespace gui::widget {
11
12
21class StaticImg : public Widget {
22public:
23 using Ptr = std::unique_ptr<StaticImg>;
24 static std::unique_ptr<Shader> shader;
27
36 template <typename... Params>
37 static Ptr make(Params&&... params) {
38 return std::make_unique<StaticImg>(std::forward<Params>(params)...);
39 }
40
41 StaticImg(glm::vec2 origin, gui::img::Img img, float size = 1.0f);
42 explicit StaticImg(gui::img::Img img);
43 ~StaticImg();
44
46 void render() override;
47
48private:
50 GLuint quadVAO, VBO, EBO;
51 GLuint texture_id;
52};
53
54}
Definition: staticimg.hpp:21
float size_height
Definition: staticimg.hpp:26
static Ptr make(Params &&... params)
creates a StaticImg unique ptr widget
Definition: staticimg.hpp:37
void changeImage(gui::img::Img img)
Definition: staticimg.cpp:38
std::unique_ptr< StaticImg > Ptr
Definition: staticimg.hpp:23
static std::unique_ptr< Shader > shader
Definition: staticimg.hpp:24
~StaticImg()
Definition: staticimg.cpp:32
float size_width
Definition: staticimg.hpp:25
void render() override
======================================================================================
Definition: staticimg.cpp:43
Definition: widget.hpp:41
glm::vec2 origin
Origin position (bottom left) of the widget in GUI coordinates.
Definition: widget.hpp:217
unsigned int GLuint
Definition: glad.h:115
GLenum const GLfloat * params
Definition: glad.h:1522
GLint void * img
Definition: glad.h:1729
GLsizeiptr size
Definition: glad.h:1803
Definition: centertext.hpp:6
Definition: img.hpp:124