Re: [AD] Proposal for first step towards new api

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


Thomas Fjellstrom <tfjellstrom@xxxxxxxxxx> writes:

> Its  too bad that the drivers require a regular bitmap for the screen.
> Otherwise, how hard is it to code based on 'screen_w()' and 'screen_h()'?
> (Or just SCREEN_W, SCREEN_H).

It is possible to add flag to the function that creates screen,
allowing to resize screen bitmap, and maybe another flag allowing gfx
driver to automatically resize from fixed screen to resizable video
surface.  Programs using first flag would be harder to code, so some
programmers may not like it, second one may give slower graphics, and
many people may not like it too.  But IMHO, it might be useful,
especially first idea.

One question is when to resize screen bitmap.  If it is resized while
drawing is in progress, drawing code may be confused, as it has a
pointer to surface, which is invalid after resize.  One possible
solution is to add new parameters (not replacing old ones) after
resize into screen structure and set a flag that screen was resized.
At some point user may call function to test if screen was resized and
it would automatically update user visible properties of screen
(width, height, anything else), clear 'resized' flag and return
indication that screen was resized, then user may save new screen
properties, recreate background, or do something else.

I did not write any API or pseudo code, because it would depend on
overall structure of initializing graphics system, creating screen
(maybe several screens on different displays) etc.

We can test this idea with 4.0, by making 'resizable' flag as a config
variable (I may have enough time on holidays).

-- 
Michael Bukin



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