Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Could someone recommend any good resources for creating Graphics User Interfaces, preferably in C/C++?
Currently my biggest influence is 3DBuzz.com's C++/OpenGL VTMs (Video Training Modules). While they are very good, they cover a large area of graphics programming, so only skim the surface of GUI programming.
This question does relate to "How do I make a GUI?", where there is also a rough outline of my current structure.
Any response would be appreciated.
Edit:
I've just read some of the answers and spotted that I've missed some points. I had to type the question twice as I caught the wrong button and lost it.
I missed two important points, first: This will be used cross platform including homebrew on a Sony PSP. Second: I want to create a GUI system not use an existing one.
Edit 2: I think some of you are missing the point, I don't what to use an existing GUI system I want to build one.
Qt in it's current form is not portable to the PSP, never mind the overkill of such a task.
That said I've decided to create an IM-GUI, and have started to prototype the code.
I wouldn't use OpenGL for the GUI unless you are planning for hardware accelerated and/or 3D effects that you don't think you would get with a more traditional GUI toolkit (e.g Qt, wxWidgets, GTK, etc). If you just need a quick simple GUI for hosting your OpenGL graphics then FLTK is a nice choice. Otherwise, for rendering the GUI directly in OpenGL their are libraries like Crazy Eddie's GUI that do just that and provide lots of skinnable widgets that you won't have to reinvent. The window and OpenGL context could then be provide with a portable library like SDL.
EDIT: Now that I've gone back and taken at look your other post I think I have a better understanding of what you are asking. For a GUI on an embedded system like the Nintendo DS, I would consider using an "immediate mode" GUI. Jari Komppa has a good tutorial about them, but you could use a more object-oriented approach with C++ than the C code he presents.
http://www.fox-toolkit.org has an API reference, if you're looking how to work with a specific framework. Or were you more interested in general theory or something more along the lines of how to do the low-level stuff yourself?
For more information about "immediate mode" GUI, I can recommend the Molly Rocket forums. There's a good video presentation of the thinking behind IM-GUI, along with lots of discussion.
I recently hacked together a very quick IM-GUI system based on presentation on Jari's page, and in my case, where I really just wanted to be able to get a couple of buttons and boxes on the screen, and more or less just hard code the response to the inputs, it really felt like the right thing to do, instead of going for a more full blown GUI-architecture. (This was in a DirectX-application, so the number of choices I had was pretty limited).
One of the fastest ways is to use python with a gui binding like pyQt, PyFLTK, tkinter, wxPython or even via pygame which uses SDL.
Its easy fast and platform independent.
Also the management of the packages is unbeatable.
See:
http://wiki.python.org/moin/PyQt
http://www.fltk.org/
(tkinter is default and already packaged with python)
http://wxpython.org/
http://www.pygame.org/news.html
For a platform like the PSP, I'd worry slightly about the performance of an IM GUI solution. With a traditional retained mode type of solution, when you create a control, you can also create the vertex buffer/display list or what-have-you required to render it. With an immediate mode solution, it seems to me that you'd need to recreate this dynamically each frame.
You might not care about this, if you're only doing a few buttons, or it's not going to be used in-game (assuming you're making a game) but, especially if you have a fair bit of text, the cost of rendering might start to hurt if you can't find a way to cache the display lists somehow.
Have a look at Qt. It is an open source library for making GUI's. Unlike Swing in Java, it assumes a lot of stuff, so it is really easy to make functional GUI's. For example, a textarea assumes that you want a context menu when you right click it with copy, paste, select all, etc. The documentation is also very good.
I'll second Qt. It's cross platform, and I found it much easier to work with than the built in Visual Studio GUI stuff. It's dual-licensed, so if you don't want your code to be GPL you could purchase a license instead.
I've had a look at the Video from Molley Rocket and Looked through Jari Komppa's cached tutorials.
An IM-GUI seems the best way to go, I think it will be a lot more streamlined, and lot quicker to build than the system I originally had in mind.
Now a new issue, I can only except one Answer. :(
Thanks again to Monjardin and dooz, cheers.
thing2k
I'd have a look at GLAM and GLGooey
Related
I'm developing my first Windows desktop application and I'm trying to figure out what the best approach would be to create the program's GUI.
I know, I know... I feel stupid for asking considering the amount of data on the subject on SO. However most answers seem outdated and I'm not sure if they fit my specific project. Also tutorials for Windows 8 'metro apps' are clogging my Google search results, which is NOT what I'm looking for.
I use Visual Studio. I've followed tutorials. I have basic knowledge of C and Java and extensive experience with PHP. I'm excited to learn C++, so I'm not looking for GUIs to create a GUI (like WinForms). I also don't care about managed code and portability for now, especially since I'm trying to avoid dependencies (i.e. users having to install .NET). As long as it runs smoothly on Vista and up, I'm happy.
The application
The software will teach basic physics to kids. I'd like to create a main area and a sidebar. The main area will feature a physics animation, say a bouncing ball, along with some Q&A. Users can zoom in to the animation to measure some stuff and answer the question. Users can track their progress in the sidebar. That's pretty much it.
What I've found so far
I'm getting a bit frustrated with MSDN. Most of their examples are given in four different languages (C#, C++, etc). I can't seem to get more than a bit of Hello World code from them.
I found a GDI API on MSDN and it seems like a good start for me. However I've read quite a few answers on SO saying creating layouts in pure C++ is really hard, that we're better of using frameworks like ATL and WTL. Since I'm also going to create (somewhat interactive) animations, I've wondered whether I should use gaming-targeted APIs like Direct2D.
Since all of this is new to me, and there are a lot of options, I don't know where to start for my particular application. Any tips would be greatly appreciated!
Using the raw Win32 API (no additional downloads or third-party helpers):
Here's a good primer (introduces dialog boxes, text boxes, buttons, etc): theForger's Win32 API Tutorial
And here's where you go from there (numeric up-downs, list boxes, combo boxes, tooltips, and more): Common Controls on MSDN. Most of these require you to #include <commctrl.h>.
I also found this to be a good resource that covered what the other two didn't: Win32 Developer - Window Assets
But the Win32 API doesn't seem like it does exactly what you want. A physics app for kids should have a more visual GUI than the API can provide. Good luck, though!
If you're ok with adding additional Frameworks, I'd suggest looking at Qt.
It allows to create the GUI from code only, has a good structure, and has an Interface for 2D drawing, if required.
If you are concerned about dependencies, you only have to include the Qt DLLs to your executables; no installation is required for the user.
To get started, see my (old) tutorial "Lessons in Windows API Programming".
But you really need a good book, such as edition 5 or earlier of Charles Petzold's classic "Programming Windows".
The problem with latest edition is that it's for C# and .NET, with Charles grabbing the tail of the "new way" at just the wrong time…
Disclaimer: I haven't checked the details of edition numbers.
Using the Windows API is the simplest, but producing advanced GUIs can take a very long time. Microsoft Foundation Class is a way to make the Windows API more user friendly and OOP. Does anyone have any experience with MFC?
Why not use some 2D C++ game engine, like HGE: http://hge.relishgames.com/overview.html.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
We've been looking at adding decent browser support to our C++ application; this question is about GUI-independent browser libraries since our project involves 3D rendering and doesn't quite fit a normal GUI.
The two I've seen so far are Berkelium and Awesomium. Both seem to work in a similar way from my quick investigation, rendering to an offscreen-buffer which you blt into your own window/game/anything. Awesomium is proprietary and costs a fair amount ($5k), Berkelium is open-source and free. Has anyone compared these (and other) such tools? Cross-platform is a benefit but not 100% essential.
Take a look at the Chromium Embedded Framework. CEF 3 supports off-screen rendering on all operating systems: Windows/Mac/Linux.
Disclaimer: I created Awesomium. Nevertheless, I will practice the utmost objectivity in my response.
Awesomium does cost a bit of money but it is definitely the best tool for the job, I'll defend my reasons with a bulleted list:
Simple, well-documented API; we've tried our best to keep the API as intuitive and readable as possible. That's really important when you're embedded something as large and complex as an entire browser framework. (Believe me, you don't want to embed WebKit directly-- that's like swallowing the sun.)
Windowless rendering; the library was designed from the outset to be used outside of a standard "windowing framework". We make it really easy to render a WebView to a texture:
void update()
{
if(webView->isDirty())
webView->render()->copyTo(texture, width * bpp, bpp, false);
}
Solid Javascript integration; if you use Awesomium as an HTML GUI renderer for your 3D game, you'll definitely want to take advantage of our Javascript <-> C++ integration. You can call Javascript functions directly from C++ and vice-versa, set callbacks, expose global properties, and more. I wrote up a big guide on my blog here.
Well-supported; we use the money we get from our top-tier commercial licenses to fund support and development of the library. If you need help, please visit http://support.awesomium.com and we'll be glad to lend a hand.
The library is free for non-commercial use and very affordable for indie developers. If you'd like to use Awesomium in your next project and are worried about the price-point, please email me at adam#khrona.com and I'll see if I can't help you out. :-)
Berkelium is really painless to use. I integrated it into my game in 6 days, you can read all about it (and some other options) here: http://www.onemanmmo.com/index.php?cmd=newsitem&comment=news.1.31.0
The only downside is no debug build and 40MB of binaries.
I'm interested to know if gtkmm w/ ATK (or whatever) works with MSAA like Qt does. We're looking right now at switching toolkit from WX and it turns out that our testing software relies on MSAA to do it's thing (something I wish I'd known 3 years ago when we picked WX to begin with). Of all the GUI toolkits, I prefer GTKmm mainly due to it's use of signals and slots but in a way much more expressive and generic than Qt's....and without the need for the extra build step that requires the Qt VS plugin. The designer is much better too.
So I'd like to use GTKmm but the only discussions and google stuff I can find on the topic are 3+ years old. They lead me to believe the answer is no, it doesn't support it and if it does it's really shoddy. But a lot can change in 3 years.
So, anyone that uses GTK or GTKmm on win32 know if it supports the windows accessibility framework?
I can’t say for sure but I would lean toward very little to no support. I use the Jaws screen reader SOFTWARE SINCE I’m blind. It uses MSAA quite heavily and GTK applications such as Pidgin are almost completely inaccessible. While I can read some of the text on a screen figuring out weather I’m in an edit field or weather a button is selected is impossible. If my screen reader can’t deal with GTK applications I assume your testing software will have major issues as well.
I don't know if this is still being tracked but I will second this assessment as another windows screen reader user. gnuCash was the app I tried and it was pretty rough going. Worked like a dream in Gnome with Orca though. Apparently, it's like this, if you want windows accessibility, use QT and WxWidgets. If you want Linux, use gtk+. QT is going to be accessible in Linux apparently though this is yet to be (not till gnome 3, I think). Pity you had to abandon WxWidgets. I personally like their widgets since it has those sizers which take much of the guess work out of placement of controls. Important when you can't see and you want to build a gui. Looks like about the only cross-platform accessibility solutions right now are Xul and SWT (Java, you know). Sad thing about WxWidgets is that this sort of thing was reported to them two years ago but nothing seems to have been done about it.
http://trac.wxwidgets.org/ticket/9785
I would be delighted to know that I am wrong about this. I doubt it, though.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
There are tons of GUI libraries for C/C++, but very few of them are based on the idea that opengl is a rather multiplatform graphics library. Is there any big disadvantage on using this OpenGL for building my own minimal GUI in a portable application?
Blender is doing that, and it seems that it works well for it.
EDIT: The point of my question is not about using an external library or making my own. My main concern is about the use of libraries that use opengl as backend. Agar, CEGUI or Blender's GUI for instance.
Thanks.
Here's an oddball one that bit a large physics experiment I worked on: because an OpenGL GUI bypasses some of the usual graphics abstraction layers, it may defeat remote viewing applications.
In the particular instance I'm thinking of we wanted to allow remote shift operations over VNC. Everything worked fine except for the one program (which we only needed about once per hour, but we really needed) that used an OpenGL interface. We had to delay until a remote version of the OpenGL interface could be prepared.
You're losing the native platforms capabilities for accessibility. For example on Windows most controls provide information to screen readers or other tools supporting accessibility impaired users.
Basically unless you have a real reason to do this, you shouldn't.
Re-inventing the Wheel: Yeah, you'd be doing it. But I note OP used the word "minimal" in the problem statement, so assuming it really doesn't need to scale up to all that, it may be a small enough wheel as to not matter. The product I currently work on supports OpenGL on three platforms (Win, Mac, Linux) and we built all our own widgets (text boxes, buttons, dialogs). It's a lot of work but now that we've done it we own a huge chunk of our stack and don't have to debug into third party frameworks when things don't work as expected. It's nice having complete control of the experience. There's always something you want to do that a framework doesn't support. Like everything in our business, it is a trade-off and you just have to weigh your needs against your need to finish on time.
Portability: Yes, you will still have to write platform specific code to boot-strap everything. This will be difficult if you've not done it before as it requires you to understand all the target platforms.
Windows Drivers: We've found that graphics card manufacturers have much better support for DirectX on Windows than OpenGL, since that's what is required to get MSFT certification. Often low- to mid-range cards have bugs, missing functionality, or outright crashes in their OpenGL support.
With Qt 4.5 you can select if you want to use OpenGL as window renderer.
More info:
https://www.qt.io/blog/2008/10/22/so-long-and-thanks-for-the-blit
Read the comments to know about the problems about this.
The obvious one is that you're basically building the GUI elements yourself, instead of having a nice designed like for wxWidgets or Qt.
You cant just use opengl, you need a platform specific code to set up a window for opengl.
From the freely available opengl red book:
OpenGL is designed as a streamlined,
hardware-independent interface to be
implemented on many different hardware
platforms. To achieve these qualities,
no commands for performing windowing
tasks or obtaining user input are
included in OpenGL; instead, you must
work through whatever windowing system
controls the particular hardware
you're using.
There are multiplatform solutions for this like glut, qt, wxWidgets, ...
And if you have to use them anyway, why not use built in GUI elements. They also give you the opportunity to build your own, and make use of the framework to handle mouse/keyboard events and stuff.
If you want a GUI as in windows/button etc. Don't do it yourself. There a lot of free solutions for this, wxwidgets,qt or GTK. All have OpenGL support if you want a 3d window
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I've always wanted to sketch all ideas I come up with in the computer instead of on paper, but everyone knows that sketching with good 'ol fashioned pen and paper beats the crap out of trying to do it with a mouse (or even worse, a touch pad).
So I turn to stack overflow with this question: Does any one of you know a magic program that will help in sketching out diagrams, ideas, etc. with decent speed on a computer?
I'm not after something that will do pretty diagrams (that take ages to do, btw.) like Visio, Dia (kudos the the Dia developers though, kick ass app), etc. but for jotting down quick ideas and drawing early work flow sketches, etc.
(I know - a wacom board, but it's not really feasible to carry it around with your laptop)
I still go for a whiteboard and a decent camera on the mobile phone.
Normally when working on the whiteboard, we often go through a phase of erasing out all the unimportant stuff after we've worked out what the real essence of the problem and the solution. So we put some nice pictures on the wiki ;)
Did you consider some kind of mind-mapping application ?
PersonalBrain is quite handy for that type of task, even though the "diagram" feature is quite limited.
alt text http://www.thebrain.com/site/personalbrain/learningzone/topUses/awareness3.png
I'm actually a big fan of OneNote. It's great for entering text and organizing it in a visual way.
This won't do for situations where you're working with other people, but I often do my brain-storming with GraphViz.
GraphViz gives you the dot and neato languages for drawing graphs. So you start jotting down items and the relationships between them in your favourite text editor:
graph brainstorm {
release -- documentation
release -- "bug fixes"
release -- enhancements
documentation -- "release notes"
documentation -- "user guide"
enhancements -- "user requests" -- "support team"
enhancements -- marketing -- demo
}
You can then turn this into a image:
neato diagram http://share4pic.com/images/2/9/3/2935067.jpg
There are lots of options for formatting and layout and so on if you want to prettify the output.
It doesn't work for idea's or diagrams, but i found this very impressive: I love sketch. Hopefully, we'll see similar tools in the future for other forms of information.
When i was still using windows i used adobe illustrator and a wacom tabled for sketching diagrams (example). Powerfull, but a steep learning curve, if you just want to do sketching.
On linux i use Inkscape (with a wacom tablet). It's not as powerful as illustrator, but it gets the job done. (example).
I would love to use a sketching tool for creating presentations. Have a number of slides on my screen, and just sketch to contents of every sheet, also using the wacom to drag and drop the slides in the right order, etc.
There was a research project called SILK (Sketching Interfaces Like Krazy) a few years ago (mid 90s) at Carnegie-Mellon. Two papers that talked about the work are Interactive Sketching for the Early Stages of User Interface Design and Just Draw It! Programming by Sketching Storyboards.
I thought their ideas were very cool, but the project seems to have blown away. I'm mentioning it here for two reasons:
To support the questioner's idea that this would be A Very Good Thing for early design stages, and
In hopes that someone else will have more luck than I did in finding out what happened to SILK (or at least the prototypes).
I know you are "not after something that will do pretty diagrams".
However, I believe this new web flash-based application LovelyCharts might be oo assistance for quick (and nice too) diagrams, and can be compliant with your goal to "jotting down quick ideas and drawing early work flow sketches, etc."
Example of work flow sketch:
The closest thing to the feeling of writing on paper with pencil or pen that I have found is a graphics tablet (relatively inexpensive and small Wacom Bamboo is enough) with Autodesk's SketchBook Pro software.
Try the trial (if you have graphics tablet handy, not really the same with a mouse), it's amazing how natural digital drawing feels with that app.
Depending on how close you are to implementing something, balsamiq mockups may be what you want. I find it great for mocking up user interfaces, and it's probably not a bad way to start sketching a development idea.
Autodesk Sketchbook Pro is the closest I've come to a whiteboard after an extensive search. Minimal controls, yet enough. It's also attractively priced, in line with its simplicty.
Maybe you should consider buying a Graphic Tablet .
I recommend Wacom Bamboo
I wouldn't suggest it, but people have mentioned mind-mapping products and even OneNote (¡sin comentarios!), so I'll plug my TheKBase Desktop and it's Cloud brother, TheKBase Web. NO, they will not help you draw things like on paper, but in many cases, diagrams are not what you need. You want to organize your ideas and whip them into shape.
If you insist on diagramming, 30x less annoying than Visio is SmartDraw (sorry for the Spanish grammar).
Moleskin for the win!