RE: [AD] No more video/system bitmaps

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


-- Elias Pschernig wrote:

> Something we should avoid is that users, instead of
> having to care where
> the bitmaps live, like with the current Allegro,
> they now have to care
> what usage pattern to assign (even if it is only the
> initial
> assignement, and changes automatically). It should
> be very clear from
> the documentation when to assign which usage
> pattern. Of course,
> ideally, there would not need to be any parameter,
> or just always an
> AUTO pattern as was suggested..

I say let AUTO be the default.  Make the function
AL_BITMAP *create_al_bitmap(int width, int height,
AL_DISPLAY *env);  If a user wants more control on
where the bitmap goes, there could be another
function, create_hinted_al_bitmap(int width, int
height, int hint, AL_DISPLAY *env);

I could see noobs and experianced programmers alike
having to sit and think "Now what kind of bitmap is
this going to be?"  I say make it easy for those who
don't care, yet leave the optimized option open.

A question I had about this whole thing, is what does
the flip function do?  I couldn't tell from this
description, and I think new users will have the same
problem.  If its a function to replace the current
request_video_bitmap / show_video_bitmap functions,
then maybe it should be named someting less vague like
set_al_display(AL_DISPLAY *env, AL_BITMAP *bmp).

On another note, I'm not sure how much I like this
idea.  It would involve (or at least its begining to
sound so) putting in counters / checks in every
function that affects and / or reads bitmaps,
potentialy taking a long time to swap where the
bitmaps live in memory.  What if I as a user need to
do a quick getpixel or something, and all of a sudden
my game freezes for a second or two.

Putting hooks into functions has two issues that I
see.

1) Performance hits.  I think allegro should be very
carefull here.  Reputations are gained extremely
easily, and hard to shake.  If there are more games
out there that pause randomly with an Allegro logo on
it, then SDL will completely take over.  Also the
developers of those games wont like such uncontrolable
delays.

2) Messiness.  Its just plain messy to be putting a
hook into tons of differen't functions.  And what
happens when one of the drawing functions calls
another one?  Its fixable but its still just a really
messy idea.


Having a seperate function to handle moving bitmaps
around in memory could work, but I still think the
approach is a little tacky / unintuitive.

Isn't there a better approach to smart bitmaps?




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