28 #include <Eigen/Dense> 70 color << 0.0, 0.8, 0.8, 1.0;
97 elements.push_back(el);
146 for (
unsigned int i = 0; i < elements.size(); ++i)
148 elements[i]->render(camera_2d, shader);
Eigen::Vector2i dimensions
Dimensions in pixels.
Definition: element.hpp:66
Eigen::Vector2i position
Position of top-left corner in pixels.
Definition: element.hpp:69
Base class for all GUI elements (buttons, sliders ...)
Definition: element.hpp:52
void getViewMatrix(GLdouble *matrix)
Return the modelview matrix as a GLdouble array.
Definition: camera.hpp:126
virtual void setModelMatrix(void)
Sets the element model matrix.
Definition: element.hpp:195
Tucano::Texture texture
Element texture.
Definition: element.hpp:75
void getProjectionMatrix(GLdouble *matrix)
Return the projection matrix as a GLdouble array.
Definition: camera.hpp:142
Definition: bufferobject.hpp:34
void bind(int texture_unit)
Binds the texture to a given unit. Note that if there is another texture already binded to this unit...
Definition: texture.hpp:285
int getType(void)
Returns the element type.
Definition: groupbox.hpp:105
void render(Tucano::Camera &camera_2d, Shader &shader)
Renders the groupbox and all elements inside.
Definition: groupbox.hpp:124
A Shader object represents one GLSL program.
Definition: shader.hpp:45
GroupBox(void)
Default constructor.
Definition: groupbox.hpp:56
The gui group box is just a placeholder for other gui elements. It can be used to group elements...
Definition: groupbox.hpp:41
bool visible
Flag to show/hide element.
Definition: element.hpp:98
Eigen::Vector4f color
Color.
Definition: groupbox.hpp:46
GroupBox(int w, int h, int x, int y, string texture)
Overload constructor that receives dimensions and texture file.
Definition: groupbox.hpp:86
Definition: element.hpp:43
void setColor(const Eigen::Vector4f &c)
Sets the button color.
Definition: groupbox.hpp:114
int num_params
Number of parameters for the callback.
Definition: element.hpp:60
void unbind(void)
Disables the shader program.
Definition: shader.hpp:1184
Eigen::Affine3f model_matrix
Model Matrix for placing element.
Definition: element.hpp:63
vector< Tucano::GUI::Element * > elements
Vector containing gui elements inside box.
Definition: groupbox.hpp:49
virtual void unbindBuffers(void)
Unbinds all buffers.
Definition: mesh.hpp:702
virtual void setTexture(string file)
Loads the button texture file.
Definition: element.hpp:173
void add(Element *el)
Adds an element to the gui.
Definition: groupbox.hpp:95
int element_type
Type of element.
Definition: element.hpp:57
void bind(void)
Enables the shader program for usage.
Definition: shader.hpp:1176
GroupBox(int w, int h, int x, int y)
Overload Constructor.
Definition: groupbox.hpp:68
vector< Tucano::GUI::Element * > * elementList(void)
Definition: groupbox.hpp:100
virtual void renderElements(void)
Call the draw method for rendering triangles. This method requires that a index buffer has been creat...
Definition: mesh.hpp:726
virtual void bindBuffers(void)
Binds all buffers.
Definition: mesh.hpp:677
Defines an abstract camera with a projection and view matrices.
Definition: camera.hpp:37
void setAttributeLocation(Shader *shader)
Automatically sets the attribute locations for a given Shader.
Definition: mesh.hpp:541
Shapes::Quad quad
Quad to hold texture.
Definition: element.hpp:72
void unbind(void)
Unbinds this texture and frees the texture unit.
Definition: texture.hpp:367
void setUniform(GLint location, GLint a, GLint b, GLint c, GLint d)
Sets an uniform integer 4D vector (ivec4) given a location and the vector values. ...
Definition: shader.hpp:1258