mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 04:21:50 +00:00
Plotter element
This commit is contained in:
parent
c92cb52e2a
commit
c82d95b97d
11 changed files with 176 additions and 71 deletions
37
src/graphics/ui/elements/Plotter.hpp
Normal file
37
src/graphics/ui/elements/Plotter.hpp
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#ifndef GRAPHICS_UI_ELEMENTS_PLOTTER_HPP_
|
||||
#define GRAPHICS_UI_ELEMENTS_PLOTTER_HPP_
|
||||
|
||||
#include "UINode.h"
|
||||
#include "../../../typedefs.h"
|
||||
|
||||
#include <memory>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
class Assets;
|
||||
class GfxContext;
|
||||
|
||||
namespace gui {
|
||||
class Plotter : public gui::UINode {
|
||||
std::unique_ptr<int[]> points;
|
||||
float multiplier;
|
||||
int index = 0;
|
||||
int dmwidth;
|
||||
int dmheight;
|
||||
int labelsInterval;
|
||||
public:
|
||||
Plotter(uint width, uint height, float multiplier, int labelsInterval)
|
||||
: gui::UINode(glm::vec2(width, height)),
|
||||
multiplier(multiplier),
|
||||
dmwidth(width-50),
|
||||
dmheight(height),
|
||||
labelsInterval(labelsInterval)
|
||||
{
|
||||
points = std::make_unique<int[]>(dmwidth);
|
||||
}
|
||||
|
||||
void act(float delta) override;
|
||||
void draw(const GfxContext* pctx, Assets* assets) override;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // GRAPHICS_UI_ELEMENTS_PLOTTER_HPP_
|
||||
Loading…
Add table
Add a link
Reference in a new issue