iridescence
Loading...
Searching...
No Matches
drawable_container.hpp
Go to the documentation of this file.
1#ifndef GLK_DRAWABLE_CONTAINER_HPP
2#define GLK_DRAWABLE_CONTAINER_HPP
3
4#include <vector>
5#include <Eigen/Core>
6
7#include <glk/drawable.hpp>
8
9namespace guik {
10struct ShaderSetting;
11}
12
13namespace glk {
14
18public:
19 using Ptr = std::shared_ptr<Drawable>;
20 using ConstPtr = std::shared_ptr<const Drawable>;
21
24 DrawableContainer(bool skip_model_matrix_setting = true);
25
29 DrawableContainer(std::initializer_list<glk::Drawable::ConstPtr> init, bool skip_model_matrix_setting = true);
30
32
34 size_t size() const;
35
37 void clear();
38
41 void push_back(const glk::Drawable::ConstPtr& drawable);
42
46 void push_back(const glk::Drawable::ConstPtr& drawable, const guik::ShaderSetting& shader_setting);
47
48 virtual void draw(glk::GLSLShader& shader) const override;
49
50public:
52 std::vector<std::pair<std::optional<guik::ShaderSetting>, glk::Drawable::ConstPtr>> drawables;
53};
54
55} // namespace glk
56#endif
void push_back(const glk::Drawable::ConstPtr &drawable)
Add a drawable to the container.
size_t size() const
Number of drawables in the container.
DrawableContainer(std::initializer_list< glk::Drawable::ConstPtr > init, bool skip_model_matrix_setting=true)
Constructor.
DrawableContainer(bool skip_model_matrix_setting=true)
Constructor.
std::vector< std::pair< std::optional< guik::ShaderSetting >, glk::Drawable::ConstPtr > > drawables
Definition drawable_container.hpp:52
std::shared_ptr< const Drawable > ConstPtr
Definition drawable_container.hpp:20
virtual ~DrawableContainer()
void clear()
Clear all drawables in the container.
bool skip_model_matrix
Definition drawable_container.hpp:51
virtual void draw(glk::GLSLShader &shader) const override
std::shared_ptr< Drawable > Ptr
Definition drawable_container.hpp:19
void push_back(const glk::Drawable::ConstPtr &drawable, const guik::ShaderSetting &shader_setting)
Add a drawable to the container with a shader setting.
Definition drawable.hpp:12
std::shared_ptr< const Drawable > ConstPtr
Definition drawable.hpp:15
GLSLShader is a wrapper for OpenGL shader programs.
Definition glsl_shader.hpp:49
Definition async_buffer_copy.hpp:6
Definition drawable_container.hpp:9
Shader setting class that holds rendering settings.
Definition shader_setting.hpp:187