I am using Windows 7 and MingW for compiling c programs that I write.. I wish to learn how to draw lines, arc, circles (graphics) in C - programming. the book I am referring to uses graphics.h and graphics.lib of turboC. But I have mingW. how do I get the header and library files for MingW?
Asked
Active
Viewed 7,901 times
1 Answers
3
Mingw itself doesn't have a graphics library, but Windows does.
What you can look into is the Windows API, which can also be used in Visual Studio. The API provides such functions. Here is one of many tutorials, where among others the Ellipse
function is used.

wormsparty
- 2,481
- 19
- 31
-
I am sorry, but I am absolutely new to this term 'windows API'.. could you elaborate more? thanks for being patient with me.. – KawaiKx Nov 09 '11 at 10:25
-
Windows provides functions to do many things, in your case you are interested in opening windows, create buttons, etc, which are not part of any standards (you won't find them on Linux, for instance). API means 'Application programming interface', which is a short term to talk about those functions you can use. Is this more clear? – wormsparty Nov 09 '11 at 10:31
-
so I can use API functions in my C programming? including drawing lines etc? – KawaiKx Nov 09 '11 at 10:49
-
is windows programming a totally new thing besides C programming? does it use C just as a frame for its own syntax? – KawaiKx Nov 09 '11 at 10:53
-
An API *means* 'functions you can use'. And yes, the whole API is C-only, there's no C++. Look at the tutorial I linked, only C functions are used. Windows provides those functions such that anyone can use, it's not another language, it's a library. The main problem with graphics programming is that there's not one way to do it; everyone does as he wants; Mac has it's own, X has it's own, BeOS has it's own, etc. So if you device to use the Windows functions, your code will only work on Windows, and no other operating system. Hope it helps. – wormsparty Nov 09 '11 at 11:00
-
If you just want to play around, go ahead and look at the tutorial. If you want to build something more serious, you should look at cross-platform GUI libraries, like SDL, Qt, or Glut. – wormsparty Nov 09 '11 at 11:09
-
Can SDL be added to MingW with windows 7 as OS ? – KawaiKx Nov 11 '11 at 18:14
-
Sure, a quick Google search gave me this guide to help you: http://mingw-starter.blogspot.com/2008/02/mingw-sdl.html – wormsparty Nov 14 '11 at 08:30