4#include "../mygl_export.h" 
    6#include "AbstractShape.hpp" 
    8#include <unordered_map> 
   23            std::vector<float> vertices;
 
   24            std::vector<unsigned int> indices;
 
   27        static std::unordered_map<unsigned int, const GLinfo> buffers;
 
   29        const GLinfo* p_buffer;
 
   36        static void computeVertices(
unsigned int sides, GLinfo& buffer);
 
   42        static void glInit(
unsigned int sides);
 
   49        virtual std::vector<glm::vec2> points() 
const override;
 
   62        MYGL_EXPORT 
Polygon(
unsigned int sides, 
int radius);
 
   72        MYGL_EXPORT 
Polygon(
unsigned int sides, 
int radius, 
int x, 
int y);
 
   88        MYGL_EXPORT 
virtual void draw(
const glm::mat4& lookAt, 
const glm::mat4& projection) 
const override;
 
 
Class inherited by all the shapes, it defines common operations on a shape.
Class for creating regular polygons of 3 or more sides.
MYGL_EXPORT ~Polygon() override
Default destructor.
MYGL_EXPORT void setSides(unsigned int sides)
Changes the number of sides of a polygon.
MYGL_EXPORT Polygon()
Creates a triangle of radius 10.
virtual MYGL_EXPORT void draw(const glm::mat4 &lookAt, const glm::mat4 &projection) const override
Draws a polygon, this method is called by a window.
MYGL_EXPORT Polygon(unsigned int sides, int radius, int x, int y)
Creates a n-sided regular polygon with the specified radius and places its center at (x,...
MYGL_EXPORT Polygon(unsigned int sides, int radius)
Creates a n-sided regular polygon with the specified radius.
Namespace containing every class, function and enum of the library.