Triangles/src/shape.hpp
Stephen Seo 2919be2aff WIP Replace SFML with Raylib
Need to fix Raygui usage in helpers.hpp.
Need to fix triangles being drawn flipped over the x-axis.
2021-03-29 17:05:27 +09:00

38 lines
822 B
C++

#ifndef TRIANGLES_SHAPE_HPP
#define TRIANGLES_SHAPE_HPP
#include <vector>
#include <raylib.h>
#include <glm/glm.hpp>
namespace Tri {
struct Shape {
Shape();
Shape(Color fillColor);
Shape(Color fillColor, Color outlineColor);
virtual ~Shape() {}
glm::mat3 transform;
Color fillColor;
Color outlineColor;
Shape& resetTransform();
Shape& translate(const glm::vec2 move);
Shape& rotate(const float angle);
Shape& scale(const glm::vec2 scale);
virtual Shape& draw() = 0;
virtual void getVertices(std::vector<glm::vec2> &verticesOut) const = 0;
virtual void getTransformedVertices(std::vector<glm::vec2> &verticesOut) const = 0;
virtual float getRadius() const = 0;
virtual void setRadius(float radius) = 0;
}; // struct Shape
} // namespace Tri
#endif