This file contains a set of graphics functions that closely mirror the ones available as MoSync syscalls. However, these functions make use of a transformation stack similar to ones commonly found in other graphics libraries. It simplifies managing transformations, removing the need to manually keep track of the current transformation state. Currently, only translation is supported.
#include <ma.h>
Defines | |
#define | _NO_OLDNAMES |
Functions | |
void | Gfx_clearClipRect (void) |
int | Gfx_restoreClipRect (void) |
int | Gfx_pushClipRect (int left, int top, int width, int height) |
int | Gfx_intersectClipRect (int left, int top, int width, int height) |
int | Gfx_popClipRect (void) |
void | Gfx_clearMatrix (void) |
void | Gfx_pushMatrix (void) |
void | Gfx_popMatrix (void) |
void | Gfx_translate (int x, int y) |
MAPoint2d | Gfx_getTranslation (void) |
int | Gfx_pushRect (int x, int y, int width, int height) |
int | Gfx_popRect (void) |
void | Gfx_plot (int x, int y) |
void | Gfx_line (int x1, int y1, int x2, int y2) |
void | Gfx_fillRect (int left, int top, int width, int height) |
void | Gfx_drawText (int left, int top, const char *text) |
void | Gfx_drawImage (MAHandle image, int left, int top) |
void | Gfx_drawRGB (const MAPoint2d *dstPoint, const void *src, const MARect *srcRect, int scanlength) |
void | Gfx_drawImageRegion (MAHandle image, const MARect *srcRect, const MAPoint2d *dstPoint, int transformMode) |
|
|
|
Clears the clip rect stack. |
|
Sets the clip rect to the content of the top of the stack without changing the stack. Returns true if the area of the restored clip rect is > 0, otherwise false. |
|
Pushes the specified clip rect on the stack and sets it as the current. Returns true if the area of the clip rect is > 0, otherwise false. |
|
Computes the intersection rectangle of the specified clip rect and the current, pushing the result on the stack. Returns true if the area of the resulting clip rect is > 0, otherwise false. |
|
Pops a clip rect off the stack and sets is as the current. Returns true if the area of the resulting clip rect is > 0, otherwise false. |
|
Clears the transform stack. |
|
Pushes the current transform on the stack |
|
Pops the previous transform off the stack |
|
Translates the current transform by x,y |
|
|
|
Combines clipping and translation.
|
|
|
|
Plots a pixel with the current color at x, y with respect to the current transform |
|
Draws a line with the current color from x1, y1 to x2, y2 with respect to the current transform |
|
Draws a line with the current color from x1, y1 to x2, y2 with respect to the current transform |
|
|
|
|
|
|
|
|