Re: [AD] another patch

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


Grzegorz Adam Hankiewicz <gradha@xxxxxxxxxx> writes:

> Great. Now, I have some questions. With the test program I am able to
> create a 1600x1200x32 screen. Although this is great and impressive, I
> think that this should be restricted, since my desktop is 1024x768 and I
> can't even scroll to see the whole drawing area. Wouldn't it be good to
> return -1 in set_gfx_mode to be practic about what screen resolution is
> available? Maybe the virtual desktop size of the environment should be the
> limit for this.

I can add some code to limit maximum screen resolution.  But by
default it should be able to set any resolution (it is limited to
4096x4096 now).  Limits might be taken from X-server (WidthOfScreen,
HeightOfScreen for instance), or it might be set by the user.

> 
> Another question: I've seen that except fading (especially in the demo),
> the rest of the 8-bit drawing functions don't seem to hurt visual
> performance too much (I am talking just about subjective observation, no
> tests involved), but what is the most efficient way to write a graphic
> program with Allegro under X-window, using always the smallest colour
> depth resolution, or the color depth used by the environment? Is there any
> way to detect it, or does GFX_SAFE do this automatically?

The most efficient is to support all color depth and then use Allegro
program in the same color depth as X-server.  For example, if X-server
was started in 16-bpp mode (e.g. with startx -- -bpp 16), then Allegro
program should be used in 16 bpp mode.  But test that gfx_driver->desc
says that it is using matching mode.  I.e. fading should be fast for 8
bpp X-server.  For other X-server color depths changing palette
results in redrawing the whole window (and updating buffer which holds
image for window).  Scrolling screen results in redrawing the window
without updating buffer (for any color depth).

-- 
Michael Bukin



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