Tuesday, July 14, 2009

I'm getting trouble while using turbo c/c++ compiler,for it is not executing any graphics commands.Please help

When I try to execute any graphics programs it is not detecting my graphics driver,though I've included my graphics.h.Does anybody know now to setup graphics in turbo c/c++?Please Help.

I'm getting trouble while using turbo c/c++ compiler,for it is not executing any graphics commands.Please help
The BGI library is an old library for ibm dos or compatibile (ms, drdos, dosbox, freedos..).





you can use this block of code to initialize the BGI driver





#include %26lt;graphics.h%26gt;


#include %26lt;conio.h%26gt;


int main(void)


{


/* request autodetection */


int gdriver = DETECT, gmode, errorcode;


/* initialize graphics mode */


initgraph(%26amp;gdriver, %26amp;gmode, "");


/* read result of initialization */


errorcode = graphresult();


if (errorcode != grOk)


{


/* an error occurred */


}


else


{


/* draw a line */


line(0, 0, getmaxx(), getmaxy());


getch();


closegraph();


}


return 0;


}
Reply:enable graphics library from settings..default is off


No comments:

Post a Comment