Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenGL Windowing Library for 2009 [closed]

Tags:

c++

opengl

Trying to decide on a library for creating a window and capturing user input for my OpenGL app, but there are just way too many choices:

  • GLUT (win32)
  • FreeGLUT
  • OpenGLUT
  • SFML
  • GLFW
  • SDL
  • FLTK
  • OGLWFW
  • Clutter
  • Qt
  • Others?

GLUT is simply outdated. I liked GLFW but it seems you can't set the window position before displaying it (I wanted it centered, is that so much to ask?) so you see it appear and then shift over, which bothers me. Plus development seems to have stopped on it too. SFML has some nice features, but it uses event polling rather than callbacks which I prefer for decoupling. I don't think I need all the GUI features of FLTK. SDL is slow (doesn't seem to take advantage of the GPU). And the other 3 I don't know much about (FreeGLUT, OpenGLUT, OGLWFW). So which is the lesser of the evils? Are there others I haven't heard about?

I'm just trying to make a simple 2D game. I'm familiar enough with OpenGL that I don't really need drawing routines, but I probably wouldn't complain about other functions that might be useful if they are implemented properly.

like image 826
mpen Avatar asked Aug 10 '09 00:08

mpen


6 Answers

SDL allows you to create an OpenGL context that is accelerated (depending on drivers / hardware support).

I know you tagged as C++, however pygame (python) is a great library for creating 2D games, which also supports an OpenGL context. Pygame is built on SDL.

Clutter is a new OpenGL based GUI library with bindings for Perl, Python, C#, C++, Vala and Ruby. I haven't used it myself. From the website:

Clutter uses OpenGL (and optionally OpenGL ES for use on Mobile and embedded platforms) for rendering but with an API which hides the underlying GL complexity from the developer. The Clutter API is intended to be easy to use, efficient and flexible.

like image 94
Karl Voigtland Avatar answered Oct 13 '22 01:10

Karl Voigtland


GLUT and the other GLUT alternatives should not be used in any sort of production application. They are good for putting together a quick demo application or to try something out, but not for much more than that.

If you're trying to make an OpenGL game, I'd recommend SDL. It focuses more on gaming needs. It most definitely can be used with OpenGL. A brief google for "SDL OpenGL" turned up this link on how to initialize OpenGL with SDL. Enabling OpenGL should also enable hardware rendering with the GPU.

Qt is a reasonable alternative, but it's better if you want to embed OpenGL within a larger, desktop application (think 3D modeling, CAD/CAM, medical visualization, etc) where you need access to standard OS widgets for the UI.

like image 32
Eric Avatar answered Oct 13 '22 01:10

Eric


I'd go for Qt. Nice general purpose library + opengl support

like image 42
Oleksandr Tymoshenko Avatar answered Oct 12 '22 23:10

Oleksandr Tymoshenko


IF  "learning c++ part of what you're trying to achieve":
then
IF  "you only want to learn OpenGL with a fullscreen mode":
  USE GLUT //Because it's VERY VERY simple. You can get set up VERY quick
ELSE:
  USE QT //Great library, has many many things that will help you. It is portable, it has a nice API
ENDIF

IF "you don't need C++":
then
   USE Python //I recommend it, it is fast, no long link times, good api, omg I love this language

Background:

I also tried to make simple 2D games once, I started with C++ and NeHe. I knew nothing about OpenGL and C++ (had Java background). The language overrun me, so did OpenGL. So it was a very hard learning curve.

I don't recommend going that way, since you can get faster results by using a dynamic language (such as Python). So I started learning some years later with python. I could get the "rotating cubes" working much faster.

like image 42
Edison Gustavo Muenz Avatar answered Oct 13 '22 00:10

Edison Gustavo Muenz


We have had rather good experiences with ClanLib 0.8 in 2008 and ClanLib 2.1 in 2009 on our C++ course. The productivity of the students (as measured by the quality of their project works) has greatly increased since switching over from SDL. However, it needs to be noted that 2.1 is still very incomplete and one will certainly run into features that are simply not implemented yet.

A couple of groups used Irrlicht (3D engine) with good results.

SFML looks promising, but I haven't had a chance to try it yet.

As others have stated, GLUT is not really suitable for anything serious. The rest of the libraries mentioned are something more of GUI toolkits than game development libraries.

like image 32
Tronic Avatar answered Oct 13 '22 00:10

Tronic


Per recent corespondance with the author, development on OGLWFW has stopped.

like image 23
russellpierce Avatar answered Oct 12 '22 23:10

russellpierce