Blame src/drawing.h

3f9996
#ifndef HELI_DRAWING_H
3f9996
#define HELI_DRAWING_H
3f9996
3f9996
3f9996
#include "common.h"
deef1d
#include "animation.h"
deef1d
deef1d
deef1d
typedef enum _StateFlags {
deef1d
	STATE_FILL_COLOR     = 1 << 0,
deef1d
	STATE_FILL_TEXTURE   = 1 << 1,
deef1d
	
deef1d
	STATE_STROKE_COLOR   = 1 << 2,
deef1d
	STATE_STROKE_TEXTURE = 1 << 3,
deef1d
	STATE_STROKE_WIDTH   = 1 << 4,
deef1d
	
deef1d
	STATE_TEXT_ALIGN     = 1 << 5,
deef1d
	STATE_TEXT_SIZE      = 1 << 6,
deef1d
	STATE_TEXT_FONT      = 1 << 7,
deef1d
	   
deef1d
	STATE_TRANSFORM      = 1 << 8,
deef1d
	STATE_CLIP           = 1 << 9,
deef1d
	
deef1d
	
deef1d
	STATE_FILL   = STATE_FILL_COLOR
deef1d
	             | STATE_FILL_TEXTURE,
deef1d
	STATE_STROKE = STATE_STROKE_COLOR
deef1d
	             | STATE_STROKE_TEXTURE
deef1d
	             | STATE_STROKE_WIDTH,
deef1d
	STATE_TEXT   = STATE_TEXT_ALIGN
deef1d
	             | STATE_TEXT_SIZE
deef1d
	             | STATE_TEXT_FONT,
deef1d
	
deef1d
	STATE_ALL    = STATE_FILL
deef1d
	             | STATE_STROKE
deef1d
	             | STATE_TEXT
deef1d
	             | STATE_TRANSFORM
deef1d
	             | STATE_CLIP,
deef1d
} StateFlags;
3f9996
3c0f7f
d4e89f
void background(unsigned int colorCode);
3954ba
d4e89f
void fill(unsigned int colorCode);
deef1d
void fillTexture(Animation animation, double x, double y, double width, double height, int fixed);
3f9996
void noFill();
d4e89f
void stroke(unsigned int colorCode);
deef1d
void strokeTexture(Animation animation, double x, double y, double width, double height, int fixed);
3f9996
void noStroke();
deef1d
void strokeWidth(double width);
3954ba
8bc1f1
void translate(double x, double y);
8bc1f1
void rotate(double angle);
8bc1f1
void zoom(double z);
8bc1f1
void scale(double x, double y);
8bc1f1
void cliprect(double x, double y, double width, double height);
8bc1f1
void noClip();
8bc1f1
deef1d
void saveState();
deef1d
void saveStateEx(unsigned int flags);
deef1d
void restoreState();
3954ba
d4e89f
unsigned int colorByName(const char *colorName);
d4e89f
unsigned int colorByRGB(double r, double g, double b);
d4e89f
unsigned int colorByRGBA(double r, double g, double b, double a);
3954ba
3f9996
void rect(double x, double y, double width, double height);
3f9996
void ellipse(double x, double y, double width, double height);
3f9996
void arc(double x, double y, double w, double h, double start, double stop);
07b70f
void arcPath(double x, double y, double w, double h, double start, double stop);
07b70f
void line(double x1, double y1, double x2, double y2);
3f9996
void point(double x, double y);
3f9996
void regularPolygon(double x, double y, int sides, double size);
07b70f
3f9996
void moveTo(double x, double y);
3f9996
void lineTo(double x, double y);
07b70f
void resetPath();
07b70f
void closePath();
07b70f
void strokePath();
3f9996
3f9996
3f9996
#endif
3f9996