[SDL] fast draw

Robert Clayton trinitychaos50 at hotmail.com
Sun Apr 2 23:18:49 PDT 2000

I'm writing a tile scrolling game, and was just wondering if I'm updating my 
screen the fastest possible way.

	imagebmp = SDL_LoadBMP(filename);
	image = SDL_DisplayFormat(imagebmp);

        for(int x = 0; x<10; x++)
            for(int y = 0; y<10; y++)
        	rectangle.x = x;
        	rectangle.y = y;
        	rectangle.w = image[index]->w;
        	rectangle.h = image[index]->h;
        	SDL_BlitSurface(image, NULL, display, &rectangle);


where display is the screen surface
and image and imagebmp are surfaces also.

I know the display loop is just going to show the same tile in a 10x10 grid, 
but just pretend it's a state of the art tile display system :).

Am I drawing and showing my graphics the fastest way possible?

Get Your Private, Free Email at http://www.hotmail.com

More information about the SDL mailing list