17.2 GRAPHICS INITIALIZATION
To initialize the graphics hardware, we have to use function initgraph(). It has three parameters. The first one is gdriver. It tells the program what driver is available in the computer. Sometimes we may not know which driver is present in the computer. Therefore, we supply the value of driver as DETECT (a predefined constant with value 0). Now, computer detects and sets the driver (like CGA, VGA, etc.). The second parameter is gmode. When we use DETECT for gdriver, computer sets the value of gmode as the highest possible value for present driver.
If we know which driver is present in our computer, then we do not have to use DETECT. We can specify that driver and any valid gmode (for that driver) ourselves. The third ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access