# place-holder use util typedef void Display typedef long colour colour coln(char *name) use(name) return 0 line(num x0, num y0, num x1, num y1) use(x0) ; use(y0) ; use(x1) ; use(y1) gprint(cstr s) use(s) num font_height() return 0 # polygon stuff from mingw / GL version struct polygon GLdouble *points int n_points int space typedef struct polygon polygon polygon_init(struct polygon *p, int n_points_estimate) p->points = Malloc(n_points_estimate * sizeof(GLdouble)*3) p->n_points = 0 p->space = n_points_estimate # should be `local' (static) but it's not working right, # 1. brace doesn't insert void automatically if there's a `local' # 2. brace_header extracts static / local functions too _polygon_point(struct polygon *p, double x, double y) if p->n_points == p->space p->space = p->n_points * 2 Realloc(p->points, p->space * sizeof(GLdouble)*3) GLdouble *point = p->points + p->n_points * 3 point[0] = x point[1] = y point[2] = 0 ++p->n_points polygon_point(struct polygon *p, double x, double y) num X, Y SXYR(X, Y, x, y) _polygon_point(p, X, Y) polygon_draw(struct polygon *p) use(p) polygon_draw_curve(struct polygon *p) use(p) polygon_fill(struct polygon *p) use(p) polygon_end(struct polygon *p) Free(p->points) clear() . gr_sync() . def with_pixel_type(macro) # assuming 24/32 bpp macro(uint32_t) paint_sync(int syncage) use(syncage) colour rgb(double red, double green, double blue) colour c = pixn_rgb_safe(red, green, blue) return col(c) colour col(colour c) return c gr_flush() . gr_free() . def SXYR(sx, sy, x, y) sxy(sx, sy, x, y) sx += 0.5 ; sy += 0.5