summaryrefslogtreecommitdiffstats
path: root/share/examples/libvgl
diff options
context:
space:
mode:
authoryokota <yokota@FreeBSD.org>1999-11-08 11:37:46 +0000
committeryokota <yokota@FreeBSD.org>1999-11-08 11:37:46 +0000
commit5b90185d7f6229e8275354d49c936845932f68e9 (patch)
tree2fd4989fd857b909af28670ef7714168fdbf0cea /share/examples/libvgl
parent6b891b634b32d132848bd61a4f23bbdfe8013306 (diff)
downloadFreeBSD-src-5b90185d7f6229e8275354d49c936845932f68e9.zip
FreeBSD-src-5b90185d7f6229e8275354d49c936845932f68e9.tar.gz
- 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.)
Diffstat (limited to 'share/examples/libvgl')
-rw-r--r--share/examples/libvgl/demo.c21
1 files changed, 11 insertions, 10 deletions
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 <machine/console.h>):
@@ -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; y<ysize; y++)
@@ -86,15 +87,15 @@ main(int argc, char **argv)
// now show some simple bitblit
for (i=0; i<256; i++)
for (j=0; j<256; j++)
- tmp.Bitmap[i+256*j] = i%16;
- VGLBitmapCopy(&tmp, 0, 0, VGLDisplay, 0, 0, 128, 128);
+ tmp->Bitmap[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);
OpenPOWER on IntegriCloud