RE: [AD] No more video/system bitmaps

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


> In that case, it would be better to have a command to explicitly
change
> the usage. Instead of:
> 
> tmp = create_bitmap(DYNAMIC_DRAW);
> // do the drawing to tmp
> real = create_bitmap(STATIC_DRAW);
> blit(tmp to real)
> destroy_bitmap(tmp)
> // now use real
> 
> I would rather have:
> 
> real = create_bitmap(DYNAMIC_DRAW)
> // do the drawing to real
> change_usage_pattern(STATIC_DRAW)
> // use it


How is that any different? Allegro would have to do the exact same work.



 
> Or, the very same happens when I load it from disk. Initially, it must
> be a memory bitmap, which then gets promoted to a video bitmap once
all
> data are loaded.
> 
> > > I also wonder what would happen if there were multiple threads,
each
> > > calling al_flip_display() on its own display.  Would each thread
be
> > > wanting to traverse a global list of bitmaps?
> >
> > We could probably get away with a single list of bitmaps to move
around.
> 
> Or a per-display list? Maybe each AL_DISPLAY would have its own OpenGL
> context as well.


How do you associate a random AL_BITMAP* to an AL_DISPLAY? There is no
current AL_DISPLAY if you are running multiple windows.


> 
> Now, of course, I wonder why the COPY is missing. It would be in your
> list, from what I see:
> 
> "Copy" means the application will not perform writes to the bitmap via
> al_acquire_region() (other writes are OK)


In VBO, COPY makes some sense. It hints that you'll use glBufferData() /
glBufferSubData() to define the VBO, and not glMapBuffer(), which may
result in the VBO being copied out of video memory and into system
memory so that it can be directly addressable by applications.

It makes a little less sense for Allegro, since there is no
straightforward way to define a bitmap's image data, and also most
drivers can map video memory directly.

That's the main reason I left it out.


> But then, I'm somewhat confused by it all right now :P
> 
> So, when this goes into Allegro, we should have an entire chapter for
> it, with a lot of concrete usage examples..


I wonder if that wouldn't be to get old users to understand how it all
works, instead of actually explaining it to new users. After all, the
whole idea is that users shouldn't care where bitmaps live; Allegro
would just do The Right Thing(tm).





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