GLUT or native window?

Started by
11 comments, last by santa01 11 years, 2 months ago

Hi, i'm starting this topic to ask what is best GLUT or native window to use with OpenGL?

Advertisement

GLUT creates native windows, but for several platforms. And there isn't really any best. GLUT gives you cross-platform and might be a bit easier to use.

I find GLUT limiting and manually creating a native window annoying. Some other options are using SDL or SFML to handle the windowing for you.

But you recommend to program Windows with FreeGlut or native window?

I recommend GLFW (http://www.glfw.org/), It does pretty much the same things as GLUT, but is nicer to use in my opinion.

Personally, on BSD/Linux, I use a native window (via glx) but for Windows and Mac OS X I am quite happy with glut.

Glut is a C library which does annoy a few C++ developers but I personally prefer it (Even with C++).

Creating a native window in Windows is a little messy so GLFW or *glut is probably going to be better for you.

Some other full GUI library alternatives are...

wxWidgets - wxGLCanvas
Gtk - gtkglext
http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.

But i'm talking about performance.

Performance wise - Programming with the native libraries is probably the best bet. Glut has several issues such as not being able to control your main loop and how it exits. As well as some licensing issues that require the use of Freeglut. SDL/SFML/GLFW is probably the best bet if you want to make a cross platform window as these all give you control and some nice extra features. Personally i use SFML 2.0. Windows programming is very messy and un-intuitive, not to mention not cross platform (Obviously) and so i generally avoid it. I don't belive Glut has been updated in a long time either but i may be wrong. I'm quite sure that the window has little effect performance wise. It's more to do with how you develop your application. Just use whatever library you feel most comfortable with and allows you to get your applications running fast.

I recommend neither. The truth is that either is just fine for the basic task of creating a window; if you want to do anything else with that window (like recieve input into it or generate sound from it) then GLUT will give you a simple (and simplistic) way of doing some of that, going native will give you more comprehensive (but more complex) capabilities.

Performance? It doesn't matter a damn. This is just creating a window; once that's been done your OpenGL driver and graphics hardware take over for all rendering tasks. The determinator of performance will be your OpenGL driver and graphics hardware, not how you created your window.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

Native on windows is a bit messy for me. I use GLFW, similar to GLUT but much nicer to use. Less features than SDL though, but that's fine with my uses.

This topic is closed to new replies.

Advertisement