3D graphics newbie - SDL or OpenGL?


Results 1 to 7 of 7

Thread: 3D graphics newbie - SDL or OpenGL?

  1. #1
    Join Date
    Oct 2002
    Location
    Baton Rouge, Louisiana, USA
    Posts
    799

    3D graphics newbie - SDL or OpenGL?

    I'm a newbie to 3D graphics programming, and I'm wondering what's the best way to get into it. I'm interested in doing simple interactive full screen applications, like a 3D image gallery browser.

    My basic searching around suggests that SDL with OpenGL is better than straight OpenGL with GLUT. Is that right?

    I'm mainly interested in Linux only development, although multi-platform Linux/Windows would be a nice bonus if it's not much extra effort.

    Also, I wonder whether there is any compelling reason to use C++ rather than C. I'm more familiar with C programming than C++, and SDL is more C oriented. Thus, I'm leaning heavily toward programming in C.

    Thanks!
    Isaac Kuo, ICQ 29055726 or Yahoo mechdan

  2. #2
    Join Date
    Oct 2002
    Location
    Baton Rouge, Louisiana, USA
    Posts
    799
    Oh--I should note that I have a degree in Mathematics so I'm already familiar with the mathematics behind 3D graphics. I've also done some 3d ray tracing programming in the past, but I'm new to realtime hardware accelerated 3D graphics.

    Thanks!
    Isaac Kuo, ICQ 29055726 or Yahoo mechdan

  3. #3
    Join Date
    Apr 2002
    Posts
    259
    I've grown fond of SDL in the last couple months. With it and a couple add on libs(SDL_Image, SDL_TTF, etc), I have everything I need. I've used mingw in windows to build the programs without problem, though I now prefer to cross compile in Linux using cross-tools, works great.
    OggVorbis gets mobile...
    http://www.gentoo.org
    Is that a penquin in your pocket or are you just happy to see me?

  4. #4
    Join Date
    Apr 2001
    Location
    SF Bay Area, CA
    Posts
    14,936
    I can't think of any good reason to use C++, myself. Especially when SDL and OpenGL (and glut) all work against just plain C.

    But then, I don't much like C++, either, so take this comment for whatever it's worth...

    Anyway, so the question is, should you use SDL or glut. I think SDL is a bit more widespread on end user systems than glut, but that doesn't necessarily mean I'm right. It may not be. I know that when I'm doing a bare LFS install, though, I rarely install glut at all, but SDL goes on right away (very soon after X).

    And then, there's the fact that a LOT of games for Linux use SDL, and not much at all (that I can think of anyway) uses glut. Not to say you should use SDL just because everybody else is, but maybe "everybody else" has learned something that I haven't yet, which is why they're all using SDL.

    Or maybe they just all want to be like Loki, and since Loki wrote SDL (and former Loki employees still maintain it), it just makes sense to them. I don't know...

  5. #5
    Join Date
    Apr 2002
    Posts
    259
    Keep in mind that SDL is currently limited to one top level window, so if your app is gonna need more than that your gonna have to look for other solutions. Also think about any other libraries you might want/need to use, which may provide the same functionality as SDL. For example Flightgear uses glut over SDL I believe mainly because other libs they rely on provide much of the functionality you would use SDL for, like joystick interface and what not.

    As far as any advantage to using C++ over straight C, there is none, no disadvantage either. In other words, its just a matter of personal preference.
    OggVorbis gets mobile...
    http://www.gentoo.org
    Is that a penquin in your pocket or are you just happy to see me?

  6. #6
    Join Date
    Oct 2002
    Location
    Baton Rouge, Louisiana, USA
    Posts
    799
    Thanks for the feedback and suggestions! I wasn't aware of that 1 window limitation of SDL. For the relatively simple applications I'm interested in, this limitation is okay.

    Thanks again!
    Isaac Kuo, ICQ 29055726 or Yahoo mechdan

  7. #7
    Join Date
    Jan 2004
    Posts
    407
    the reason SDL is used more then glut is simply one of power, SDL gives you a lot more then windowing (sound, image libs, cross-platform threading, etc...). the question SDL or OpenGL? doesn't really make sense, you would be using SDL to setup your windows, and OGL for any 3d graphics you want to display. Same w/ glut. I would suggest taking a look at OpenGL Programming Guide (the "red" book). It uses glut to set up windows, but that is unimportant, and you can just use SDL instead if you prefer.
    DISCLAIMER: sometimes i use a text browser, so I may not see any emoticons directed at me.

    Brandon Niemczyk <bniemczyk@snprogramming.com>
    http://bniemczyk.is-a-geek.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •