OpenGL cross platform window - c++

I'm looking for a window... ugh... thing for OpenGL, I've been using SDL but more recently found that its not quite up to my needs in at least any code I've seen. I'd like to find some GUI library that allows me to develop using OpenGL (and SDL if at all possible) with a menu bar, possibly options at the side, and a working-out-of-the-box close button. Qt is the sort of thing I'm looking for, but I'd like to work with something that doesn't force me to make it open source.
A quick list of things I want, a working close button, ability to use OGL, cross platform, any licence that doesn't force me to become open source, free, and the ability to go full screen and change resolution on the fly.
I have searched myself, I'm not a lazy person really ;) I just want to get some opinions here before I dive off into anything and find its not really suitable for my needs.
Thanks in advance for any feedback.

Try wxWidgets. There's a link on using it with OpenGL here.

When Qt 4.5 comes out (later this month, I think) it will be LGPL, so if you can wait a couple weeks, you can use Qt without having to open-source your program.

GLUT (GL Utility Toolkit) comes close to what you're looking for. It's quick and easy and cross-platform, although it does not have support for menu bars. This page also has a number of GLUT-like alternatives.

For the out-of-the-box close-button enabled window, you can have GLUT, as mentionned before, and if your additional GUI needs are really simple, I think GLUT can provide you some.
You could also go for simple OpenGL rendered menus and buttons, either using NVidia Widgets or AntTweakBar.

You don't need 'support' for OGL as long as you can pass it the correct the information. On windows at least, if you have a windowing API that you can hook the HWND from, you can set up OGL to use pretty much any window you want. I've done this successfully with wxWidgets and straight win32. I can't help you with other platforms, but I suspect you can do something similar.
This works with D3D too and is a nice way of separating your rendering code from your windowing API.

SDL can create OpenGL Windows.
http://gpwiki.org/index.php/C:SDL_OGL

There are numerous rendered widget libraries such as those that rotoglup suggested. Have a peek at CEGUI and QuickGUI, they may make you happy (although CEGUI disappoints me with its abuse of XML). And here's a shameless plug: GLICT.

Related

VST2.x GUI How does it work?

Although I know how to create a VST plugin today, I still don't understand the GUI part of it.
I've been playing around with Steinbergs samples and what I can see is that they are using some default sliders in the exapmles, but am I supposed to use these when designing my own and apply some graphics to them? Or should I create my own completly? How should I think around the GUI approach to make the GUI code also work for both PC and MAC later on?
I've been searching my rearbehind off but can't find anything about these questions anywhere. Please give my a lead or guide me to the light so I can grow my hair back.
How should I think around the GUI approach to make the GUI code also
work for both PC and MAC later on?
If that is your ultimate goal, then I strongly suggest you check out the JUCE library. The plugin wrappers are very good and it is completely cross-platform.

Cross platform GUI window in C++

I wondered why I couldn't find a question about that already. How can I create a cross-platform window in C++? By cross-platform I mean support for at least Windows, Mac and Linux.
If there is a library for only this task out there I am willing to use that. But I don't want to use a bloated library with window controls like wxWidgets.
I don't need GUI controls because I am going to use OpenGL. (And for some reason I don't want to use frameworks like GLUT or GLFW.)
Try C++ bindings library for Tk. It's a very lightweight and simple.
There are others, I recommend and use FLTK. But Qt is also my favorite. See what works best for you and your patterns of thinking.
FLTK is extremely light weight.

Is there a way to have an OpenGL context inside a GTK3 application?

I had a look at GtkGlExt, but it's only for GTK2. Unfortunately, after some hours of searching, it seems that no one take care of having something like an OpenGLDrawingArea…
Any information will be welcomed. Even if it's like "it's not possible for now".
It looks like you have a few options here.
Use an in-development port of gtkglext to gtk3
Use SDL to draw into your GTK app by setting the SDL_WINDOWID environment variable
Manage GLX yourself to create an OpenGL context for your GTK app.
I found a app spectrum3d which implements both of the first two alternatives.
The third option will be quite complex and is probably not worth pursuing.

Skinning WinAPI Controls

