[SDL] SDL and SunOS

Dave dleimbac at phoenix.lhup.edu
Tue Apr 11 12:28: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);
	SDL_FreeSurface(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);
             }

         SDL_FlipDisplay(display);


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