Re: [AD] OpenGL and upside down

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2008-03-18, Elias Pschernig <elias@xxxxxxxxxx> wrote:
> 
> On Sat, 2008-03-15 at 15:51 +0000, Peter Hull wrote:
> > If you lock the OpenGL back-buffer, it currently reads the pixels and
> > then reverses the order of the rows (because OpenGL bitmaps start from
> > the bottom up and Allegro start from the top down). When you unlock,
> > the opposite process occurs. This reversing is done by a load of
> > memcpy-ing.
> > 
> > Would it be possible to avoid this by returning a locked region with
> > data pointing to the last row of the region but with a negative pitch?
> > 
> 
> I tried doing just that at first, but it did not work. Either because I
> did it wrong, or because my version of the Nvidia drivers is broken and
> supports only positive pitch.

Correct me if I'm wrong, but OpenGL shouldn't be aware of any "negative
pitch" at all.  It's just any Allegro and user code which locks a
rectangle needs to keep in mind that ptr += rect.pitch might actually
decrement ptr.

Peter





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/