Forgot your password?

typodupeerror
Education Programming Python Linux

Recommendations For C++/OpenGL Linux Tutorials? 117

Posted by timothy
from the no-you-guide-me dept.
QuaveringGrape writes "After a few years of Python I've recently been trying to expand my programming knowledge into the realm of compiled languages. I started with C, then switched over to C++. A friend and longtime OpenGL programmer told me about NeHe's tutorials as a good step after the command-line programs started to get old, but there's a problem: all the tutorials are very Windows-based, and I've been using Linux as my single platform for a while now. I'm looking for suggestions for tutorials that are easy to learn, without being dumbed down or geared towards non-programmers."
This discussion has been archived. No new comments can be posted.

Recommendations For C++/OpenGL Linux Tutorials?

Comments Filter:
  • NeHe's good! (Score:3, Informative)

    by Xetrov (267777) on Tuesday March 23, 2010 @08:34AM (#31581884)

    Actually at the bottom of every article are downloads for a LOT of other platforms. Read the tutorial on the web, then look at the code for your platform, should be plenty of comments.

    I learned the same way :)

  • by Anonymous Coward on Tuesday March 23, 2010 @08:36AM (#31581908)

    You ever heard of reading the summary?

  • by Anonymous Coward on Tuesday March 23, 2010 @08:41AM (#31581980)

    Perhaps you need to read the summary? but there's a problem: all the tutorials are very Windows-based, and I've been using Linux as my single platform for a while now.

  • LazyFoo might help (Score:5, Informative)

    by Drethon (1445051) on Tuesday March 23, 2010 @08:53AM (#31582072)
    LazyFoo's website http://www.lazyfoo.net/ [lazyfoo.net] has tutorials on SDL (a very simple 2d sprite engine).

    I don't know if he has basic tutorials but he has tutorials in Windows, Linux and other OSes too I think.
  • by llvllatrix (839969) on Tuesday March 23, 2010 @08:53AM (#31582076)
    ...on how to get your rendering context setup in Linux. Here are a few:

    http://www.wxwidgets.org/docs/tutorials/opengl.htm [wxwidgets.org]
    http://projects.gnome.org/gtkglext/ [gnome.org]

    Beyond these, NeHe still applies. The exception are operating system specific APIs like playing sound, but those have nothing to do with OpenGL. After NeHe, you may want to consider using shaders, which are covered in the Orange Book:

    http://www.3dshaders.com/home/ [3dshaders.com]
  • by NJRoadfan (1254248) on Tuesday March 23, 2010 @09:02AM (#31582186)
    It might be primitive, but using GLUT is always an option. Its cross platform and usually the examples run on all platforms without modification. http://www.opengl.org/resources/libraries/glut/ [opengl.org]
  • by mdwh2 (535323) on Tuesday March 23, 2010 @09:03AM (#31582190) Journal

    Perhaps you need to read his comment, where he said "C++ and OpenGL are both platform agnostic, why do you need the tutorial to be for a specific platform?"

    With the exception of the first lesson (which I address in my comment below), can you show me how NeHe's tutorials are only usable on Windows? Or indeed, how they're specific to Windows at all?

  • Standard C++ books (Score:5, Informative)

    by porsche911 (64841) on Tuesday March 23, 2010 @09:07AM (#31582234)

    I would recommend the following books:
    Alexandrescu - "Modern C++ Design: Generic Programming and Design Patterns Applied"
    Meyers - "Effective C++" and "More Effective C++"
    Stroustrup "The C++ Programming Language"
    Stepanov - "Elements of Programming"
    Koenig - "Accelerated C++"
    Koenig - "Ruminations on C++" (A little out of date but still a good read)

    Good luck, C++ has evolved into a large and complex language. You may want to read Stroustrups "The Design and Evolution of C++" on the side to understand how it developed.

    -c

  • Dear god no! (Score:4, Informative)

    by Anonymous Coward on Tuesday March 23, 2010 @09:40AM (#31582678)

    Please don't look at the NeHE tutorials. Just buy the Red book or something and work from there.

    The NeHe stuff is terribly ancient and lots of it is amazingly out of date, and never promoted very good programming practices.

  • by jimrthy (893116) on Tuesday March 23, 2010 @10:06AM (#31583062) Homepage Journal

    I say that, because I was asking myself pretty much exactly those same questions just a few months back.

    1. You want to learn OpenGL
    2. You want to broaden your horizons to C++

    Both are good goals, but they're also two distinctly different goals.

    Pyglet is a simple python gaming library that is an excellent resource for learning OpenGL. You get all the goodness of python, yet you're using the same OpenGL calls you'd use in a "real" programming language. It probably isn't stable enough for production, but it's much faster to learn when you have the command interpreter and don't have to wait around for the compiler/linker.

    There are other OpenGL implementations for python, but I had the best luck learning by using pyglet. Probably because it's very low level and doesn't hide implementation details like, say, SDL does.

    The NeHe tutorials are good for what they are. Like other posters have mentioned, they're a little out of date, and the programming style isn't all that great. But they're good, quick examples of getting something set up and seeing results pretty much immediately. Which makes them a good place to start...as long as you remember the grain of salt.

    I definitely share your pain when it comes to setting up things like the rendering context, the camera, etc, etc, etc. There are tons of options, the man pages were not written for the beginner. Again, as has been mentioned over and over, the Red Book is probably your best bet.

    Learning C++ is (really) a different question. I can't recommend the C++ FAQ Lite highly enough. You can find their recommendations at http://www.parashift.com/c++-faq-lite/how-to-learn-cpp.html [parashift.com]

  • by Mabbo (1337229) on Tuesday March 23, 2010 @10:16AM (#31583212)
    ... is based on the book they (GameDev) wrote and recommend on their website, "Beginning OpenGL Game Programming, Second Edition". What a waste of my money. It doesn't teach you anything unless you already knew it. The code given on paper is in snippets, never full programs, and never fully explained. It was like they never actually had a beginner to OpenGL read the book before they published it.

    But don't worry, the full source is on the CD. Of course, it's only for visual studios, and even if you get it running on that, it has to be in a specific hard-coded directory called "D:/book/code/examples" or something.

  • by SupaSaru (1773854) on Tuesday March 23, 2010 @10:22AM (#31583314)
    How did this get insightful? Worst comment ever. Do you think OpenGL just has magic platform agnostic Window management? Do you think OpenGL just takes over the whole PC as it's own little domain? Do you think the implementation between each OS is 100% exact? In fact, it's much closer to ignorantly assuming ^handles work "anywhere" because of C++'s "platform agnostic" title. The problem isn't in the tool chain - it's in the rather annoying process of creating rendering contexts for each individual OS - it has nothing to do with his chosen tool chain or "platform agnostic" title. SDL and GLUT alleviate most of the headache in this process.
  • by Anonymous Coward on Tuesday March 23, 2010 @10:41AM (#31583586)

    you can use < and > for smaller-then and greater-then signs in slashcode

  • Suggestions (Score:2, Informative)

    by bioglaze (767105) on Tuesday March 23, 2010 @11:13AM (#31584050) Homepage Journal

    Most of the tutorials are outdated and won't work in modern OpenGL core profile. Avoid tutorials that use glBegin(), glVertex(), glLight(), gluPerspective(), glMatrixMode(), glVertexPointer(), or learn just enough from them that you can create a context and draw stuff in Linux. After that you can adapt Windows-specific tutorials's code to Linux. I liked these tutorials:
    http://sites.google.com/site/opengltutorialsbyaks/introduction-to-opengl-3-2---tutorial-01 [google.com]
    http://www.opengl.org/wiki/Tutorial:_OpenGL_3.1_The_First_Triangle_(C%2B%2B/Win) [opengl.org]

  • by njord (548740) on Tuesday March 23, 2010 @11:44AM (#31584532)

    I just want to point out that there are 3 different topics you're talking about there:

    1. C++
    2. OpenGL
    3. Development/building on Linux

    Indeed, there are pretty deep concepts behind each of them: C++ is related to fundamental programming concepts, object orientation, and metaprogramming, OpenGL deals with framebuffer rendering/graphics, and Linux development deals with source control, Makefiles, compilers, and configuration setups.

    These concepts are not orthogonal by any stretch of the imagination, but it might help to keep in mind that each of them can be studied without the other.

    Speaking from personal experience as a 'graphics guy', I would suggest you look further than OpenGL if you want to learn C++. OpenGL is great, don't get me wrong, but it is just an API, and a fairly limited one at that. You won't learn much C++ trying to figure out how to set up texture contexts and binding VBOs.

    I would recommend writing a raytracer or your down software-based rasterizing renderer (or both!) - you'll find youself diving right into the data structures that are important to graphics and tackling 'fundamental' problems that really test your programming abilities, versus realizing that you passed GL_LINE to glBegin() instead of GL_LINES or some stupid API issue like that.

    Later, you can work on your OpenGL skills; heck, you could even play with it in Python if you're curious. You'll find that any API is easier and more satisfying to use if you say 'How does this API address the following problem in graphics?' as opposed to browsing through the API reference and saying 'Ooh, what does this function do?'.

    As for the Linux part, my advice would be to read up on Makefiles and spend some time writing them for various projects. When you've really got a handle on them, you can move on to CMake or autotools or whatever - but jumping into those without knowing that basic mechanism does you a disservice. I'd also recommend experimenting with one of those fancy programming editor (I recommend The One With All of the Modifier Keys [gnu.org]), but there are several that are very good.

    Good luck!
    njord

Unless you love someone, nothing else makes any sense. -- e.e. cummings

Working...