[SDL] SDL_Surface dimensions and its efficency

Rainer Deyke rainerd at eldwood.com
Sat May 22 14:11:23 PDT 2010


On 5/22/2010 09:13, Ernesto Borio wrote:
> Hi everyone, I'm Petruza, I'm posting for the first time in this
> list.
> 
> I'm coding an emulator and want to load the tiles into tile_sheet
> which is an SDL_Surface. To make rect blitting easier, I thought of
> making the tile_sheet of 256 x 8 pixels. Is it more or less efficient
> than making a more square-ish surface? Since I'm not using the whole
> surface, but just 8x8 rects out of it, the dimensions really don't
> matter, so I'm free to make them anything I want having efficiency in
> mind.

I recently had to rewrite some code that used a narrow, tall texture to
store tiles.  It turned out that I ran into the maximum texture height
for my graphics card when I applied scale4x to the texture.  Making the
texture more square-ish fixed the problem.

This may not apply to you - emulators typically deal with very small
data sets - but why risk it?


-- 
Rainer Deyke - rainerd at eldwood.com




More information about the SDL mailing list