Heretic_Cata
We're gonna live forever
I'm trying to do anything in BGI graphics mode of borland C++ 3 and 5. And nothing works in either of them. Even the most basic examples don't work:
This was tried in BorlandC 3.
On compile - no error. On run no error. But it still doesn't do anything. By running the program in cmd i get an error EGAVGA.BGI driver device not found.
I have found a lot of people had this problem. Their problem was either - the path written wrong - mine being correctly writen; or they didn't check the graphics library thingy at the options, which i did; or they don't have egavga.bgi in the right place, and i copied it in every possible location in the program folder. What's more frustrating is that it doesn't work in BorlandC 5.2 either - the exact same error in cmd.
Yes, i could try learning windows graphics (OpenGL) to use in C, but i already know how to work with the bgi graphics since i worked with them a year ago. It worked perfectly then - but it was my old computer. Could this be the problem ?
Thanks
This was tried in BorlandC 3.
Code:
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int midx, midy;
int radius = 100;
/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "c:\\Docume~1\\INFO\\ANU2\\BORLANDC\\BGI");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
}
midx = getmaxx() / 2;
midy = getmaxy() / 2;
setcolor(getmaxcolor());
/* draw the circle */
circle(midx, midy, radius);
/* clean up */
getch();
closegraph();
return 0;
}
I have found a lot of people had this problem. Their problem was either - the path written wrong - mine being correctly writen; or they didn't check the graphics library thingy at the options, which i did; or they don't have egavga.bgi in the right place, and i copied it in every possible location in the program folder. What's more frustrating is that it doesn't work in BorlandC 5.2 either - the exact same error in cmd.
Yes, i could try learning windows graphics (OpenGL) to use in C, but i already know how to work with the bgi graphics since i worked with them a year ago. It worked perfectly then - but it was my old computer. Could this be the problem ?
Thanks