{
struct RrInstance *inst;
struct RrSurface *p;
- int ok;
+ int ok, i;
int surx, sury;
GSList *it;
break;
}
+ for (i = 0; i < sur->ntextures; ++i)
+ RrTexturePaint(sur, &sur->texture[i]);
+
glXSwapBuffers(RrDisplay(inst), RrSurfaceWindow(sur));
}
#include "planar.h"
#include "surface.h"
#include "texture.h"
-#include "glft/glft.h"
#include "color.h"
#include "debug.h"
#include "font.h"
{
struct RrColor *pri, *sec, avg;
int x, y, w, h;
- int i;
copy_parent(sur);
glEnd();
break;
}
- for (i = 0; i < sur->ntextures; i++) {
- struct RrTextureText *t;
- glEnable(GL_TEXTURE_2D);
- switch (sur->texture[i].type) {
- case RR_TEXTURE_NONE:
- break;
- 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)
#include "instance.h"
#include "texture.h"
#include "surface.h"
+#include "font.h"
+#include "glft/glft.h"
#include <stdlib.h>
+#include <assert.h>
#include <string.h>
void RrTextureFreeContents(struct RrTexture *tex)
if (!tex) return;
RrTextureFreeContents(tex);
}
+
+void RrTexturePaint(struct RrSurface *sur, struct RrTexture *tex)
+{
+ struct GlftColor col;
+
+ glEnable(GL_TEXTURE_2D);
+
+ switch (tex->type) {
+ case RR_TEXTURE_NONE:
+ break;
+ case RR_TEXTURE_TEXT:
+ printf("text %s\n", tex->data.text.string);
+ assert(tex->data.text.font);
+ col.r = tex->data.text.color.r;
+ col.g = tex->data.text.color.g;
+ col.b = tex->data.text.color.b;
+ col.a = tex->data.text.color.a;
+ GlftRenderString(tex->data.text.font->font, tex->data.text.string,
+ strlen(tex->data.text.string), &col, 0, 0);
+ break;
+ }
+ glDisable(GL_TEXTURE_2D);
+}
union RrTextureData data;
};
+void RrTexturePaint(struct RrSurface *sur, struct RrTexture *tex);
+
#endif