Feb 14, 2012 at 3:13pm UTC
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 Feb 14, 2012 at 4:50pm UTC
Feb 14, 2012 at 6:06pm UTC
In the second code, is AnotherSurface pointing to a valid surface?
Feb 14, 2012 at 6:09pm UTC
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 Feb 14, 2012 at 6:11pm UTC
Feb 14, 2012 at 6:18pm UTC
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?
Feb 14, 2012 at 6:21pm UTC
+1 Peter.
NULL is not a valid surface. You must create a surface with one of the functions SDL provides (like SDL_CreateRGBSurface)
Feb 14, 2012 at 6:33pm UTC
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 Feb 14, 2012 at 6:45pm UTC