Graphics with turbo c/c++ or Assembler
Is anyone know any way to use graphics in the dos turbo c/c++, beside graphics.h?
Or a way to do it in Assembler, so I can write the functions/classes myself?
Thanks in advance.
Take a look through
http://www.programmersheaven.com/zone16/mh160.htm
and, straight from the horse’s mouth,
http://cc.borland.com/ccweb.exe/listing?id=15793
http://www.programmersheaven.com/zone16/mh160.htm
and, straight from the horse’s mouth,
http://cc.borland.com/ccweb.exe/listing?id=15793
Well, I found this tutorial:http://www.brackeen.com/home/vga/
I hope it will help other people too.
I hope it will help other people too.
I wouldn't recommend the BGI. VESA is not well supported in real mode DOS when using XP.
To code in lets say TC++/ASM:
(I forgot how TC does Hex and I'm writing this on the top of my head)
1. Go to 13h by this code:
asm{
mov ax, 0013h
int 10h
}
Then get a pointer to the vid mem by:
unsigned char *screen;
screen = (unsigned char*) 0xA0000000;
To put a pixel:
screen[x + y * 320] = color
You could use shifts for offset calcs if speed is an issue. I have a few Tc++ 13h progs at home. PM me if you want to get them.
I have some 3d demos, plasmas, algorithmic textures, etc.
Most of them are a combo of ASM and C++, but I usually have another pure C++ version which are a lil slower than ASM+C++.
Edit:
Okay here are the source and exes. Compiled with TC++ 3.0
http://rel.betterwebber.com/junk.php?id=37
Enjoy!
[Edited by - relsoft on January 22, 2005 10:13:42 PM]
To code in lets say TC++/ASM:
(I forgot how TC does Hex and I'm writing this on the top of my head)
1. Go to 13h by this code:
asm{
mov ax, 0013h
int 10h
}
Then get a pointer to the vid mem by:
unsigned char *screen;
screen = (unsigned char*) 0xA0000000;
To put a pixel:
screen[x + y * 320] = color
You could use shifts for offset calcs if speed is an issue. I have a few Tc++ 13h progs at home. PM me if you want to get them.
I have some 3d demos, plasmas, algorithmic textures, etc.
Most of them are a combo of ASM and C++, but I usually have another pure C++ version which are a lil slower than ASM+C++.
Edit:
Okay here are the source and exes. Compiled with TC++ 3.0
http://rel.betterwebber.com/junk.php?id=37
Enjoy!
[Edited by - relsoft on January 22, 2005 10:13:42 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement