From 5b90185d7f6229e8275354d49c936845932f68e9 Mon Sep 17 00:00:00 2001 From: yokota Date: Mon, 8 Nov 1999 11:37:46 +0000 Subject: - This is the new version of libvgl jointly developed by sos and I. It adds new functions and extend some structures and can handle VESA modes. - Update the man page. - Bump the library version number. (The old version will be added to compat3x.) --- share/examples/libvgl/demo.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'share/examples/libvgl/demo.c') diff --git a/share/examples/libvgl/demo.c b/share/examples/libvgl/demo.c index 3147c47..f2a28d3 100644 --- a/share/examples/libvgl/demo.c +++ b/share/examples/libvgl/demo.c @@ -36,7 +36,7 @@ int main(int argc, char **argv) { int x, y, xsize, ysize, i,j; - VGLBitmap tmp; + VGLBitmap *tmp; // set graphics mode, here 320x240 256 colors // supported modes are (from ): @@ -53,9 +53,10 @@ main(int argc, char **argv) xsize=VGLDisplay->Xsize; ysize=VGLDisplay->Ysize; - // alloc a new bitmap (there should be a function for this) - tmp.Type = MEMBUF; tmp.Bitmap = (char*)malloc(256*256); - tmp.Xsize = 256; tmp.Ysize = 256; + // alloc a new bitmap + tmp = VGLBitmapCreate(MEMBUF, 256, 256, NULL); + VGLBitmapAllocateBits(tmp); + VGLClear(tmp, 0); // fill the screen with colored lines for (y=0; yBitmap[i+256*j] = i%16; + VGLBitmapCopy(tmp, 0, 0, VGLDisplay, 0, 0, 128, 128); for (i=0; i<256; i++) for (j=0; j<256; j++) - tmp.Bitmap[i+256*j] = j%16; - VGLBitmapCopy(&tmp, 0, 0, VGLDisplay, 3, 128, 128, 128); + tmp->Bitmap[i+256*j] = j%16; + VGLBitmapCopy(tmp, 0, 0, VGLDisplay, 3, 128, 128, 128); sleep(2); - VGLBitmapCopy(VGLDisplay, 237, 311, &tmp, 64, 64, 128, 128); - VGLBitmapCopy(&tmp, 32, 32, VGLDisplay, 400, 128, 128, 128); + VGLBitmapCopy(VGLDisplay, 237, 311, tmp, 64, 64, 128, 128); + VGLBitmapCopy(tmp, 32, 32, VGLDisplay, 400, 128, 128, 128); sleep(2); VGLBitmapCopy(VGLDisplay, 300, 300, VGLDisplay, 500, 128, 128, 128); sleep(5); -- cgit v1.1