[SDL] Pitch?

Marc A. Lepage mlepage at antimeta.com
Sun Jun 18 10:47:43 PDT 2000


The example DrawPixel code has this for 16 bpp:

    bufp = (Uint16 *)screen->pixels + y*screen->pitch/2 + x;

Why pitch? What exactly is pitch? I have an idea but it's been awhile
since I did graphics.

Why can't you just use the w member?

    bufp = (Uint16 *)screen->pixels + y*screen->w + x;

-- 
Marc A. Lepage
http://www.antimeta.com/
Minion open source game, RTS game programming, etc.



More information about the SDL mailing list