Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Don't forget to read Tuesday's email newsletter for your chance to win a free copy of Construct 2!


GLUT or native window?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
12 replies to this topic

#1 MisteRnoOrOnha   Members   -  Reputation: 241

Like
0Likes
Like

Posted 01 February 2013 - 01:01 PM

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



Sponsor:

#2 claesson92   Members   -  Reputation: 408

Like
0Likes
Like

Posted 01 February 2013 - 01:08 PM

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.



#3 SiCrane   Moderators   -  Reputation: 9628

Like
1Likes
Like

Posted 01 February 2013 - 01:15 PM

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.

#4 MisteRnoOrOnha   Members   -  Reputation: 241

Like
0Likes
Like

Posted 01 February 2013 - 01:15 PM

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



#5 claesson92   Members   -  Reputation: 408

Like
4Likes
Like

Posted 01 February 2013 - 01:22 PM

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



#6 Karsten_   Members   -  Reputation: 1645

Like
0Likes
Like

Posted 01 February 2013 - 02:16 PM

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

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


#7 MisteRnoOrOnha   Members   -  Reputation: 241

Like
0Likes
Like

Posted 01 February 2013 - 02:18 PM

But i'm talking about performance.



#8 Vangoule   Members   -  Reputation: 129

Like
1Likes
Like

Posted 01 February 2013 - 04:21 PM

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.



#9 mhagain   Crossbones+   -  Reputation: 8140

Like
2Likes
Like

Posted 01 February 2013 - 07:04 PM

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.


It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#10 rocklobster   Members   -  Reputation: 415

Like
0Likes
Like

Posted 02 February 2013 - 08:36 AM

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.



#11 MisteRnoOrOnha   Members   -  Reputation: 241

Like
0Likes
Like

Posted 04 February 2013 - 06:23 AM

But if i want to make this cross platform? For example if i want to run this game in Raspberry PI? Is best i make my own gui library?



#12 BitMaster   Crossbones+   -  Reputation: 4234

Like
0Likes
Like

Posted 04 February 2013 - 09:21 AM

Personally I like GLFW is a minimalist platform independent way of opening a window and creating an OpenGL context and having a very permissive license. Out of the box, it works on "Windows, Mac OS X and many Unix-like systems using the X Window System, such as Linux and FreeBSD". My experience with the Raspberry Pi is limited, but shouldn't it fall under "X Window System"?

That said, I would advise against writing your own window manager library. Even for one platform, correct window management and OpenGL context creation is tedious. Not interesting, or important or "something you should be doing", just very tedious. Doing that on multiple platforms just makes something already annoying even more so and whatever you write will probably look very much like GLFW anyway (or simply worse).

There are scenarios where the minimalist approach is not enough, but if cross platform is still a requirement I would rather investigate SFML or even Qt if things go more in the direction of a full-scale application. Both are more heavyweight and feature-rich (much, much more in case of Qt).

#13 santa01   Members   -  Reputation: 307

Like
0Likes
Like

Posted 06 February 2013 - 06:06 AM

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

 

GLUT. Its easier, its cross platform. Believe me, if WinAPI is something you can handle with MSDN opened, X11 is hell.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS