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.
blitsurface problem
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
0xFF000000 R
0x00FF0000 G
0x0000FF00 B
0x000000FF A
Yours is:
0x00FF0000 R
0x0000FF00 G
0x000000FF B
0xFF000000 A
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement