SDL surface to surface copy

This is the follow on from an earlier post, this is the core problem.


This works...
1
2
3
4
5
6
AsciiBMP = load_image( "AsciiLine.bmp" );
AnotherSurface = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SDL_SWSURFACE );

SDL_BlitSurface( AsciiBMP, NULL, AnotherSurface, NULL );

SDL_Flip( AnotherSurface);


This does not...

1
2
3
4
5
6
7
AsciiBMP = load_image( "AsciiLine.bmp" );
Output = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SDL_SWSURFACE );

SDL_BlitSurface( AsciiBMP, NULL, AnotherSurface, NULL );
SDL_BlitSurface( AnotherSurface, NULL, Output, NULL );

SDL_Flip( Output);

I'm not sure why this is happening, maybe the image is flipped or the surface is no longer valid for copying.


FYI i am trying to store the ASCII chars into an array so they can be accessed like a normal char.
Last edited on
In the second code, is AnotherSurface pointing to a valid surface?
Yes...
 
SDL_Surface *Output = NULL;


there are no errors at all, but it doesn't show the bitmap on screen like the first piece code.
Last edited on
I talked about AnotherSurface. Does it point to a surface created by IMG_Load, SDL_CreateRGBSurface or any of the other SDL functions that can be used to create an SDL_Surface? If so, what size does it have?
+1 Peter.

NULL is not a valid surface. You must create a surface with one of the functions SDL provides (like SDL_CreateRGBSurface)
thanks I didn't know that, I will give it a go.

[edit]


AnotherSurface= SDL_CreateRGBSurface(0,50,50,32,0,0,0,0);
Thankyou.
Last edited on
Topic archived. No new replies allowed.