shapes

v0.0.6
circle(x, y, d);

Draw a circle to the opengl context

Arguments

xThe x position of the circle
yThe y position of the circle
dThe diameter of the circle


rect(x, y, w, h);

Draw a rectangle to the opengl context

Arguments

xThe x position of the reactangle
yThe y position of the reactangle
wThe width
hThe height


square(x, y, s);

Draw a square to the opengl context

Arguments

xThe x position of the square
yThe y position of the square
sThe size of the square


line(x1, y1, x2, y2);

Draw a line to the opengl context

Arguments

x1The x position of the first point
y1The y position of the first point
x2The x position of the second point
y2The y position of the second point


quad(x1, y1, x2, y2, x3, y3, x4, y4);

Draw a quad on the screen

Arguments

x1The x position of the first point
y1The y position of the first point
x2The x position of the second point
y2The y position of the second point
x3The x position of the third point
y3The y position of the third point
x4The x position of the fourth point
y4The y position of the fourth point


point();

Draw a point on the screen


arc();

Draw an arc on the screen


ellipse();

Draw an ellipse on the screen


triangle();

Draw a triangle on the screen


beginShape(mode);

Begin adding vertices to a custom shape

Arguments

modeThe opengl shape mode LINES, POINTS, QUADS, TRIANGLES, TRIANGLE_FAN

The following would draw a 100 by 100 square at position 100, 100 The following would draw a 100 by 100 square at position 100, 100

 beginShape(QUADS);
   vertex(100, 100);
   vertex(100, 200);
   vertex(200, 200);
   vertex(200, 100);
 endShape();

vertex(x, y);

beginShape must be called prior
Adding a vertex to a custom shape

Arguments

xThe x position
yThe y position


endShape();

beginShape must be called prior
Close the custom shape