From 8541439e469ac205cd1d9f92cf1bd8bb2eff0ba7 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Thu, 29 May 2003 01:52:53 +0000 Subject: [PATCH] let's hear it for conics! --- glft/render.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/glft/render.c b/glft/render.c index 22297e0f..24e2245a 100644 --- a/glft/render.c +++ b/glft/render.c @@ -4,7 +4,7 @@ #include #include -#define TPOINTS 15.0 +#define TPOINTS 5.0 #define TOFLOAT(x) (((x) >> 6) + ((x) & 63)/64.0) @@ -24,23 +24,19 @@ int GlftMoveToFunc(FT_Vector *to, void *user) printf("move to %f:%f\n", state.x, state.y); if (state.drawing) { glEnd(); - state.drawing = 0; } + glBegin(GL_LINE_STRIP); + glVertex2f(state.x, state.y); + state.drawing = 1; return 0; } int GlftLineToFunc(FT_Vector *to, void *user) { - if (!state.drawing) { - glBegin(GL_LINES); - glVertex2f(state.x, state.y); - state.drawing = 1; - } else - glVertex2f(state.x, state.y); state.x = TOFLOAT(to->x); state.y = TOFLOAT(to->y); - printf("line to %f:%f\n", state.x, state.y); glVertex2f(state.x, state.y); + printf("line to %f:%f\n", state.x, state.y); return 0; } @@ -51,11 +47,11 @@ int GlftConicToFunc(FT_Vector *c, FT_Vector *to, void *user) for (t = 0, u = 1; t < 1.0; t += 1.0/TPOINTS, u = 1.0-t) { x = u*u*state.x + 2*t*u*TOFLOAT(c->x) + t*t*TOFLOAT(to->x); y = u*u*state.y + 2*t*u*TOFLOAT(c->y) + t*t*TOFLOAT(to->y); -/*printf("cone to %f, %f (%f, %f)\n", x, y, t, u);*/ glVertex2f(x, y); } state.x = TOFLOAT(to->x); state.y = TOFLOAT(to->y); + glVertex2f(state.x, state.y); printf("conic the hedgehog!\n"); return 0; } -- 2.39.2