Blame src/drawing.h

3f9996
#ifndef HELI_DRAWING_H
3f9996
#define HELI_DRAWING_H
3f9996
3f9996
3f9996
#include "common.h"
7ac038
#include "colors.h"
deef1d
#include "animation.h"
deef1d
deef1d
deef1d
typedef enum _StateFlags {
d6f40c
	STATE_FILL_COLOR         = 1 <<  0,
d6f40c
	STATE_FILL_TEXTURE       = 1 <<  1,
deef1d
	
d6f40c
	STATE_STROKE_COLOR       = 1 <<  2,
d6f40c
	STATE_STROKE_TEXTURE     = 1 <<  3,
d6f40c
	STATE_STROKE_WIDTH       = 1 <<  4,
deef1d
	
d6f40c
	STATE_TEXT_ALIGN         = 1 <<  5,
d6f40c
	STATE_TEXT_SIZE          = 1 <<  6,
d6f40c
	STATE_TEXT_FONT          = 1 <<  7,
deef1d
	
d6f40c
	STATE_TARGET_FRAMEBUFFER = 1 <<  8,
d6f40c
	STATE_TARGET_VIEWPORT    = 1 <<  9,
d6f40c
	STATE_TARGET_PROJECTION  = 1 << 10,
d6f40c
	
d6f40c
	STATE_BACKGROUND         = 1 << 11,
d6f40c
	STATE_TRANSFORM          = 1 << 12,
d6f40c
	STATE_CLIP               = 1 << 13,
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,
1d641c
	STATE_TARGET = STATE_TARGET_FRAMEBUFFER
1d641c
	             | STATE_TARGET_VIEWPORT
1d641c
	             | STATE_TARGET_PROJECTION,
deef1d
	
deef1d
	STATE_ALL    = STATE_FILL
deef1d
	             | STATE_STROKE
deef1d
	             | STATE_TEXT
d6f40c
	             | STATE_TARGET
d6f40c
	             | STATE_BACKGROUND
deef1d
	             | STATE_TRANSFORM
1d641c
	             | STATE_CLIP
1d641c
	             | STATE_TARGET,
deef1d
} StateFlags;
3f9996
3c0f7f
d4e89f
void background(unsigned int colorCode);
d6f40c
void clear();
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);
ba5c91
void noTransform();
ba5c91
8bc1f1
void cliprect(double x, double y, double width, double height);
8bc1f1
void noClip();
8bc1f1
1d641c
void projectionByViewport();
1d641c
void viewportByFramebuffer(Framebuffer framebuffer);
1d641c
void viewportByWindow();
1d641c
void targetEx(Framebuffer framebuffer, int updateViewport, int updateProjection);
1d641c
void target(Framebuffer framebuffer);
1d641c
void noTarget();
1d641c
3e7c5f
void resetState();
3e7c5f
void resetStateEx(unsigned int flags);
deef1d
void saveState();
deef1d
void saveStateEx(unsigned int flags);
deef1d
void restoreState();
3954ba
1d641c
7ac038
unsigned int colorWithAlpha(unsigned int colorCode, double a);
7ac038
d4e89f
unsigned int colorByName(const char *colorName);
ca6bde
unsigned int colorByNameA(const char *colorName, double a);
d4e89f
unsigned int colorByRGB(double r, double g, double b);
d4e89f
unsigned int colorByRGBA(double r, double g, double b, double a);
1d641c
unsigned int colorByHSV(double h, double s, double v);
1d641c
unsigned int colorByHSVA(double h, double s, double v, double a);
1d641c
unsigned int colorByYUV(double y, double u, double v);
1d641c
unsigned int colorByYUVA(double y, double u, double v, double a);
1d641c
d6f40c
double colorGetRed(unsigned int colorCode);
d6f40c
double colorGetGreen(unsigned int colorCode);
d6f40c
double colorGetBlue(unsigned int colorCode);
d6f40c
double colorGetAlpha(unsigned int colorCode);
1d641c
d6f40c
double colorGetHue(unsigned int colorCode);
d6f40c
double colorGetSaturation(unsigned int colorCode);
d6f40c
double colorGetValue(unsigned int colorCode);
1d641c
d6f40c
double colorGetYLuminance(unsigned int colorCode);
d6f40c
double colorGetUChrominance(unsigned int colorCode);
d6f40c
double colorGetVChrominance(unsigned int colorCode);
1d641c
3954ba
3f9996
void rect(double x, double y, double width, double height);
f8dca4
void rectTextured(Animation animation, double x, double y, double width, double height);
3f9996
void ellipse(double x, double y, double width, double height);
788bd9
void circle(double x, double y, double radius);
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