![]() We have declared variables so that we can keep track of starting and ending point. In all our sample graphics programs, you have to change path of BGI directory accordingly where you Turbo C++ compiler is installed. If directory path is not provided, then it will search for driver files in current working directory directory. If *gdriver is set to DETECT, then initgraph sets *gmode to the highest resolution available for the detected driver.ĭriverDirectoryPath : It specifies the directory path where graphics driver files ( BGI files) are located. GraphicsMode : It is a pointer to an integer that specifies the graphics mode to be used. In all our programs we will use DETECT macro of graphics.h library that instruct compiler for auto detection of graphics driver. It tells the compiler that what graphics driver to use or to automatically detect the drive. ![]() GraphicsDriver : It is a pointer to an integer specifying the graphics driver to be used. Below is the description of input parameters of initgraph function. It also resets or initializes all graphics settings like color, palette, current position etc, to their default values. ![]() It initializes the graphics system by loading the passed graphics driver then changing the system into graphics mode. void initgraph(int *graphicsDriver, int *graphicsMode, char *driverDirectoryPath) The second step is initialize the graphics drivers on the computer using initgraph method of graphics.h library. The graphics.h header file provides access to a simple graphics library that makes it possible to draw lines, rectangles, ovals, arcs, polygons, images, and strings on a graphical window. The first step in any graphics program is to include graphics.h header file. Initgraph(&gdriver, &gmode, "c: urboc3gi") First graphics program (Draw a line) #include Graphics programming in C used to drawing various geometrical shapes(rectangle, circle eclipse etc), use of mathematical function in drawing curves, coloring an object with different colors and patterns and simple animation programs like jumping ball and moving cars. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |