I am just wondering what i need to be able to make 2D stuff on C\C++ ? like 2D cards.. etc...
i know about OpenGL but thats for 3D graphics, am i right?
i just want a 2D thing.
please help
I am just wondering what i need to be able to make 2D stuff on C\C++ ? like 2D cards.. etc...
i know about OpenGL but thats for 3D graphics, am i right?
i just want a 2D thing.
please help
I think most (all?) graphics libraries have 2-d support - OpenGL
does. It'd be 3-d that a library would be less likely to handle, but
then it'd be really old, since 3-d graphics have been around for
ages.
No No's:
fflush (stdin); gets (); void main ();
Goodies:
Example of fgets (); The FAQ, C/C++ Reference
My Gear:
OS - Windows XP
IDE - MS Visual C++ 2008 Express Edition
ASCII stupid question, get a stupid ANSI
ok, well i use Dev C++, how do i use openGL ? do i need to download any extras to access it?
and also, i have Visual Studio 2005 Pro Full Edition right, but i dont get how to use it, like it says PROJECT -> setting -> link and then link opengl, glaux and glu, but i cannot find the place where i enter this. its not in setting, its weird.
I don't know about VS2005 but in VS2003 you could use the #pragma pre-processor command like this:
Where obviously you replace lib_name by the actual name of the library. Give it a try.Code:#pragma comment(lib, "lib_name.lib")
I suppose this is where we find out the OP is using TurboC or something.....
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
This thread should probably be in the Game Programming board, but anyway...
I wouldn't really recomend OpenGL if you're just starting out. While you certainly can do 2D graphics with OpenGL, you pretty much have to do it in terms of 3D. You set the camera to an othogonal projection (i.e. no perspective) and then set up a quad primitive and texture map it. It takes quite a bit of work to get it all working, and you'll need to know a bit about 3d math, etc. A bit too complicated for someone just starting. On the other hand, it's the best way to go...just about any game that does 2D graphics these days will use this method.
I would recomend using the SDL library. It's easy to set up, and there's plenty of tutorials on getting started. Underneith the hood, it uses OpenGL and DirectDraw (on Windows), so you can use either of them without much hassle....no need to know how to create a window or how to do the complicated initialization. There's lots of addon libraries too, for things like adding networking capabilities. Here's the URL:
http://www.libsdl.org/index.php