[SDL] Problems with text rendering using TTF
Nuno Santos
developer at imaginando.net
Sun Dec 3 07:34:10 PST 2006
Here it goes, a little bit in the render function;
glCallList(images[0]);
drawCubeFace(1.024,0.768,6);
SDL_GL_Enter2DMode();
int x,y,w,h;
x = 100;
y = 100;
w = text->w;
h = text->h;
printf("x:%d y:%d w:%d h:%d\n",x,y,w,h);
glBindTexture(GL_TEXTURE_2D, texture);
glBegin(GL_TRIANGLE_STRIP);
glTexCoord2f(texMinX, texMinY);
glVertex2i(x, y );
glTexCoord2f(texMaxX, texMinY);
glVertex2i(x+w, y );
glTexCoord2f(texMinX, texMaxY);
glVertex2i(x, y+h);
glTexCoord2f(texMaxX, texMaxY); glVertex2i(x+w, y+h);
glEnd();
SDL_GL_Leave2DMode();
Em Dec 3, 2006, às 8:43 AM, Christian Walther escreveu:
> Nuno Santos wrote:
>> My problem is that the area where the text is supposed to appear, has
>> a texture that i'm using in my 3D part. I don't understand why this
>> happens, since the name for the text texture is "texture" and the
>> other textures are call by Display Lists...
>
> OpenGL texture names are integers, not strings. There's nothing
> preventing you from using the same texture in a display list and
> outside
> of it. So, I can't make much sense of what you're saying. Can you show
> us your code?
>
> -Christian
>
>
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20061203/b5df7d01/attachment.htm
More information about the SDL
mailing list