From: Derek Foreman Date: Fri, 30 May 2003 04:41:59 +0000 (+0000) Subject: add font rendering X-Git-Tag: gl2~17 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=81329265681c48cca95625a2b2c4246bd2d5e9a0;p=dana%2Fopenbox.git add font rendering --- diff --git a/render2/planar.c b/render2/planar.c index 62684e47..d1c8b910 100644 --- a/render2/planar.c +++ b/render2/planar.c @@ -1,7 +1,11 @@ #include "planar.h" #include "surface.h" +#include "texture.h" +#include "glft/glft.h" #include "color.h" #include "debug.h" +#include "font.h" +#include #include void RrPlanarSet(struct RrSurface *sur, @@ -67,6 +71,7 @@ void RrPlanarPaint(struct RrSurface *sur, int absx, int absy) { struct RrColor *pri, *sec, avg; int x, y, w, h; + int i; copy_parent(sur); @@ -284,6 +289,25 @@ void RrPlanarPaint(struct RrSurface *sur, int absx, int absy) glEnd(); break; } + for (i = 0; i < sur->ntextures; i++) { + struct RrTextureText *t; + glEnable(GL_TEXTURE_2D); + switch (sur->texture[i].type) { + case RR_TEXTURE_TEXT: + t = &sur->texture[i].data.text; + printf("text %s\n", t->string); + glColor3f(1.0, 1.0, 1.0); + if (t->font == NULL) { + glDisable(GL_TEXTURE_2D); + return; + } + GlftRenderString(t->font->font, t->string, + strlen(t->string), 0, 0); + + break; + } + } + glDisable(GL_TEXTURE_2D); } void RrPlanarMinSize(struct RrSurface *sur, int *w, int *h)