0% found this document useful (0 votes)
46 views

Turbo C Graphics Programming

The document discusses getting started with graphics programming using Turbo C. It recommends Turbo C as a good choice for graphics programming in DOS due to its large number of useful graphics functions. It then provides a simple example program that displays a circle on the screen using graphics libraries in Turbo C. The program requires graphics header and library files as well as a graphics driver file to run.

Uploaded by

Cris Mark Barz
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

Turbo C Graphics Programming

The document discusses getting started with graphics programming using Turbo C. It recommends Turbo C as a good choice for graphics programming in DOS due to its large number of useful graphics functions. It then provides a simple example program that displays a circle on the screen using graphics libraries in Turbo C. The program requires graphics header and library files as well as a graphics driver file to run.

Uploaded by

Cris Mark Barz
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

Turbo C graphics Programming

Harsha

To start with graphics programming, Turbo C is a good choice. Even though DOS has its own limitations, it is having a large number of useful functions and is easy to program. To implement graphics algorithms, To give graphical display of statistics, To view signals from any source, we can use C graphics. Here is a article to start programming with Turbo C. 'Run and Learn' is our method. We have used source codes throughout the explanations. Just execute them to understand what is happening.

Visit Downloads page for free source codes of graphics programs.

Turbo C has a good collection of graphics libraries. If you know the basics of C, you can easily learn graphics programming. To start programming, let us write a small program that displays a circle on the screen.
/* simple.c example 1.0

*/ #include<graphics.h> #include<conio.h> void main() { int gd=DETECT, gm; initgraph(&gd, &gm, "c:\\turboc3\\bgi " ); circle(200,100,150); getch(); closegraph(); }

To run this program, you need graphics.h header file, graphics.lib library file and Graphics driver (BGI file) in the program folder. These files are part of Turbo C package. In all our programs we used 640x480 VGA monitor. So all the programs are according to that specification. You need to make necessary changes to your programs according to your screen resolution. For VGA monitor, graphics driver used is EGAVGA.BGI. Here, initgraph() function initializes the graphics mode and clears the screen. We will study the difference between text mode and graphics mode in detail latter.
InitGraph: Initializes the graphics system.

You might also like