SDL_UpdateRect "violation reading location"

Hallo SDL.

step1: I create a two surfaces with SDL_CreateRGBSurface();

step2: I draw something in one of them(A);

step3: I copy some part of (A) into other one(B) with SDL_BlitSurface();

step4: After all i copy (B) on screen surface. (created with video mode
initialing) with SDL_BlitSurface();

step4: SDL_UpdateRect(screen, 0,0,0,0) & SDL_Flip(screen);

The result is: I see screen surface, i see black rect(blank
surface) on the place where (B) should be.

I was tring to call SDL_UpdateRect(A, 0,0,0,0) or SDL_UpdateRect(B, 0,0,0,0) in steps 3
and 4, but i always get “violation reading location”.
I’m sure A and B are right pointers to right surfaces and surfaces
aren’t locked.

I was tring many ways except coping A to B with GetPixel() &
PutPixel(), but i think this should slow the process. So i can’t do
anything.
Can anyone help me?
tnx.–
Alexei mailto:AlexeiSergeev at gmail.com

Alexei Sergeev wrote:

Hallo SDL.

step1: I create a two surfaces with SDL_CreateRGBSurface();

step2: I draw something in one of them(A);

step3: I copy some part of (A) into other one(B) with SDL_BlitSurface();

step4: After all i copy (B) on screen surface. (created with video mode
initialing) with SDL_BlitSurface();

step4: SDL_UpdateRect(screen, 0,0,0,0) & SDL_Flip(screen);

step5 : send a program that everyone can compile, test and debug.

Stephane