May 19, 2009 at 11:02am UTC
I tried to include the graphic library in C++ as in C: #include <Graphics.h>, but got an error saying: "no such a file or directory".. How bad!
How the graphic library can be attached in C++ and use it to draw a line for example?
May 19, 2009 at 11:09am UTC
you must be programming in turbo C++,, are you.. that blue one??
if thats the case, there is an option somewhere for directories in settings, add the path where your graphics.h is.. thats it.
if not then what platform/compiler you are using?
May 19, 2009 at 11:11am UTC
I use Visual Studio 2008.
Should be included as in C? If yes, why doesn't work to me?!
Last edited on
May 19, 2009 at 11:41am UTC
May 19, 2009 at 1:14pm UTC
there is no graphics.h in vc++.
so you mean when you create a c project in VS or vc++ you are able to find graphics.h file?
May 19, 2009 at 1:40pm UTC
I want to create C++ project and not able to find graphics.h file. I think there is another way to do that in C++ but don't know how :(
For example in C# you define it like this:
g contain all the functions like drawline, drawpixel etc.
Do you know how the syntax going in C++?
May 19, 2009 at 1:54pm UTC
C++ has no graphics library.
C has no graphics library.
I didn't know C# had one but apparently it's part of the (.NET) Framework.
Of course you can just use an already made graphics library.
Last edited on
May 19, 2009 at 1:55pm UTC
May 19, 2009 at 6:41pm UTC
Thank you all..
Duoas, I don't have any professor yet :)
Learning this only to fill my time.
May 20, 2009 at 7:47am UTC
I may use SDL or OpenGL when reach a good advance of programming some algorithms I'm working on. I'm not a game programmer but SDL and OpenGL still useful in my case.
Thank you for the links!
May 20, 2009 at 1:28pm UTC
> I use Visual Studio 2008.
Then graphics.h has nothing to do here.
Simply use Native Win32 Gdi apis (no need of SDL or any other external library)
May 20, 2009 at 1:41pm UTC
Is there any recommended site which teach how to use Native Win32 GDI ?
May 20, 2009 at 1:56pm UTC
Mind you, this tutorial explains very clearly that this type of programming isn't made for games.
Last edited on
May 20, 2009 at 1:57pm UTC
May 20, 2009 at 2:25pm UTC
you can study charles petzold also.. very good book on win32..
May 20, 2009 at 3:31pm UTC
George is a rabid MS groupie. Win32 is not particularly simple, especially for beginners -- it is a low-level API.
If you are trying to keep it simple, go with SDL. There is nothing wrong with using non-Microsoft-made libraries, and SDL is exceedingly easy to begin with.
May 20, 2009 at 3:49pm UTC
There once was a man called George.
Who, on Microsoft products did gorge.
When it came to third party,
Especially things arty.
He was as blind a Gordy Laforge!
May 20, 2009 at 4:28pm UTC
I agree. I see nothing wrong with moving into SDL or other type APIs that can be used similarly. Win32 GDI should probably be avoided....
May 20, 2009 at 4:55pm UTC
The portability and ease of use of SDL makes it far more preferable than using any Windows GDI gitup for basic graphic stuff, IMO.
Don't assume everyone uses Windows! Break away from the Win-only development habit by never getting sucked into it!
May 20, 2009 at 6:10pm UTC
Now lets make a final decision!
Hmm.. According to the majority here I see that SDL is more recommended.
Thank you all :)