If you've ever seen an application in the Adobe Creative Suite 5 (CS5), you may have noticed that it doesn't look like the native Windows GUI.. They have modified it to have a different look to it.
Where would someone begin to make an application that has a custom skin? CS5 uses the Adobe Source library for it's widget/control management, so I tried downloading and compiling the Adobe Source Library to see if I could make a nice skinned app like Photoshop CS5, but after finally getting it to compile and tested it, I realized the library was only for managing widgets and not skinning the GUI, like CS5 has.
Where would I begin to make a nice skinned program like Adobe Cs5 applications? Can anyone point me in the right direction?
Do I simply use the WM_PAINT Message from WinAPI and render my own widgets using openGL or something?
Use QT and QML. It doesn't have a steep learning curve. You define your GUI with JavaScript and add lots of effects and enjoy using PNGs in every single thing you can imagine. Then you do your application logic with C++. In fact you can do some fairly advanced things other than UI with QML but it's better to seperate concerns as always.
I use it at work for a product to be released. Overriding WM_PAINT is not the only way in Windows but I strongly recommend QT instead of Win32 API when it comes to custom drawn UI. At least to my experience, it is way easier than my adventures with Win32 API.
If you want to implement custom controls by yourself, you need to implement own WM_PAINT and draw with using GDI/GDI+. For toplevel windows and popups you can use Layered windows. But I think you can find a lot of professional custom controls over internet for reasonable price if you don't want to implement by yourself.
I think your choices re creating a modern skinned app are: QT or WPF (via C++/CLI).
If you have an existing Win32 API application and you do not want to rewrite it using a library that supports skinning you might want to have a look at Stardock DirectSkin.
If you decide to rewrite your application I would also recommend Qt. Guitar Pro 6 was rewritten using Qt, read more about their experience here.

Is there a simple way for opening one (or many) opengl window in mac OS X with C++?

Yes, I hate Objective-c, plus my project will be portable, so I'd like to code as much of it in C++ as possible, ideally 100%.
So I have a regular C++ project made with Xcode, and want to open some OpenGL windows.
edit: Damn, Glut takes over the app's control with glutMainLoop() and I'll like to have more control over the loop.
Will try freeglut, although I can't find OSX binaries, and I always have such bad luck trying to compile someone else's code.
Update:
I tried yet again to link to SDL 1.3 and this time I could get it to work! yoo-hoo!
I always wanted to work with SDL, but using more than one window was mandatory, and that's a feature of version 1.3 which is under development and I never could get it working.
As it is portable to a zillion OSes, and handles 2D graphics as well as OpenGL I'm going with it. Thanks to all!
If you don't want to use objective-c you're going to have to use either the deprecated carbon libraries, X11, or another library like GLUT to create the window. If portability is a concern either go the GLUT route, or you'll need to write your own window management code for each platform you want to support.
If you don't go the GLUT route you will need to write window management code fore each operating system so I strongly suggest you bite the bullet and write the window management in objective-c++. The only thing you really need to know is that a pointer is always a pointer no matter which language it is in, so just store objective-c ids as void* and cast them back to ids, it actually works out pretty easy.
i guess NeHe tutorials could help;
GLUT works fine for your stated purpose, although you will probably wish for a nice C++ wrapper for it. I ended up hacking my own, and although GLUT isn't friendly to wrapping, it was doable.
EDIT: Since you have a problem with glutMainLoop(), you may be trying to do more than GLUT was designed to do -- it is mainly intended for hacks, one-off projects and opengl demos. And freeglut doesn't compile OOB on the mac, at least that was my experience.
For a portable, fuller featured app, Qt may be the way to go for you. Otherwise, design your C++ for portability and use a thin GUI layer on each platform. If getting something running on each platform is most important, go for the former. If the best user experience on each platform is most important, go for the latter. You may find that "thin" is not the most descriptive term for what is involved.
I found this demo to be useful for getting a simple Cocoa/OpenGL window working, even though the code has a number of ridiculous bugs: http://developer.apple.com/library/mac/#samplecode/CocoaGL/Introduction/Intro.html
This question has been asked over 3 years ago, yet remain quite fresh. I just recently went through similar exercise for planning school curriculum, and trying to figure out what's the best portable library to work with on Mac/Windows/Linux/mobile with OpenGL projects. Perhaps my notes will help someone make a decision. I only mention the main options that I've considered.
Higher level APIs, for window management plus additional goodies, like sprites, fonts, sounds, event handling, etc:
SFML and github repo: nice&tidy, C++, object oriented library that integrates with OpenGL natively. Portability for managing windows and OpenGL 3.3 contexts out of the box on MacOS, Win and Linux. Mobile support provided in the 2.2 branch (github).
SDL2: all major platforms, including mobile, supported. The OpenGL context needs to be manually managed somewhat, so use of GLEW for example comes really handy (see below). A bit lower level than SFML.
Lower level APIs, mostly for window and OpenGL context management:
GLWF: This is pretty much a GLUT replacement for modern OpenGL. Rather low level, but portable across: Win, OSX, Lin. In active development.
GLEW: I only mention it for completness. It doesn't manage windows, but helps managing OpenGL contexts and you might use it together with GLWF or SDL for example.
Others:
Freeglut: Open source continuation of GLUT. Suitable for small demo projects. I have not used it myself, but seen good docs and demo code. In active development.
GLUT: old one, discontinued. Legacy demos and code around the net.