|
[5.1] al_put_pixel and bitmap pitch |
pmprog
Member #11,579
January 2010
|
I'm writing a game using a build of Allegro 5.1.5/6 (One for my desktop, the other for the Pandora handheld). I've written a software "shader" system to get around some of the Pandora build's setup. All it basically does is lock the surface in a fixed format, I loop through each pixel and unlock it. My loop basically used the pixels void* and editted memory, which ran quick and worked fine on the desktop. However, it segfaulted the Pandora; This is due to that bitmaps are loaded upside down on the Pandora (negative pitch). So I changed my code to use al_put_pixel, and whilst it worked (well, there was some dodgy refreshing problem, but I don't think that's related), it made the desktop version amazingly slow. I can't find any functions in the API to tell me the pitch of the locked surfaces. Am I missing something, or isn't there one? I might just hardcode, but thought I'd check if there was a proper solution first. Thanks
|
Max Savenkov
Member #4,613
May 2004
|
ALLEGRO_LOCKED_REGION returned by al_lock_bitmap has pitch.
|
pmprog
Member #11,579
January 2010
|
Thank you! I didn't think to look there, but makes sense Cheers
|
|