EY> TO: Tim Esselens
TE>Is there enyone who could help me with the following prob.
TE>ok, I'm new in c++ but.. Beter late then never :))
TE>i'd like to make a demo for my bbs,
TE>but i can't put out one pixel in vga mode...
TE>(i even don't know how to put the program in vga mode)
TE>is there someone who could send me like a source code or a manual
TE>that could help me in my quest ta make a demo ?
EY> The following works well and is also fairly fast:
EY> (BTW: this is for MS C 7.0 but can very easily be converted to others)
EY> #include
EY> #include
EY> #include
EY> #define VGA256 0x13 // set video mode
EY> void Set_video_mode(int mode)
EY> {
EY> union REGS inregs,outregs;
EY> inregs.h.ah = 0; // set video mode sub function
EY> inregs.h.al = (unsigned char)mode; // video mode to switch to
EY> _int86(0x10, &inregs, &outregs);
EY> } //end set_video_mode
EY> void Plot_Pixel(int x, int y, char color)
EY> {
EY> // using the fact that 320*y = 256*y + 64*y = y<<8 +y<<6.
EY> video_buffer[((Y<<8) + (y<<6)) + x] = color;
EY> }
I hope you don't take everything that book says (tricks from the game
programming gurus) as gospel. Whatever you do, do not read the 3d chapter.
It's all wrong.
EY> Hope this can get you started.
cya
... It's not the bullet that kills you, it's the hole!
--- Ezycom V1.48g0 01fd016b
---------------
* Origin: Fox's Lair BBS Bris Aus +61-7-38033908 V34+ Node 2 (3:640/238)
|