Re: [AD] bmp_write ?

[ Thread Index | Date Index | More Archives ]

> To be more precise : I have a screen bitmap on which I apply a video
> effect (scale2x for example, to get a smoothed double sized version of
> it). So I don't call the standard blit functions on it, and the result
> of course is that it's updated on screen only if it's linear, and
> usually windowed bitmaps are not linear.

All bitmaps are linear for Allegro (except with outdated drivers like 
Mode-X). In windowed modes, the driver is double-buffered so changes made to 
the logical screen are not directly displayed on the physical screen.

> So with the x11 driver I can call _xwin_update_screen(0,0,w,h) and it
> works perfectly well (and it's fast).
> But it's not standard, and there is no equivalent in windows apparently.

The equivalent under Windows would be:

#include <winalleg.h>

RECT rect = { 0, 0, w, h };


> If I do :
> for (n=0; n<h; n++)
>   bmp_write_line(bmp,n);
> bmp_unwrite_line(bmp);
> then it works too, but it's awfully slow compared to the direct
> _xwin_update_screen call.

Because you don't call acquire_bitmap()/release_bitmap().

> So is there a standard and fast solution to this simple problem ?

Yes, using acquire_bitmap()/release_bitmap() and 

Eric Botcazou

Mail converted by MHonArc 2.6.19+