TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: JERRY COFFIN
from: CHRISTOPHER BUTLER
date: 1997-06-12 07:57:00
subject: Graphics routines

Hi Jerry!
When Jerry Coffin wrote to Christopher Butler on Sunday June 08 1997, Jerry 
was talking about Graphics routines.
 CB>> GraphicsScreen::~GraphicsScreen()
 CB>> {
 CB>> asm {           // Back to text mode, via ASM again
 CB>> mov ah,0x13
 CB>> int 0x10
 JC> Unless you've got a very unusual graphics card, this isn't going to
 JC> get you back to text mode...
Mm... I spotted that :)
Thats as it should be now :)
[Box]
 JC> This still isn't going to be any kind of speed champ with most
 JC> compilers.  The problem is that you're re-creating the pointer to
 JC> memory again at each iteration of the loop.  With most compilers, the
 JC> following is likely to be faster:

[your code snipped]
 JC> This also draws from bottom to top, which is often faster than top to
 JC> bottom.  Even if it doesn't make any difference in accessing video
 JC> memory, it avoids comparisons each time through the loops.
I tried that (its commented out in my code ), but if I went over about 150 
with the y co-ord (can't remember what it was exactly), it was all over the 
place...
 CB>> delete &gs;             // Back to text mode
 JC> You didn't call `new' to create gs - you should NOT call `delete' to
 JC> destroy it.  This was likely what was causing your GPF.
I'm calling new now:
GraphicsScreen *gs = new GraphicsScreen;
 JC> Most likely you also want a pause between putting stuff on the screen
 JC> and going back to text mode:
I'm using a cin.get() now :)
Question: How can I move a block (say 63780 bytes) of memory to another 
location (say from A000h to A140h)?
(guess what I'm trying to do now)
I've got a lot more in the class now:
Palette routines, fade up, fade down, set and rotate.
More drawing routines, line and circle.
GetPixel.
Chris
--- FMail/Win32 1.22
---------------
* Origin: Death Butler BBS, +44-1582-620141, 24 Hours (2:257/135)

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™.