Mac C++ graphic programming

quanganhct

macrumors member
Original poster
Dec 29, 2010
31
0
Hi,
I 'm now learning C++ accordingly to my school's program, and i plan to take a course ahead myself (in graphic , of course). So here's the problem, i cannot use the header file "graphics.h", i search thoroughly on Google, and it seem that Mac doesn't support that library. It trouble me alot, so i'm here to ask for help.
Anyone have any ideas ? (I use Mac Leopard, Xcode version 3.2.5)
Thanks in advance.
 

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
What's graphics.h? Is it a Windows header? Standard C++ doesn't have any graphics library. I also would suggest OpenGL, probably not the most beginner friendly but..
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
1
Dallas, TX
The problem here is not that you are missing the header. You could copy that from a machine at school. The problem is the library itself that contains the definitions for the functions, Objects, etc. the header gives you definitions for. If this isn't a cross-platform library, this just isn't going to work.

If you're tied to a school that does Windows-specific instruction, you're going to need to do the work on Windows. I wouldn't try to hack together projects on OS X using other libraries and hope they'll work when you try to turn it in for the class.

-Lee
 

ender land

macrumors 6502a
Oct 26, 2010
876
0
thanks for your suggestion
but as i said, i need it in C++, 'cause this is a school's lesson. For example write a code drawing a rectangle, or a circle bounce on a screen (of course in c++)

OpenGL works in C++ on Mac just fine (I programmed for a graphics class extensively on my mac last semester).
 

chrono1081

macrumors 604
Jan 26, 2008
7,686
1,877
Isla Nublar
The problem here is not that you are missing the header. You could copy that from a machine at school. The problem is the library itself that contains the definitions for the functions, Objects, etc. the header gives you definitions for. If this isn't a cross-platform library, this just isn't going to work.

If you're tied to a school that does Windows-specific instruction, you're going to need to do the work on Windows. I wouldn't try to hack together projects on OS X using other libraries and hope they'll work when you try to turn it in for the class.

-Lee
+1

I hack together programs on Mac that should be on Windows and unless you know what your doing it can be a nightmare to get working. I often have to re-write a lot of code simply because I don't want to work in Windows (can you blame me for not wanting to use MFC???). Also if your professor / teacher wants to run your code you may be in trouble. Luckily for me I usually only have to provide a screenshot of the output.

Also as others have stated graphics.h appears to be a custom header file so you should be able to just copy it and the corresponding source file (if it has one) from your machine but chances are it contains either MFC or DirectX code. Not to mention with graphics libraries (or any external library) you have to set your IDE up to recognize it.

Honestly if you are getting started with graphics I would suggest learning SDL over OpenGL since OpenGL may confuse the crap out of you at first. There is an excellent site for setting up and learning SDL however the Mac instructions are a little outdated for setting it up.

http://www.lazyfoo.net

One last thing OpenGL is programmed using C++.
 
Last edited:

quanganhct

macrumors member
Original poster
Dec 29, 2010
31
0
okay thanks alot. So it means that i should use other library like OpenGL or SDL. Well if this is not a school program, i 'll try these out, but you know, when i mean a school program, there're test and exam also , so if i cannot practice the function they use in class , i 'll be on an edge of failing. I'll try paralel desktop then .
Anyway, thanks alot for your aiding.
Cheers.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.