Re: [AD] question about opengl bitmaps

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


As I understand it, that code is for pulling the image from VRAM into
main memory, so it can be modified and re-uploaded when the region is
unlocked. So I'm not sure why things seem to work if it is skipped. Is
it because the font bitmap is never modified while the glyphs are
being grabbed?

pete

On Mon, Mar 24, 2008 at 1:44 AM, Peter Wang <novalazy@xxxxxxxxxx> wrote:
> Hi,
>
>  What's this block in ogl_lock_region for?
>
>  --- src/opengl/ogl_bitmap.c     (revision 11443)
>  +++ src/opengl/ogl_bitmap.c     (local)
>  @@ -295,6 +295,7 @@ static ALLEGRO_LOCKED_REGION *ogl_lock_r
>        else {
>           //FIXME: use glPixelStore or similar to only synchronize the required
>           //region
>  +#if 0
>           glBindTexture(GL_TEXTURE_2D, ogl_bitmap->texture);
>           glGetTexImage(GL_TEXTURE_2D, 0, glformats[bitmap->format][2],
>              glformats[bitmap->format][1], bitmap->memory);
>  @@ -302,6 +303,7 @@ static ALLEGRO_LOCKED_REGION *ogl_lock_r
>              TRACE("ogl_bitmap: glGetTexImage for format %d failed.\n",
>                 bitmap->format);
>           }
>  +#endif
>        }
>     }
>
>  AFAICS we already upload when a writable rectangle is unlocked so do we
>  need to do anything for locking?
>
>  That code is responsible for making all examples which use fonts to load
>  extremely slowly here (6 s or more), as the same bitmap is reuploaded
>  after grabbing each character in the font.  All the examples and demos
>  still work after commenting it out.
>
>  Peter
>
>
>  -------------------------------------------------------------------------
>  This SF.net email is sponsored by: Microsoft
>  Defy all challenges. Microsoft(R) Visual Studio 2008.
>  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>  --
>  https://lists.sourceforge.net/lists/listinfo/alleg-developers
>




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