View Full Version : dos graphics
zoviac
09-26-2002, 09:15 AM
aight, now i got keyboard working. I would like to use it somehow, so anyone got any links for dos graphics libraries in djgpp? (no allegro, only graph)
Kamikaze!
09-26-2002, 01:16 PM
http://www-scf.usc.edu/~akotaobi/gptut.html - Graphics tutorials (same site as the keyboard tutorial).
http://www.brackeen.com/home/vga/index.html - Programming the mouse (you have to change the code a bit to make it work in DJGPP, but you should be able to do that if you look at the graphics tutorials code. eg union regs becomes __dpmi_regs etc).
http://inversereality.org/tutorials/tutorial.html - Also many good tutorials + how to use unchained mode (allows you to use higher resolutions in VGA).
I made a tiny graphics library with info from those sites (almost finished!). :)
zoviac
09-26-2002, 02:13 PM
kamikaze, inform me when u get it finished, i would like to take a look at it
Kamikaze!
09-27-2002, 11:29 AM
Sure.
zoviac
09-30-2002, 02:33 PM
aight, going fine, but i got a problem wit svga:
#include <go32.h>
#include <sys/movedata.h>
int bits_per_pixel, bytes_per_pixel;
int maxx, maxy;
int wingranularity;
void get_svga_modeinfo (int mode, modeinfo& inf) /*problem wit modeinfo& inf, doesn't compile...*/
{
__dpmi_regs r;
assert(sizeof(inf) < _go32_info_block.size_of_transfer_buffer);
r.x.ax = 0x4F01
r.x.cx = mode;
r.x.di = __tb & 0x0F;
r.x.es = (__tb >> 4) & 0xFFFF;
__dpmi_int(0x10, &r);
dosmemget(__tb, sizeof(inf), &inf);
maxx = inf.XResolution;
maxy = inf.YResolution;
bits_per_pixel = inf.BitsPerPixel;
bytes_per_pixel = bits_per_pixel * 8;
wingranularity = inf.WinGranularity;
}
Kamikaze!
09-30-2002, 03:12 PM
I never got SVGA to work but I think you need to change it to modeinfo* inf.
sedarious
10-09-2002, 04:07 PM
I would suggest going to gamedev.net. They have a lot of good stuff there. I would also recommend doing your own routines (you learn more that way). Most of my graphics knowledge is of mode 0x13. If you want to learn it (which will include some assembly), check out Denthors tutorials. I am not sure where to find them - but a google search (maybe gamedev.net even) should turn them up.
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.