Re: [AD] DirectDraw - create_sub_bitmap() or save_bitmap() faulty ?

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


Just in case you others had the same problem to decipher the code...
Here's a slightly modified version...

#include<allegro.h>

int main(){
    int i;
    PALETTE p;
    BITMAP *B;
    allegro_init();
    install_keyboard();
    set_color_depth(8);
    set_gfx_mode(GFX_AUTODETECT_FULLSCREEN,320,240,0,0);
    for (i=120;i>0;i-=12) {
        circlefill(screen,160,120,i,i);
    }
    textout_ex(screen,font,allegro_id,0,0,13,-1);
    textprintf_ex(screen,font,0,60,32,-1,"%s/%dx%d/%d.%d",
                  gfx_driver->desc,
                  gfx_driver->w,
                  gfx_driver->h,
                  os_version,
                  os_revision);
    B = create_sub_bitmap(screen,0,0,SCREEN_W,SCREEN_H);
    textprintf_ex(B,font,0,80,48,0,"%dx%d%d",
                  B->w,B->h,B->vtable->color_depth);
    readkey(); 
    get_palette(p); 
    save_bitmap("test.pcx",B,p);
    destroy_bitmap(B);
} END_OF_MAIN();

While i'm not sure what the point of the code is, and what it has to 
do with directx9... at least it should be readable...

Maybe j13 could comment on the code?

/Lenny


On 2 Apr 2003 at 2:14, Johnny13 wrote:

> see attachment:test.pcx
> [code]
> #include<allegro.h>
> int main(){int i;PALETTE p;allegro_init();install_keyboard();
>  set_color_depth(8);set_gfx_mode(GFX_AUTODETECT_FULLSCREEN,320,240,0,0);
>  for(i=120;i>0;i-=12)circlefill(screen,160,120,i,i);
>  textout_ex(screen,font,allegro_id,0,0,13,-1);
>  textprintf_ex(screen,font,0,60,32,-1,"%s/%dx%d/%d.%d",
>  gfx_driver->desc,gfx_driver->w,gfx_driver->h,os_version,os_revision);
>  BITMAP*B=create_sub_bitmap(screen,0,0,SCREEN_W,SCREEN_H);
>  textprintf_ex(B,font,0,80,48,0,"%dx%d %d",B->w,B->h,B->vtable->color_depth);
>  readkey(); get_palette(p); save_bitmap("test.pcx",B,p); destroy_bitmap(B);
> }END_OF_MAIN();
> [/code]
> (using DirectX9)
> 
> -------------------------------------------------
> HKNETMAIL.COM Free WEB MAIL Service by  HKNET
> 






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