JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
Namespaces | Functions
shapes.hpp File Reference

Functions for drawing shapes. More...

#include "Color.hpp"
#include "Vec2.hpp"
#include <cstdint>
Include dependency graph for shapes.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  jngl
 JNGL's main namespace.
 

Functions

void setColor (Rgb)
 Sets the color which should be used to draw primitives.
 
void setColor (Rgba)
 Sets the color (including alpha) which should be used to draw primitives.
 
void setColor (Rgb, unsigned char alpha)
 Sets the color and alpha which should be used to draw primitives.
 
void setColor (unsigned char red, unsigned char green, unsigned char blue)
 
void setColor (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha)
 
void setAlpha (uint8_t alpha)
 Sets the alpha value which should be used to draw primitives (0 = fully transparent, 255 = fully opaque)
 
void pushAlpha (unsigned char alpha)
 
void popAlpha ()
 
void setLineWidth (float width)
 
void drawLine (Vec2 start, Vec2 end)
 Draws a line from start to end, the width can be set using setLineWidth.
 
void drawLine (double xstart, double ystart, double xend, double yend)
 
void drawLine (Mat3 modelview, Vec2 start, Vec2 end)
 Draws a line from start to end.
 
void drawLine (const Mat3 &modelview, Vec2 end)
 Draws a line from (0, 0) to end.
 
void drawEllipse (float xmid, float ymid, float width, float height, float startAngle=0)
 
void drawEllipse (Vec2, float width, float height, float startAngle=0)
 
void drawEllipse (Mat3 modelview, float width, float height, float startAngle=0)
 
void drawCircle (Vec2, float radius, float startAngle=0)
 Angles in radian.
 
void drawCircle (Mat3 modelview, float radius, float startAngle)
 
void drawCircle (Mat3 modelview, float radius)
 
void drawCircle (Mat3 modelview, float radius, Rgba color)
 Draws a circle at (0, 0) with radius in color.
 
void drawCircle (Mat3 modelview, Rgba color)
 Draws a circle at (0, 0) with radius of 1 in color.
 
void drawPoint (double x, double y)
 
void drawTriangle (Vec2 a, Vec2 b, Vec2 c)
 Draws the triangle a -> b -> c.
 
void drawTriangle (double A_x, double A_y, double B_x, double B_y, double C_x, double C_y)
 
void drawRect (double xposition, double yposition, double width, double height)
 Draws a rectangle at { xposition, yposition }.
 
void drawRect (Vec2 position, Vec2 size)
 Draws a rectangle at position.
 
void drawRect (const Mat3 &modelview, Vec2 size, Rgb)
 Draws a rectangle spawning from (0, 0) to (size.x, size.y) with the specified color.
 
void drawRect (Mat3 modelview, Vec2 size, Rgba color)
 Draws a rectangle spawning from (0, 0) to (size.x, size.y) with the specified color.
 
void drawSquare (const Mat3 &modelview, Rgba color)
 Draws a square of size 1x1 centered at (0, 0) with the specified color.
 
template<class Vect >
void drawRect (Vect pos, Vect size)
 

Detailed Description

Functions for drawing shapes.

Definition in file shapes.hpp.