Slashdot Mirror


Recommendations For C++/OpenGL Linux Tutorials?

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."

82 of 117 comments (clear)

  1. NeHe's good! by Xetrov · · Score: 3, Informative

    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 :)

    1. Re:NeHe's good! by KillzoneNET · · Score: 1

      I'll also vouch for this. Having just finished (today actually) Advanced Computer Graphics at my university (which is OpenGL and SDL on Linux), using NeHe's tutorials helped a lot. Going down at the bottom of the page you can either use GLUT or Linux versions of the source to get a very good version of what is already on the site. They even build on previous lessons.

      However I must say that the site is growing old. It references a lot of depreciated functions and, quite frankly, is not the best method to learn OpenGL unless you already have some experience in the concepts. What it does do is give you the basics without going into detail on what you are actually doing.

      Another suggestion I'd recommend is the OpenGL Redbook which is available online. It covers the mathematics behind the code. It too may be a little out of date, so try to find something that can supplement for the newer technology.

    2. Re:NeHe's good! by abdulla · · Score: 1

      The real problem is NeHe's tutorials are painfully out of date. Modern OpenGL has deprecated or removed a lot of the functionality that is used in those tutorials, and there doesn't seem to be any update for OpenGL 3 or 4.

  2. They are both platform agnostic. by ville · · Score: 4, Insightful

    C++ and OpenGL are both platform agnostic, why do you need the tutorial to be for a specific platform? Perhaps you need a tutorial on how to use your toolchain to compile C++ and OpenGL programs or linux?

    // ville

    1. Re:They are both platform agnostic. by Anonymous Coward · · Score: 1, Informative

      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.

    2. Re:They are both platform agnostic. by mdwh2 · · Score: 1

      Indeed - basically all NeHe is lacking is a Linux version of http://nehe.gamedev.net/lesson.asp?index=01 , instead of just Windows, Solaris and OS X. The rest of NeHe works fine.

      I think a bigger point to watch out for is that some of NeHe's tutorials are quite old, and not that relevant for modern rendering techniques (e.g., immediate mode, display lists).

    3. Re:They are both platform agnostic. by mdwh2 · · Score: 2, Informative

      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?

    4. Re:They are both platform agnostic. by jellomizer · · Score: 1

      I didn't know windows c++ allowed you to run
      #include

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    5. Re:They are both platform agnostic. by Zumbs · · Score: 1

      But there are a few gotchas when playing around with OpenGL in Linux (using the Redbook). As an example: Which packages do you need to install? A few years back, I tried it out, and discovered (to my great annoyance) that the nVidia drivers for my graphics cards only came with with headers for OpenGL v 1.0, even though the card supported OpenGL 2.1. The open source alternatives only supported OpenGL 1.3, but had other problems.

      --
      The truth may be out there, but lies are inside your head
    6. Re:They are both platform agnostic. by hasdikarlsam · · Score: 2, Insightful

      That is no longer the case. However, it doesn't matter; you shouldn't be using the headers directly, you should be using GLEW.

      I'm pretty sure that was around a few years back, too.

    7. Re:They are both platform agnostic. by SupaSaru · · Score: 2, Informative

      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.

    8. Re:They are both platform agnostic. by Anonymous Coward · · Score: 1, Informative

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

    9. Re:They are both platform agnostic. by bastard01 · · Score: 2, Insightful

      How about something from the 25th lesson? http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=25 The implementation of CreateGLWindow() is very windows specific, and from what I've looked at, there doesn't seem to be a tutorial for a Linux/X11 nor a SDL specific implementation, they do have GLUT for OS X and Solaris.. However, actually creating a window and polling for key input is very platform-specific with NeHe's tutorials, which may be why the OP was asking for tutorials specific to Linux.

    10. Re:They are both platform agnostic. by StormReaver · · Score: 1

      Perhaps you need a tutorial on how to use your toolchain to compile C++ and OpenGL programs or linux?

      It isn't that simple. Both C++ and OpenGL only cover a small segment of what is needed for 3D applications and games. There is a lot of stuff not covered by either of those that are very much platform specific (controllers, sound, networking, etc.).

      That said, NeHe's tutorials are still perfectly fine since most (if not all) of them have Linux conversions of the platform-specific stuff that you can download at the end of each tutorial.

    11. Re:They are both platform agnostic. by mdwh2 · · Score: 1

      But the Windows specific code is stuff that you've learned in lesson 1 (which as I say is the only one that's platform specific) - it's just the basic stuff to set up OpenGL with your OS. The things that you learn in that lesson aren't Windows specific - and if you're not sure how to set up OpenGL with your OS, you shouldn't be doing that lesson yet.

      The bottom of the page has links to the Linux code.

    12. Re:They are both platform agnostic. by mdwh2 · · Score: 1

      ...in fact, that lesson states:

      "The CreateGLWindow() and WndProc() code hasn't changed. So I'll skip over it."

      So the implementations of those functions aren't covered for any platform, Windows included.

  3. Re:Have you tried this thing called 'Google'? by Rik+Sweeney · · Score: 1

    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

    Thanks for RTFS

  4. Re:Have you tried this thing called 'Google'? by Assmasher · · Score: 2, Interesting

    I forgot to add, the framework comes in Linux flavors. I have contributed to the Linux tutorials myself there.

    --
    Loading...
  5. Re:Have you tried this thing called 'Google'? by Anonymous Coward · · Score: 1, Informative

    You ever heard of reading the summary?

  6. Re:Have you tried this thing called 'Google'? by Assmasher · · Score: 4, Funny

    Yeah, I cringed after I posted... LOL. Sorry, after reading the title I didn't bother reading the rest because NeHe has Linux versions of just about everything (which I've helped with.)

    I guess I ASSumed nobody would look at NeHe and then ask where to get Linux/OGL tutorials :). Hehe. A poor start to the day.

    --
    Loading...
  7. It's OpenGL -- platform independent by cerberusss · · Score: 1

    Since the question is specifically on OpenGL, I'd expect the tutorials to easily be converted to any other platform.

    --
    8 of 13 people found this answer helpful. Did you?
    1. Re:It's OpenGL -- platform independent by Pseudonym · · Score: 1

      OpenGL is indeed platform independent, apart from opening a window or getting input from the user. So long as you never need to do either of those, you don't need a platform-specific tutorial.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
  8. Re:Have you tried this thing called 'Google'? by stevenvi · · Score: 2, Interesting

    Parent obviously didn't read the summary. But that said, the code written in NeHe's tutorials are ported to like 20 or more platforms, and you might find that to be useful.

    I learned OpenGL by buying a copy of the Red Book, and then used Allegro (a cross-platform gaming library) to set up a rendering surface. This could also be accomplished by using the SDL library, but I do not have any experience using it.

    (Regarding Allegro, the 4.4 series is a completely different API from the 4.9 series in development, but both can create a window for rendering OpenGL. I would personally suggest using the 4.9 series.)

  9. LazyFoo might help by Drethon · · Score: 5, Informative

    LazyFoo's website http://www.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.

  10. All you're really looking for is one tutorial... by llvllatrix · · Score: 4, Informative

    ...on how to get your rendering context setup in Linux. Here are a few:

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

    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/

  11. Game engines by __aayejd672 · · Score: 1

    You could try getting involved with some existing game engines written for Linux/whatever else. Learn the engine basics then get into the guts of it. Check out Irrlicht Engine for one, last time I was there it seemed a friendly and helpful crowd on the forums.

  12. Re:Have you tried this thing called 'Google'? by NJRoadfan · · Score: 3, Informative

    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/

  13. Standard C++ books by porsche911 · · Score: 5, Informative

    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

    1. Re:Standard C++ books by trurl7 · · Score: 3, Interesting

      Koenig's "Ruminations" are beautiful! So glad you included it!

      Definitely second that list. I would add Alexandrescu's "C++ coding standards" (I'm an Andrei fanboy), and Sutter's "Exceptional C++: 47" and "Exceptional C++: 40 new".

      For the very beginning of C++, I like Lippman's "Essential C++", and, when you're feeling up to it, Lippman's "C++ Primer". If you want to know how C++ works under the hood, read "Inside C++ Object Model", also by Lippman (it's heavy lifting, and not needed for just using the language).

      There are some other nice books around this topic, but I think these two lists complete the 'core'.

    2. Re:Standard C++ books by Dogbertius · · Score: 1

      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

      If you're looking for something that's mainly syntax, but with some really good examples and and practice exercises (with accurate solutions online), try C++ Primer Plus by Steve Prata. Very good book.

      http://www.pearson.ch/Informatik/SamsPublishing/1449/9780672326974/C-Primer-Plus.aspx

    3. Re:Standard C++ books by blue_teeth · · Score: 1

      May I add "Thinking in C++" by Bruce Eckel? It is available for free download from Bruce Eckel's site.

    4. Re:Standard C++ books by AuMatar · · Score: 1

      Stroustrup's book is horrible for learning C++. Poorly organized and rambling. I'd pick up a learn X in 24 hours book before Stroustrup.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    5. Re:Standard C++ books by porsche911 · · Score: 1

      Agreed. It isn't meant for raw beginners but it is still the best reference for the language and essential for a hard core C++ programmer to have as a reference.

      Thanks for adding the Lippman Object Model book. Another very worthwhile book to have if someone wants to be a real C++ guru.

    6. Re:Standard C++ books by Xtifr · · Score: 1

      Agreed. It [Stroustrup] isn't meant for raw beginners but it is still the best reference for the language and essential for a hard core C++ programmer to have as a reference.

      Gotta disagree with you there. I thought the same until I picked up O'Reilly's C++ in a Nutshell one day on a whim. Since that day, the only time I've found myself turning to Stroustrup is when the Nutshell book is at another site. K&R was/is the best reference for C, and a lot of people (including me) assume(d) that the same magic applies with Stroustrup and C++, but I'm here to tell you that my search time for the answers to questions about C++ has dropped dramatically since I abandoned that notion.

      Of course, Nutshell is even less suited to raw beginners, who have at least a chance of learning the language from Stroustrup. :)

  14. Re:Have you tried this thing called 'Google'? by HungryHobo · · Score: 1

    I remember a couple of years ago trying to get some of those working in windows and it complained about glaux.
    There's some "glaux replacement code" but I couldn't get that working either.

    So any any idea if the tutorials will ever be updated to work out of the box so that newbies can avoid worrying about dependencies until they have a handle on the material?

    It massively detracts from the value of the tutorials to newbies when the tutorial code simply doesn't work which is a pity because they're good tutorials otherwise.

  15. GLEW: The OpenGL Extension Wrangler Library by icf50h · · Score: 1

    http://glew.sourceforge.net/ GLEW also comes with the NVIDIA SDK: http://developer.nvidia.com/object/sdk_home.html NVIDIA SDK is also a good place to start with OpenGL.

  16. Re:Google it! by happy_place · · Score: 1

    ...and thus we see why people hate developing for Linux...

    --
    http://www.beanleafpress.com
  17. Why not look at an existing game engine? by i.r.id10t · · Score: 1

    Why not take a look at the code for an existing game engine like Quake (1/2/3) ?

    --
    Don't blame me, I voted for Kodos
    1. Re:Why not look at an existing game engine? by Savage-Rabbit · · Score: 2, Insightful

      Why not take a look at the code for an existing game engine like Quake (1/2/3) ?

      That's a bit too much for a beginner if you ask me. Better start out with some simple sprite based game to learn the basics and move on to 3D from there.

      --
      Only to idiots, are orders laws.
      -- Henning von Tresckow
  18. I'd look at... by stakovahflow · · Score: 1

    I'd look at:
    www.cplusplus.com
    www.thefreecountry.com
    www.cprogramming.com
    Those sites are good for beginner/intermediate programmers, to start with. (Really, it depends on whether or not you have a good foundation in C/C++, as to where you should look...)

    Good luck!

    --
    Holy happy hippy crap!
  19. Dear god no! by Anonymous Coward · · Score: 4, Informative

    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.

  20. Red book helped me. by online-shopper · · Score: 1

    http://www.glprogramming.com/red/

    I don't have any of the other links I used when I was learning it, but I do have the source from the maze toy program I wrote while I was doing so.

    http://www.bravegnuworld.com/~rjune/maze.tar.bz2

    I hope it helps you.

  21. Use Qt by e8johan · · Score: 3, Insightful
    1. Re:Use Qt by l_i_g_h_s_p_e_e_d · · Score: 1

      Yes, the qt4 opengl blogpost looks like a good start. Qt even has a utility class to compile shaders for you.

    2. Re:Use Qt by Emetophobe · · Score: 1

      I recommend http://zetcode.com/tutorials/qt4tutorial/ for learning the basics. Nokia also has some excellent tutorials examples and documentation.

  22. Re:Have you tried this thing called 'Google'? by Anonymous Coward · · Score: 1, Insightful

    http://nehe.gamedev.net/wiki/LessonLinux.ashx

    that's all you should know - those are not tutorial for the newbie in how to fix dependencies or learn c++
    if you need help in replacing a library in your ide of choice, you should restart from hello world and work all the way up from there again.

    those are tutorials about opengl - please LEARN the language BEFORE.

  23. Re:Have you tried this thing called 'Google'? by TerranFury · · Score: 1

    Seconded. GLUT is probably the easiest way to get started. If you go to the GLUT page you'll also find a list of OSS alternatives to GLUT (GLUT is free but closed-source) if you'd prefer to use one of those. Although this tutorial makes a reference in the beginning to some MSVC-specific pragmas to set linker options, it's probably pretty good for your purposes on the whole. Finally, there are other forums more specifically geared towards the things you're interested in; e.g. gamedev.net.

  24. SDL/OpenGL tutorial by goertzenator · · Score: 1

    Here's a tutorial to get you rolling with OpenGL in SDL under linux. Once you get rolling with that, you can proceed to the NeHe tutorials. http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/ogladv/tut1

  25. Re:Have you tried this thing called 'Google'? by HungryHobo · · Score: 2, Insightful

    A tutorial which simply doesn't work is still a broken tutorial.

  26. Re:Have you tried this thing called 'Google'? by grub · · Score: 2, Funny


    I have contributed to the Linux tutorials myself there.

    If I reference your work, how would you like to be listed? As "Assmasher", "Mr. Assmasher" or "Dr. Assmasher", assuming you have a PhD?

    .

    --
    Trolling is a art,
  27. Allegro is not compatible with PulseAudio by tepples · · Score: 1

    If I use Allegro for 2D graphics, 3D graphics, and input, then what do I use for sound? Allegro used to be able to output sound on Linux, but distributions that use PulseAudio broke Allegro because PulseAudio can't handle unsigned samples. Has this been fixed yet?

  28. I think you're really asking 2 different questions by jimrthy · · Score: 4, Informative

    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

  29. Re:All you're really looking for is one tutorial.. by tepples · · Score: 1

    After you get a rendering context set up, you still need to load textures. This may differ per operating system unless you're using OpenGL with a cross-platform library like SDL_Image or Allegro.

  30. My grudge against NeHe by Mabbo · · Score: 2, Informative
    ... 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.

    1. Re:My grudge against NeHe by kazade84 · · Score: 1

      I'm the author of that book.

      I'm sorry you didn't enjoy the book. The book's structure and format followed that of its predecessor (the first edition) which was written by different authors. It was not possible to put entire code listings into the text of the book due to space limitations, which is why the book came with the full source on the CD.

      That said, the initial print run of the book had a fault with the project files on the CD, they did indeed have absolute paths. I posted updated versions on the book's official website at courseptr.com[1] and posted updates on NeHe explaining the problem. Later, when ATI updated their drivers and became more strict about an ambiguous part of the GL specification, I updated the project files again[2].

      There are Linux versions of all the programs on the CD with project files for Code::Blocks, and the code compiles on both GCC and Visual C++ so I think it's a little unfair to say it was only for Visual Studio. Try out the updated project files, hopefully you'll have more success with them.

      Regards,

      Luke Benstead.

      [1] http://www.delmarlearning.com/companions/content/159863528X/links/index.asp?isbn=159863528X
      [2] http://www.kazade.co.uk/downloads/boglgp/bug-fixes-2009-08-29.zip

  31. Two quick points by Blakey+Rat · · Score: 1

    1) OpenGL and C++ are both multi-platform, so I don't get why you need something specifically aimed at Linux. You can't just translate Windows C++ samples?

    2) Since video games aren't CPU-bound anymore, and since Python is a *much* cleaner and easier language than C++, and since Python has OpenGL libraries available-- why?

    The only benefit you're going to get from this is the knowledge that C++ kind of sucks compared to Python. I can tell you that right now and save a lot of time.

    1. Re:Two quick points by SupaSaru · · Score: 1

      Hi! To go with point 1 - Can you "translate Windows C++" ? If so, you have the answer to a multibillion dollar portability question and the solution as to how to get Linux significantly into mainstream games and other entertainment. Go look into how to create a window in C++. Then look into how to create a window in GTK+. Tell me how good you are at instantly converting these samples while trying to understand how OpenGL contexts and rendering works.

    2. Re:Two quick points by jjohnson · · Score: 1

      Nehe's tutorials tie the OpenGL stuff into a game application framework that's totally Windows based--win32 event handlers, windowing code, etc. After following them all through, you've got something that's basically impossible to port to Linux, and learning OpenGL this way, you need that application scaffolding to do any useful work with the library.

      --
      Anyone who loves or hates any language, platform, or manufacturer, doesn't know what they're talking about.
  32. Framework helps by wesw02 · · Score: 1

    IMHO A framework can help out a lot, especially when your just getting started. A framework can help get you up and going rather quickly without having to worry about configuring everything. I'd recommend Qt. Here are some great examples: http://doc.trolltech.com/4.6/examples-opengl.html

  33. SDL+OpenGL/3D Tutorials by phorm · · Score: 1

    2D samples are great, and I see that the last touches on OpenGL, but does anyone know a place with some more in-depth tuts for SDL+GL?

    1. Re:SDL+OpenGL/3D Tutorials by Reapman · · Score: 1

      In the last few months i've been working on reteaching myself C++, as well as using SDL and OpenGL for writing a "tactics" style game (as a way to learn this stuff). I used both code from LazyFoo and NeHe for most of what I learned, and google for everything else. It's worked fairly well, I got a nice framework for writing a GUI and already have a lot of the graphics work going for the game itself, now I'm just looking at writing my own 3d model loader for some more complex stuff.

      I honestly found the most complex part, so far, to be font rendering. I ended up sticking with SDL's ttf library for that.

      Although I don't consider myself even remotely an expert on any of this, since you seem to be where I was a few months ago if you have any questions feel free to ask.

    2. Re:SDL+OpenGL/3D Tutorials by phorm · · Score: 1

      It definitely does sound like we're in the same ballpark. I've been working from the "red book" and built a hierarchal class system for scene->object->element->face->vertex and camera, etc. My camera pitch rotation is a bit messed when it hits 180 but otherwise it was going well until life distracted me from the hobby-coding again. I'd love to trade ideas/assistance in porting the base GL code up to something like SDL or Ogre.

      Email me ph3or7mix@ph6o8rmi1x.c3om. (Remove the numbers, it's obfuscated to reduce spam)

  34. GL version by WilyCoder · · Score: 1

    You need to figure out which version of GL you want to learn.

    The newer versions of GL completely remove immediate mode (glVertex3f() etc)...

    My memory is a bit rusty but I think GL 3.2 removed immediate mode completely. Its definitely removed from the recently announce GL 4.0.

    Its a shame because immediate mode makes learning GL all the more easier to learn.

  35. Re:Have you tried this thing called 'Google'? by 3dr · · Score: 1

    And Thirded. GLUT / freeGLUT is simply the easiest way to get an OpenGL application running without having to create the window, the opengl context, etc. GLUT library documentation is: http://www.opengl.org/documentation/specs/glut/spec3/node1.html

  36. Re:Have you tried this thing called 'Google'? by isorox · · Score: 1

    Re:Have you tried this thing called 'Google'? (Score:5, Funny)
    by Assmasher (456699) writes: ... I guess I ASSumed nobody would look at NeHe and then ask where to get Linux/OGL tutorials :). Hehe. A poor start to the day.

    Perhaps you've got something else on your mind

  37. Suggestions by bioglaze · · Score: 2, Informative

    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
    http://www.opengl.org/wiki/Tutorial:_OpenGL_3.1_The_First_Triangle_(C%2B%2B/Win)

    --
    Who is John Galt?
  38. Skip some basic steps by paulolellis · · Score: 1

    I recommend you to use the SMFL library, which supports opengl and it's portable to many systems including linux, windows and osx. take a look at http://www.sfml-dev.org/ Good lucky!

  39. C++ FAQ Lite by IsoRashi · · Score: 1

    C++ FAQ Lite

    I used this site a bunch when I found myself doing some c++ work after almost exclusively working in java.

    --
    This is not the greatest sig in the world, no. This is just a tribute.
  40. That's 3 subjects (of varying complexity) by njord · · Score: 4, Informative

    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), but there are several that are very good.

    Good luck!
    njord

  41. NeHe is horribly outdated by Syniurge · · Score: 1

    Look for OpenGL ES 2 books and tutorials, e.g this one : http://opengles-book.com/index.html

    OpenGL ES is OpenGL minus the totally outdated stuff you should never pay attention to (and which is sadly used in most web OpenGL tutorials, because they're all old), i.e it's a subset of OpenGL and is the right way to learn and do OpenGL programming today.

  42. Re:Have you tried this thing called 'Google'? by flablader · · Score: 1

    As OP explicitly said C++, I have to wonder, are they looking for an Object Oriented type of framework? If so, GLUT doesn't fit the bill, it's a pure C, function callback oriented framework. It could be used in an OO like manner, but it isn't OO itself.

    The only OO framework I've found for use with OpenGL is FLTK, but my experience with OpenGL is quite limited. What other OO frameworks are available and worth the effort to learn?

  43. Source code of glxgears by BerkeleyDude · · Score: 3, Interesting

    Get the sources of glxgears (in mesa-utils), and look through the code. It's relatively simple, and will help you get started.

    Also, when I was looking for an OpenGL example that uses just X11, without Qt/Glut/whatever, the best one I could find was this: http://msdn.microsoft.com/en-us/library/dd318252(VS.85).aspx (Yes, the irony is overwhelming...)

  44. Re:Have you tried this thing called 'Google'? by Jurily · · Score: 1

    Perhaps you've got something else on your ASS

  45. VTK by Anonymous Coward · · Score: 1, Interesting

    If you really be able to make complicated 3D scenes quickly I'd recommend learning VTK (Visualization ToolKit). It's what professional visualization researchers use to display data, has a bit of a learning curve but it has a ridiculous number of 3D graphics algorithms (extrusion, creating meshes from point clouds, transformations, importing data from various formats, etc. etc.)

    Also if you really want to be able to prototype ways to visualize 3D data quickly there are python bindings :)

  46. Multi-platform C++ by Script+Cat · · Score: 1

    Why it's an absolutely seamless transition.
    C++ is multi-platform.

    #include "stdafx.h"
    #include "resource.h"

    #define MAX_LOADSTRING 100

    // Global Variables:
    HINSTANCE hInst;                                // current instance
    TCHAR szTitle[MAX_LOADSTRING];                                // The title bar text
    TCHAR szWindowClass[MAX_LOADSTRING];                                // The title bar text

    // Foward declarations of functions included in this code module:
    ATOM                MyRegisterClass(HINSTANCE hInstance);
    BOOL                InitInstance(HINSTANCE, int);
    LRESULT CALLBACK    WndProc(HWND, UINT, WPARAM, LPARAM);
    LRESULT CALLBACK    About(HWND, UINT, WPARAM, LPARAM);

    int APIENTRY WinMain(HINSTANCE hInstance,
                         HINSTANCE hPrevInstance,
                         LPSTR     lpCmdLine,
                         int       nCmdShow)
    {
         // TODO: Place code here.
        MSG msg;
        HACCEL hAccelTable;

        // Initialize global strings
        LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
        LoadString(hInstance, IDC_XX, szWindowClass, MAX_LOADSTRING);
        MyRegisterClass(hInstance);

        // Perform application initialization:
        if (!InitInstance (hInstance, nCmdShow))
        {
            return FALSE;
        }

        hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_XX);

        // Main message loop:
        while (GetMessage(&msg, NULL, 0, 0))
        {
            if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
            {
                TranslateMessage(&msg);
                DispatchMessage(&msg);
            }
        }

        return msg.wParam;
    }

  47. recommended book and IDE by CosaNostra+Pizza+Inc · · Score: 1

    Bruce Eckel "Thinking in C++" Volumes 1 and 2. You can buy the softbound books or find them online for free. I suggest you develop using an IDE in linux, instead of the CL. Two popular C++ IDEs for Linux are Eclipse and my favorite Code||Blocks, which is a good option for anyone migrating from MS Visual C++

  48. Re:Have you tried this thing called 'Google'? by Anonymous Coward · · Score: 1, Insightful

    yeah so you should have your tutorials available as ready to go projects for every ide you may fancy to choose? nonsense.
    each ide has its own project definition file, each one differing in how to track library dependencies.

    if you think that a tutorial failing to provide project definition for every ide out there is broken, probably you had newer worked on a real project.
    as I said: learn the language, the ide you're working on, and stop complaining about non issues.

  49. Qt might be a good choice by Urkki · · Score: 1

    I'd start by downloading the full SDK here.

    Then fire up Qt Creator, go to welcome screen getting started tab, and dig into the rather interesting and well-documented examples. Hint: QGraphicsView combined with OpenGL is probably the way to the future, especially if you're not interested in building traditional boring GUI applications.

    If you want a little more help getting started, google "qt tutorial" for more adding-features-step-by-step type stuff.

  50. C++ & OpenGL by metamatic · · Score: 1

    There is really nothing about the OpenGL API that is in any way object-oriented. It's not just procedural, it's procedural with global state variables. So if you want to build your 3D software in OO style, your first task is going to be making object-based wrappers around the procedural OpenGL code.

    So basically, you can forget about C++ and use C, Ruby, Java, or anything else you fancy while learning OpenGL from the tutorials you've already been pointed at. Then you can learn how to wrap procedural C in a C++ object-based wrapper.

    Alternatively, you might look for existing OO wrappers for OpenGL; but the problem there will be that you're wedding yourself to that particular library/framework and whatever platforms it supports.

    (I went through much the same process, but with Objective-C and OpenGL, 'cause C++ sucks and because my primary target was OS X.)

    Then there's the third orthogonal issue of how to build Linux C++ binaries. My personal suggestion would be that until you have a compelling need for something more sophisticated, you go with a simple old-fashioned hand-written Makefile.

    --
    GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
  51. Just use NeHe by fotbr · · Score: 1

    Yes, I read the question. Scroll to the bottom of the NeHe tutorial pages and see that most of them have Linux, Linux/GLX, and/or Linux/SDL code downloads.

    Use those. The OpenGL stuff is the same as it's cross platform. The Windows-specific stuff will have been replaced with Linux-specific stuff, and after a quick glance, is explained about as well as the windows-specific stuff (which is to say, mostly glossed over, since NeHe does OpenGL tutorials, not Windows/Linux/whatever tutorials).

    If you're having problems with the linux-specific stuff, you should probably look for an X tutorial first, as most of the NeHe tutorials assume you already know how to do things like create a window.

  52. Re:Have you tried this thing called 'Google'? by Assmasher · · Score: 1

    Well, since you've assked ;), the name comes from an old Dragon magazine short story about a stubby little dwarf with a giant warhammer he's named 'assmasher' and he does a lot of mashin' in the story - for some reason, as a 10 year old this really hit my funny bone when I read it (weird, I know.) It's a poor choice of nickname but I started using it in the BBS days and am pretty much stuck with it now.

    --
    Loading...
  53. Joanjett by joanjett · · Score: 1

    I remember a couple of years ago trying to get some of those working in http://www.squidoo.com/womensera