blitsurface problem

Started by
2 comments, last by crim 18 years, 9 months ago

  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.
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
HxRender | Cornerstone SDL TutorialsCurrently picking on: Hedos, Programmer One
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]
bump

This topic is closed to new replies.

Advertisement