Switching from DirectX to AGL

I have been programming for a couple of years in C++ and 1 year with DirectX (DirectDraw for that matter), and recently switched to the Mac OS platform.

Now I want to do 2D programming with OpenGL, but there are several problems. One, I know C++, but I hardly know anything about Objective C (that is what they use in OpenGL tutorials). And another thing is I can’t figure out how to incorporate the OpenGL API into Cocoa. Does anybody know a good book (or website) for accomplishing these things? :confused:

You can still use C++ to build your OpenGL App under OSX. Try this website http://onesadcookie.com/Tutorials, it will show you how to make an OpenGL App under Xcode.
Also http://nehe.gamedev.net/ has a lot of tutorials on OpenGL, and there you can find a Cocoa basecode if you want to try Objective C.

Thanks… yeah I really like OneSadCookie. It’s really helpful. But should I go directly into 3D or keep on programming in 2D? I would love to learn 3D, and I know Algebra, but I don’t know a thing about matrices and vectors. And I don’t know calculus. What do you recommend?

You will probably want a ‘linear algebra’ course offered by a college.

I learned OpenGL by trying some tutorials that I found on the web, and by reading a lot of papers and books about different 3D topics. When beginning with 3D, it will be a bit easier if you had some mathematics background and even better if you had some computer graphics course at university, but also if you hadn’t those courses you could begin with OpenGL. For me the best tutorials on OpenGL are those found at http://nehe.gamedev.net/, but also if they are well documented, I would hardly recommend you to buy one of the OpenGL Bible (for example “The OpenGL Programming Guide”, you can pretend be an OpenGL programmer if you don’t have such a book :wink: ). Another quick way to learn 3D and OpenGL is to have an OpenGL guru at hand :wink: .
As for 2D, maybe you should have a look on SDL to see if you could find some similarities wtih DirectDraw. On the website http://www.libsdl.org/index.php you will find docs and tutorials. I’m sure there is a lot of other and maybe better sources for SDL, but I’m not an SDL expert.

I’m not stupid, but I get confused when there are so many websites that are sort of covering what I want. In other words, I like books because they have a uniformity that a lot of websites don’t offer. Sometimes, a book can really speed up the learning process, even if you have to spend a bit of money. Don’t get me wrong, if you read the web you can learn a lot. But I really, really, like books. :slight_smile:

So if you’re interested in learning 3D and OpenGL and like books, than go buy “The OpenGL Programming Guide” (for me the best OpenGL reference), for a general introduction to computer graphics I liked “Fundamentals of Computer Graphics” by Peter Shirley. Once you knwo your OpenGL Bible by heart, you can continue with “The Cg Tutorial: The Definitive Guide to Programmable Real-Time Graphics” which will learn you to write shaders for your 3D graphic card, and “GPU Gems 1 & 2” to take the full power out of your GPU. After that you will certainly be a member of the OpenGL guru family.
As for 2D, I’m sorry but I don’t know good reference books.

That will help a lot… So you mean that reading that computer graphics book I will learn 3D? If so, I’ll just forget about 2D, because 3D does sound like fun. Thanks!

I have the first edition of the book “Fundamentals of Computer Graphics” and here is the contents :
Introduction, Miscellaneous Math, Raster Algorithms, Linear Algebra, Transformation Matrices, Viewing, Hidden Surface Elimination, Surface Shading, Ray Tracing, Texture Mapping, Graphics Pipeline, Data Structures for Graphics, Curves and Surfaces, Measure and Sampling, Antialiasing, Light, Human Vision, Color, Global Illumination, Accurate Direct Lighting, Reflection Models, Image-Based Rendering, and Visualisation.
The book has just 371 pages, but it gives a good introduction on 3D. It was the book which my professor had recommended when I passed the introduction to computer graphics course at university. So I hope it will help you as much as it helped me.

Great! yeah that sounds like what I want. Oh and did I forget to mention that I’m not even in high-school yet? :smiley: I’m home-schooled, so I spent all my extra time learning C++. :cool:

also, the opengl superbible 3rd edition is a good book (but it has typos) the cd source code usually fixes the typos.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.