<bgi.h> improved

ZX80, ZX 81, ZX Spectrum, TS2068 and other clones
Post Reply
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

<bgi.h> improved

Post by stefano »

https://github.com/z88dk/z88dk-ext/blob ... /bgidemo.c
bgi5.png
bgi4.png
bgi3.png
bgi2.png
bgi1.png
It's a mockup, but the results look interesting enough to start thinking at a real library.
You do not have the required permissions to view the files attached to this post.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: <bgi.h> improved

Post by stefano »

Small programs are very easy to port, with a bit of luck.

e.g. take the example here:
http://electrosofts.com/cgraphics/

Image

adjust the fill style adding a line just after initgraph():
setfillstyle(SOLID_FILL,MaxColors-1);

change:
#include <graphics.h>
..into:
#include <bgi.h>

and build shrinking the picture (the original program was for a 640x480 display):
zcc +zx -lndos -DGFXSCALEX=2/5 -llib3d -create-app program.c
bgitest.png


etc. attempting to enable the colours on setfillstye() and using the ANSI ESCape sequences:

https://www.equestionanswers.com/c/c-dos-graphics.php

Image
bgi_colours.png
Adding more fonts is technically possible.


More quick and dirty hacks:

https://github.com/sagargoswami2001/Set ... tudio-Code
..the example program, removing the floodfill calls and using a scale factor of 2/5
hut.png

https://github.com/solderwire/CoolApk-Niupi/issues/1
niupi.png
You do not have the required permissions to view the files attached to this post.
Post Reply