1 #ifndef ALLOFW_GRAPHICS_H 2 #define ALLOFW_GRAPHICS_H 15 class GraphicalBackend;
69 virtual Path2D* path() = 0;
72 virtual void destroyPath(
Path2D* path) = 0;
73 virtual void destroyPaint(
Paint2D* paint) = 0;
78 virtual void drawText(
const char* text,
double x,
double y,
Paint2D* paint) = 0;
80 virtual void drawLine(
double x1,
double y1,
double x2,
double y2,
Paint2D* paint) = 0;
82 virtual void drawCircle(
double x,
double y,
double radius,
Paint2D* paint) = 0;
87 virtual void drawSurface(
Surface2D* surface,
double x,
double y,
Paint2D* paint) = 0;
90 virtual void rotate(
double radius) = 0;
91 virtual void translate(
double tx,
double ty) = 0;
92 virtual void scale(
double tx,
double ty) = 0;
93 virtual void concatTransform(
const Matrix3d& matrix) = 0;
94 virtual void setTransform(
const Matrix3d& matrix) = 0;
95 virtual Matrix3d getTransform()
const = 0;
98 virtual void clear(
const Color& color) = 0;
101 virtual void reset() = 0;
104 virtual void flush() = 0;
107 virtual State getState()
const = 0;
108 virtual void setState(
const State& state) = 0;
111 virtual void save() = 0;
112 virtual void restore() = 0;
128 virtual void moveTo(
double x,
double y) = 0;
130 virtual void lineTo(
double x,
double y) = 0;
132 virtual void bezierCurveTo(
double c1x,
double c1y,
double c2x,
double c2y,
double x,
double y) = 0;
134 virtual void circle(
double x,
double y,
double radius) = 0;
137 virtual void arc(
double x,
double y,
double radius,
double angle1,
double angle2) = 0;
140 virtual void close() = 0;
149 virtual void setMode(
const PaintMode& mode) = 0;
152 virtual void setColor(
const Color& color) = 0;
153 virtual void setStrokeWidth(
double value) = 0;
154 virtual void setLineCap(
LineCap value) = 0;
155 virtual void setLineJoin(
LineJoin value) = 0;
158 virtual void setTextSize(
double value) = 0;
159 virtual void setTextAlign(
TextAlign align) = 0;
163 virtual double measureText(
const char* text) = 0;
166 virtual void setColorMatrix(
double matrix[20]) = 0;
167 virtual void setColorMatrixScaleAlpha(
double a) = 0;
168 virtual void setColorMatrixScale(
double r,
double g,
double b,
double a) = 0;
182 virtual int width()
const = 0;
183 virtual int height()
const = 0;
184 virtual const void* pixels()
const = 0;
189 virtual void bindTexture(
unsigned int unit) = 0;
190 virtual void uploadTexture() = 0;
191 virtual void unbindTexture(
unsigned int unit) = 0;
202 virtual int width()
const = 0;
203 virtual int height()
const = 0;
205 virtual bool nextFrame() = 0;
207 virtual void seek(
double time) = 0;
208 virtual double fps() = 0;
209 virtual double duration() = 0;
212 virtual void setPixelBuffer(
void* buffer) = 0;
214 virtual const void* pixels()
const = 0;
224 virtual Surface2D* createSurface2D(
int width,
int height) = 0;
226 virtual Surface2D* createSurface2DWithPixels(
int width,
int height,
void* pixels) = 0;
228 virtual Surface2D* createPDFSurface2D(
int width,
int height) = 0;
232 virtual Surface2D* createSurface2DFromImage(
const void* data,
size_t length) = 0;
236 virtual VideoSurface2D* createVideoSurface2DFromFile(
const char* path) = 0;
241 virtual void destroySurface2D(
Surface2D* surface) = 0;
Matrix3d transform
Definition: graphics.h:65
Definition: graphics.h:220
Color struct.
Definition: color.h:9
PaintMode
Definition: graphics.h:42
TransferMode
Definition: graphics.h:48
TextAlign
Definition: graphics.h:36
Definition: graphics.h:118
Definition: graphics.h:58
LineCap
Definition: graphics.h:17
Definition: geometry.h:16
Definition: graphics.h:178
Definition: graphics.h:199
Definition: graphics.h:64
Definition: graphics.h:123
FontStyle
Definition: graphics.h:29
LineJoin
Definition: graphics.h:23
Definition: graphics.h:146