Hack the world

Hack the world
Hack

Wednesday, December 2, 2015

How to use graphics in C++

How to use graphics in C++ when working on the (sucky) Windows 7 is a banal problem. Well, here is the solution for those willing to use Dev-Cpp. For those having troubles with MS VC++,  I didn’t tell you to go use that asinine software. 
When you install Dev-Cpp, it does not come with “graphics.h” and related files. There is a special add-on, if I may call it so, that you need to install before you can write “#include<graphics.h>” in your C++ program. This is known as the WinBGIM Devpack. You can download it from -http://tinf.ti.funpic.de/_nicht_loeschen/WinBGIm-6.0-1g17l.DevPakNow, when you create a project, go to Project->Project Options and select the Parameters tab. In this, under the “Linker” field,  type in the following. (including the ‘-’)-lbgi-lgdi32-lcomdlg32-luuid-loleaut32-lole32Once you have this installed and the above changes made, you do not need anything more and can simply include the graphics.h header file and start working PS: I had a problem setting the background color as setbkcolor(5) dosen’t seem to have any effect. If any of you figure out how to do it, please leave a comment.Cheers! 

Related Posts:

0 comments:

Post a Comment