Пример #1
0
void pvm_win_init_cursor()
{
    int i;

    for( i = 0; i < 10; i++ )
    {
        // fill
        int c;
        for( c = 0; c < xsize*ysize*3; c++ )
            cwin[c] = (i+2)*10;

        drv_video_bitblt(win, 0, i*10, cxsize, cysize);
        //drv_win_screen_update();
        drv_video_update();
    }
}
Пример #2
0
void videotest()
{

    //int ysize = 60;
    //int xsize = 80;
    //char win[ysize*xsize*3];

#if 0
    const char *bpm = "../../plib/resources/backgrounds/phantom_dz_large.pbm";

    {
        FILE *f = fopen(bpm, "r" );
        if(f == NULL )
        {
            printf("can't open %s\n", bpm );
            exit(33);
        }

        fseek( f, 0, SEEK_END );
        long size = ftell( f );
        fseek( f, 0, SEEK_SET );

        printf("Size of %s is %ld\n", bpm, size );

        char *data = malloc(size);

        fread( data, size, 1, f );
        fclose(f);

        struct drv_video_bitmap_t *bmp;
        int result = bmp_ppm_load( &bmp, data );

        free(data);

        if(result)
            printf("can't parse %s: %d\n", bpm, result );
        else
        {
            drv_video_bitblt(bmp->pixel, 0, 0, bmp->xsize, bmp->ysize, 0xFF );
        }

        bmp_pixels = bmp->pixel;
        bmpxs = bmp->xsize;
        bmpys = bmp->ysize;


    }
#endif

    int i;

    for( i = 0; i < 10; i++ )
    {
        fillw( (i+2)*10, (i+2)*20, (i+4)*10 );

//#if VIDEO_ZBUF
        drv_video_bitblt(win, 0, i*10, wxsize, wysize, i & 1 ? 0xFF : 0x55 );
//#else
//        drv_video_bitblt(win, 0, i*10, wxsize, wysize );
//#endif
        //drv_win_screen_update();
        //drv_video_update();
    }


    //drv_video_window_t *w = malloc(drv_video_window_bytes(140,80));
    //w->xsize = 140;
    //w->ysize = 80;

    drv_video_window_t *w = drv_video_window_create( 140,80, 200, 200, COLOR_LIGHTGRAY, "Test Window" );

    //drv_video_window_clear( w );
    //drv_video_window_fill( w, COLOR_LIGHTGRAY );
    drv_video_winblt( w );

    //flame(w);

    drv_video_window_draw_line( w, 1, 1, 110, 20, COLOR_RED );
    drv_video_window_draw_line( w, 110, 1, 110, 20, COLOR_RED );
    drv_video_window_draw_line( w, 1, 20, 110, 20, COLOR_GREEN );

    drv_video_window_fill_ellipse( w, 30, 30, 15, 27, COLOR_BLUE );

    drv_video_window_fill_box( w,  40, 32, 33, 10, COLOR_RED );

    drv_video_window_draw_box( w, 45, 37, 33, 12, COLOR_BLACK );

    drv_video_winblt( w );

    getchar();

//#if VIDEO_ZBUF
    video_zbuf_reset();

    fillw( 0xFF, 0, 0 );
    drv_video_bitblt(win, 550, 100, wxsize, wysize, 0xEF );

    //video_zbuf_dump();

    fillw( 0, 0xFF, 0 );
    drv_video_bitblt(win, 575, 120, wxsize, wysize, 0xEE );
    drv_video_bitblt(win, 700, 400, wxsize, wysize, 0xEE );
//#endif
    video_zbuf_reset();

//getchar();

#if 1
    drv_video_font_scroll_line( w, &drv_video_8x16san_font, COLOR_DARKGRAY );
    drv_video_font_draw_string( w, &drv_video_8x16san_font, "Test font", COLOR_BLACK, 0, 0 );
    drv_video_font_scroll_line( w, &drv_video_8x16san_font, COLOR_LIGHTGRAY );
    drv_video_font_draw_string( w, &drv_video_8x16san_font, "Line 2 ok", COLOR_BLACK, 0, 0 );
    drv_video_font_scroll_line( w, &drv_video_8x16san_font, COLOR_DARKGRAY );
    drv_video_font_draw_string( w, &drv_video_8x16san_font, "GIMME THAT", COLOR_BLACK, 0, 0 );
#else
    int ttx = 0, tty = 0;
    drv_video_font_tty_string( w, &drv_video_8x16san_font,
                               "Just a little bit long text\nFrom a new line",
                               //"Just a little bit long ",
                               COLOR_BLACK, COLOR_LIGHTGRAY,
                               &ttx, &tty );
#endif
    drv_video_winblt( w );
//getchar();
}