TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: CHRISTOPHER BUTLER
from: JAVIER KOHEN
date: 1997-06-22 02:49:00
subject: Graphics routines

On 06-Jun-97, Christopher Butler wrote to All about Graphics routines.
 CB> Unfortunatly, it doesn't work.. on mine, the screen is cleared to red, 
 CB> then there's a GPF...
What OS/compiler???
 CB> === Begin graphics.cpp ===
 CB> #include >        /* For pokeb() & peekb() */
 CB> #include 
 CB> class GraphicsScreen {
 CB>       public:
 CB>         GraphicsScreen();
 CB>         ~GraphicsScreen();
 CB>         PutPixel(int x, int y, unsigned char col);
 CB>         Box(int x1,int y1,int x2,int y2,unsigned char col);
 CB> /*        PrintText(const char *text, unsigned char col, unsigned char
 CB> shadow=0, unsigned char shadowcol=0); */ /*** Not Implemented ***/
 CB> }
 CB> GraphicsScreen::GraphicsScreen()
 CB>            mov ah,0x13
This should be "mov ax, 0x0013"
 CB> GraphicsScreen::~GraphicsScreen()
 CB>            mov ah,0x03
This should be "mov ax, 0x0003"
 CB> GraphicsScreen::Box(int x1,int y1,int x2,int y2,unsigned char col)
 CB>         for (x=x1;x<=x2;x++)
for ( ; x1 <= x2; x1++)
 CB>                 for (y=y1;y<=y2;y++)
    for ( ; y1 <= y2; y1++)
 CB>                 pokeb(0xA000,(x+(y*320)),(char)col);
        pokeb(0xA000, x1 + (y1 * 320), col);
 CB>         return 0;
Why are you always returning 0???
 CB>         delete &gs;             // Back to text mode
No!!! You never allocated gs with new, so you mustn't delete it!
Internet: jkohen@tough.com þ Fidonet: 4:900/748.3 þ Sk-Network: 200:201/201.2
Rockernet: 33:300/100.3 þ  Javier Kohen/The_Crusher  þ PGP keyID: 3423EAA9
... All wiyht.  Rho sritched mg kegtops awound?
-!- CrusherTag 0.021.
--- Terminate 4.00/Pro
4:900/748.3)
---------------
* Origin: TNG season 7 þ DS9 season 2 þ VOY season 0 þ Movies 7

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.