Original Post
At the SDL documentation, it says that SDL_BlitSurface() can return: 0(All good) -1(error) -2(video memory lost) At the documentation, we find this: If either of the surfaces were in video memory, and the blit returns -2, the video memory was lost, so it should be reloaded with artwork and re-blitted: while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) { while ( SDL_LockSurface(image)) < 0 ) Sleep(10); -- Write image pixels to image->pixels -- SDL_UnlockSurface(image); } So, the first while-loop continues untill the video memory arent lost anymore. The second while-loop continues untill we've managed to lock the surface. But what about the "-- Write image pixels to image->pixels --" ? What exactly are they suggesting we should do here? [Edited by - Drogin on December 20, 2008 7:11:16 AM]