2#define GF_EXPOSE_TEXTURE
19void gf_graphic_fill_rect(
gf_draw_t* draw,
double x,
double y,
double w,
double h,
gf_graphic_color_t color) {
gf_graphic_fill_polygon(draw, color,
GF_GRAPHIC_2D, 4, x, y, x, y + h, x + w, y + h, x + w, y); }
26 if(draw->
font != NULL) {
28 for(i = 0; text[i] != 0; i++) {
32 double fx = glyph->
bbox.
x;
35 mx += zoom * glyph->
dwidth[0];
46 if(draw->
font != NULL) {
48 for(i = 0; text[i] != 0; i++) {
50 mx += zoom * glyph->
dwidth[0];
58 if(texture != NULL)
gf_graphic_draw_texture_polygon(draw, texture, color,
GF_GRAPHIC_2D, 4, 0.0, 0.0, x, y, 0.0, 1.0, x, y + h, 1.0, 1.0, x + w, y + h, 1.0, 0.0, x + w, y);
gf_font_glyph_t * gf_font_get(gf_font_t *font, int code)
Get glyph.
void gf_graphic_draw_texture_2d(gf_draw_t *draw, double x, double y, double w, double h, gf_texture_t *texture, gf_graphic_color_t color)
Draw rectangle with texture.
void gf_graphic_draw_texture_polygon(gf_draw_t *draw, gf_texture_t *texture, gf_graphic_color_t color, int dim, int npair,...)
Draw polygon with texture.
void gf_graphic_fill_rect(gf_draw_t *draw, double x, double y, double w, double h, gf_graphic_color_t color)
Draw filled rectangle.
void gf_graphic_fill_polygon(gf_draw_t *draw, gf_graphic_color_t color, int dim, int npair,...)
Draw polygon.
void gf_graphic_text(gf_draw_t *draw, double x, double y, double size, const char *text, gf_graphic_color_t color)
Draw text.
double gf_graphic_text_width(gf_draw_t *draw, double size, const char *text)
Calculate text width.
#define GF_GRAPHIC_2D
Dimension parameter for 2D.
Required headers before anything.
gf_font_t * font
Current font.
int dwidth[2]
Device width.
gf_font_bbox_t bbox
Bounding box.
gf_texture_t * texture
Texture.
gf_font_bbox_t bbox
Bounding box.