Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » how many rows in a locked region

This thread is locked; no one can reply to it. rss feed Print
how many rows in a locked region
William Labbett
Member #4,486
March 2004
avatar

Hi,

I've not been programming using allegro for a while. I've forgotten a lot but I'm getting on alright except I've got question I didn't have before.

When using an ALLEGRO_LOCKED_REGION I know that the pitch isn't necessarily the
same length as the bitmap due to padding and orientation of bitmap. This has made me wonder whether the ALLEGRO_LOCKED_REGION has the same number of rows
(height) as the ALLEGRO_BITMAP. Is it safe to assume that when running through
the pixels of a locked region

for(y = 0; y < al_get_bitmap_height(bitmap); ++y)
{
   for(x = 0; x < locked_version_of_bitmap->pitch; ++x)
   {
      


   }
}

will work?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

William Labbett
Member #4,486
March 2004
avatar

Thanks Edgar.

Go to: