C++ Graphics Programming

Status
Not open for further replies.

NikhilVerma

Padawan
The link is working here....

You need to click on the "Free" button below and then wait for the file's link to show up at the bottom....
 

ashu888ashu888

Core i7 (nehalem) Owner
madjeri wrote:
ashu try to get a new turbo c++ compiler.
If you dont find initgraph dont worry.
just add this
int gd=DETECT,gm; //graphic initialisation
initgraph(&gd,&gm,"c:\\tc\\bgi");

c:\\tc\\bgi is your tc location and make sure tc is in c drive.

BTW initgraph is just intialising your graphics driver.
I did tat in the mai() but i got 1 error---> int gd=DETECT,gm; Declaration not allowed here and 1 Warning----> initgraph(&gd,&gm,"c:\\tc\\bgi"); 'gd' is assigned a value that is never used.

I replaced this tag c:\\tc\\bgi with c:\\turboc3\\tc\bgi as my TURBOC3 folder (on the C: drive) wich contains the TC folder in wich the BGI and other folders are present.

but still no luck guys ! :( the program fails to run coz of the ERROR tat i get.. :( i specified both the codes in the int main() function and outside the if loop but still same problem :(
Please suggest sumthing....

cheers n e-peace....
 

NikhilVerma

Padawan
Forget that length program for the moment...
use this program and

PLACE THE EGAVGA.BGI FILE IN THE PROGRAM'S DIRECTORy

and then compile it.... don't change anything in it...
Tellme what happens...

Code:
#include<graphics.h>
#include<conio.h>
void setmode()
{
	int gd=DETECT,gm;
	initgraph(&gd,&gm,"");
}
void main()
{
	setmode();
	int i,j;
	for(i=0;i<640;i+=5)
	{
		line(i,0,i,480);
		line(0,i,640,i);
	}
	for(i=0;i<640;i+=5)
	{
		for(j=0;j<480;j+=5)
		{
			setfillstyle(1,(i*j+i*i+j*j));
			floodfill(i-1,j-1,15);
		}
	}
	getch();

}
 

ashu888ashu888

Core i7 (nehalem) Owner
Yup Nikhil, i hv the EGAVGA.BGI (BGI file) in my BGI folder and i ran ur code also but it gives me this msg:
#include<graphics.h>
#include<conio.h>
void setmode()
{ int gd=DETECT,gm;
initgraph (&gd,&gm," ");
}

void main()
{ setmode();
int i,j;

for(i=0;i<640;i+=5)
{ line(i,0,i,420);
line(0,i,640,i);
}

for(i=0;i<640;i+=5)
{ for(j=0;j<480;j+=5)
{ setfillstyle(1,(i*j+i*i+j*j));
floodfill(i-1,j-1,15);
}
}
getch();
}
/* OUTPUT:

BGI Error: Graphics not initialized (use 'initgraph')

*/

Dont knw wat else shud i do... :? :? Help !!
 

NikhilVerma

Padawan
Okay then I guess there is a problem with your C installation...

I think you should get another version of TurboC ... The one I have is 3.0...
And it doesn't have any sub-directories... Install file is named turboc.exe

see if you can find it on any of your friends PC or ask your teacher maybe...
 

ashu888ashu888

Core i7 (nehalem) Owner
NikhilVerma wrote:
I think you should get another version of TurboC ... The one I have is 3.0...
And it doesn't have any sub-directories... Install file is named turboc.exe
Well im having TURBOC 3 buddy.....and i think its the latest.. neways will ask for a new version....

Cheers n e--peace....
 

puja399

In the zone
R u guys from prehistoric era?!!!!! Still fumbling with turbo c++ and bgi library!!!! Wake up, learn some windows programming for heaven's sake, do some DirectX or OpenGL. This is 2005 going on to 2006, people are using Geforce 6800GT !!!!
 

ashu888ashu888

Core i7 (nehalem) Owner
puja399 wrote:
R u guys from prehistoric era?!!!!! Still fumbling with turbo c++ and bgi library!!!! Wake up, learn some windows programming for heaven's sake, do some DirectX or OpenGL. This is 2005 going on to 2006, people are using Geforce 6800GT !!!!
Buddy,its only tat this thread was related to C++ GRAPHICS PROGRAMMING..coz sum of our Digit users (including me ofcourse) wanted to learn the GRAPHICS features of C++.

And more importantly...To start any PROGRAMMING/GRAPHIC INTENSIVE work..u need to hv a bit of "so-called" COMMON sense to learn the ABC's (basics) first.. isint it !! :!: :!:

If ur well versed in WINDOWS PROGRAMMING..then please do the honours and post a new thread related to same.. as tat would be helpful....

As of now..no digit user is posting their querries on this topic..so its done and dead ....

There are still users and newbies who want to learn programming rite from the basics....No matter in watever era we people will be but we still teach a newbie the same A for apple and B for ball to make him/her understand the basics first.. isint it ??

I guess tat even u didnt started to speak the word "PROGRAMMING", until u learned ABC rite !!

Cheers n e-peace.....
 

NikhilVerma

Padawan
puja399 said:
R u guys from prehistoric era?!!!!! Still fumbling with turbo c++ and bgi library!!!! Wake up, learn some windows programming for heaven's sake, do some DirectX or OpenGL. This is 2005 going on to 2006, people are using Geforce 6800GT !!!!

If you can shed any light on OpenGL and DirectX programming rather than mocking us... We'd be glad...
 

bizzare_blue

Journeyman
I myself was interested in DirectX prog and started a thread too but got no replies so I purchased a book by Keith Sink...Nice one 4 advanced user....Everythin is taught in it....

A good beginner's book is by Yashwant Kanitkar....its the best in its category....

But then I changed my plans n jumped 2 C++ graphics prog to start with, as they say, "BASICS"....
 

puja399

In the zone
First of all, my sincere apology to you all if I hurt your feelings. It was not my intention to mock you that you are still using tc++ in graphics progs. But the fact remains that tc++ operates in DOS and I seriously doubt that any of the persons visiting this thread uses any OS lower than Win95. So if someone uses tc, it means he/she is downgrading to 16 bit in a dosbox which is rather peculier to me.

Further, tc++, as far as I know is not compliant to true c++ standards, meaning that, tc++ has no namespace, template or STL which are the heart and brain of modern C++. So, in fact, people using TC++ are actually using a language which is not 100% C++, and not even close to it. So why spent so much energy on TC++?

And do you guys really feel that putting your precious time, brain and money ( time is money you know!!) , not to talk of physical labour and lost sleep on programming with BGI library is giving you any benefit? Where would you use it ? I don't think it has got any more utility than making some toy apps for showing off to your parents or friends. And what ashu888ashu888 has pointed out that it gives you the ABC or the basics of progs. But I think what u need is learning algorithms and not BGI programming, it will help u most. Its no use reinventing the wheel. MFC is there for you.

And regarding learning OpenGL or DX, or even Windows progs, I confess that I possess much less knowledge than u might think I do, so that I can give others tutorials. There are more than enough wonderful free tutorials all over the net just waiting for you to read them. Moreover, windows programming especially graphics progs have now become like rocket science, it is deeper that the atlantic and wider than the pacific, and not a thread or a section but even a whole website like this one is much inadequate to cover even the basics of windows graphics programming.

So, first of all, I suggest that u should start using Microsoft C++ (VC++), and dump TC++ for good. Buy the famous Windows programming book by Charles Petzold and start right away. It will give all the basics u need to know for your future. I can assure u that u will forget tc++ and bgi library in no time.
 
Status
Not open for further replies.
Top Bottom