04-26-2004, 08:35 AM
Hi,
I am using SDL_TTF, and when I render the SDL_Surface returned by TTF_RenderText_Solid(), I only get a solid quad.
any idea what i'm doing wrong? I only get a solid colored quad.
this link: http://jcatki.no-ip.org/SDL_ttf/SDL_ttf_27.html#SEC27 says that TTF_RenderText_Solid():
Create an 8-bit palettized surface and render the given text at fast quality with the given font and color. The 0 pixel value is the colorkey, giving a transparent background, and the 1 pixel value is set to the text color. The colormap is set to have the desired foreground color at index 1, this allows you to change the color without having to render the text again. Colormap index 0 is of course not drawn, since it is the colorkey, and thus transparent, though it's actual color is 255 minus each RGB component of the foreground.Does it have something to do with the way i should use glTexImage2D()? it says the surface is 8-bit, how do i create through glTexImage2D()? How do you set up glTexImage2D() to accept an 8bit surface whose 0 pixel value is the colorkey?
thanks!
I am using SDL_TTF, and when I render the SDL_Surface returned by TTF_RenderText_Solid(), I only get a solid quad.
any idea what i'm doing wrong? I only get a solid colored quad.
this link: http://jcatki.no-ip.org/SDL_ttf/SDL_ttf_27.html#SEC27 says that TTF_RenderText_Solid():
Create an 8-bit palettized surface and render the given text at fast quality with the given font and color. The 0 pixel value is the colorkey, giving a transparent background, and the 1 pixel value is set to the text color. The colormap is set to have the desired foreground color at index 1, this allows you to change the color without having to render the text again. Colormap index 0 is of course not drawn, since it is the colorkey, and thus transparent, though it's actual color is 255 minus each RGB component of the foreground.Does it have something to do with the way i should use glTexImage2D()? it says the surface is 8-bit, how do i create through glTexImage2D()? How do you set up glTexImage2D() to accept an 8bit surface whose 0 pixel value is the colorkey?
thanks!