Jump to content
  • Advertisement
Sign in to follow this  
crim

blitsurface problem

This topic is 4773 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

  initial = TTF_RenderText_Blended(font, "TESTING THE TEXT", color);
  if(initial == NULL)
    cout << "Error crating text" << TTF_GetError() << endl;

  intermediary = SDL_CreateRGBSurface(0, 256, 32, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);
  
  if(intermediary == NULL)
    cout << "Error: Creating surface" << endl;

  if(SDL_BlitSurface(initial, 0, intermediary, 0) == -1)
    cout << "Error: Bliting surface" << endl;

  SDL_SaveBMP(initial, "blah0.bmp");
  SDL_SaveBMP(intermediary, "blah1.bmp");
blah0.bmp is a perfect picture of the text while blah1.bmp is a black image but it has the right width and height, I think its something to do with the CreateRGBSurface command. Also while im typing, i have a second problem, with my textures, all the white shades have been changed to blue shades. So pure white has been changed to pure blue.

Share this post


Link to post
Share on other sites
Advertisement
Look at your masks. If you are you using RGBA, then it should look more like this.
0xFF000000 R
0x00FF0000 G
0x0000FF00 B
0x000000FF A

Yours is:
0x00FF0000 R
0x0000FF00 G
0x000000FF B
0xFF000000 A

Share this post


Link to post
Share on other sites
Tried it, no effect

btw with that second question, red and green dont show up at all

Edit: also tried
intermediary = SDL_CreateRGBSurface(0, 256, 32, 32,
0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000);

[Edited by - crim on July 20, 2005 7:40:57 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!