Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualAcharis

Posted 05 January 2013 - 09:47 AM

I have SDL_TTF to render text then I convert it to a texture and display. Everything is fine as long as I use TTF_RenderText_Blended(), but with TTF_RenderText_Solid() it's not working, since it's making a non RGBA surface...

So, I need somehow to convert the surface to RGBA surface, so I can use it with OpenGL's GL_RGBA.



I tried SDL_ConvertSurface() but it's not working, most likely due to wrong PixelFormat (I have no clue how to setup a proper RGBA pixelformat, I tried to copy one by one all values (except palette) from the primary surface but it's not working and the code is ugly as well). How to make the conversion?

#1Acharis

Posted 01 January 2013 - 06:47 AM

I have SDL_TTF to render text then I convert it to a texture and display. Everything is fine as long as I use TTF_RenderText_Blended(), but with TTF_RenderText_Solid() it's not working, since it's making a 1 BPP surface...

 

So, I need somehow to convert the surface to RGBA (4 BPP) surface, so I can use it with OpenGL's GL_RGBA.

 

 

 

I tried SDL_ConvertSurface() but it's not working, most likely due to wrong PixelFormat (I have no clue how to setup a proper RGBA pixelformat, I tried to copy one by one all values (except palette) from the primary surface but it's not working and the code is ugly as well). How to make the conversion?

 


PARTNERS