Sign in to follow this  

Where Do I begin, GUI programming?

This topic is 4301 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay, so I've been working on a game engine for a while now, 2 monthsish or so.. I need to create an editor to supplement more creation of content.. For this I need gui's, what can I use that is portable and can like, hold an openGL window inside of it?

Share this post


Link to post
Share on other sites
FLTK (Fast-Light Toolkit) is a good one that can have openGl windows (through GLUT). It's very easy to use (check out the demo programs) and I have found it to be pretty good. Another option would be to use the win32 API (or MFC) with the WGL functions.

Share this post


Link to post
Share on other sites
I get errors when trying to compile FLTK example programs (the Simple OGL one on the How-To list).

Mainly issues having to do with the GL header file, it works in my own projects, why not with FLTK?

Can anyone point me into something a little coherant than the websites startup faq, it sucks.

Share this post


Link to post
Share on other sites
Hi, I can't say I know about them, I have been looking for what I need with gui too.
I found that QT and wxWidgets are portable and can hold OpenGL windows in them. They may be a a bit heavy though, more lightweight is cegui.

Share this post


Link to post
Share on other sites
I did my own GUI for my game, and it wasn't that hard, but really rewarding for getting my C++ skills better. If you are looking for some OpenGL based GUI, take a search through forums, there are plenty results you are going to find.

Share this post


Link to post
Share on other sites
Quote:
Original post by Shamino
I get errors when trying to compile FLTK example programs ... Mainly issues having to do with the GL header file, it works in my own projects, why not with FLTK?


Try including <windows.h> before including <gl/GL.h> The gl header file uses some stuff in windows.h so even if your code is cross-platform, the gl header file is not. That should fix that.

As for a GUI, I heavily reccomend wxWidgets. It can be a pain to set up (you have to compile it yourself), but once you get it going, it's a pleasure to work with. And it supports gl canvas's.

Good Luck

Share this post


Link to post
Share on other sites
Alright, so I included windows.h in there, cleared up most of the errors, now I think I'm getting fltk library errors..


------ Build started: Project: OpenGL Window, Configuration: Debug Win32 ------
Compiling...
Example.cpp
Linking...
Example.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall Fl_Window::~Fl_Window(void)" (??1Fl_Window@@UAE@XZ) referenced in function __unwindfunclet$??0Fl_Gl_Window@@QAE@HHHHPBD@Z$0
Example.obj : error LNK2019: unresolved external symbol "private: void __thiscall Fl_Gl_Window::init(void)" (?init@Fl_Gl_Window@@AAEXXZ) referenced in function "public: __thiscall Fl_Gl_Window::Fl_Gl_Window(int,int,int,int,char const *)" (??0Fl_Gl_Window@@QAE@HHHHPBD@Z)
Example.obj : error LNK2019: unresolved external symbol "public: __thiscall Fl_Window::Fl_Window(int,int,int,int,char const *)" (??0Fl_Window@@QAE@HHHHPBD@Z) referenced in function "public: __thiscall Fl_Gl_Window::Fl_Gl_Window(int,int,int,int,char const *)" (??0Fl_Gl_Window@@QAE@HHHHPBD@Z)
Example.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Fl_Window::draw(void)" (?draw@Fl_Window@@MAEXXZ)
Example.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Fl_Window::handle(int)" (?handle@Fl_Window@@UAEHH@Z)
Example.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Gl_Window::resize(int,int,int,int)" (?resize@Fl_Gl_Window@@UAEXHHHH@Z)
Example.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Gl_Window::flush(void)" (?flush@Fl_Gl_Window@@UAEXXZ)
Example.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Gl_Window::show(void)" (?show@Fl_Gl_Window@@UAEXXZ)
Example.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Gl_Window::hide(void)" (?hide@Fl_Gl_Window@@UAEXXZ)
Example.obj : error LNK2001: unresolved external symbol "private: virtual void __thiscall Fl_Gl_Window::draw_overlay(void)" (?draw_overlay@Fl_Gl_Window@@EAEXXZ)
Example.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall Fl_Gl_Window::~Fl_Gl_Window(void)" (??1Fl_Gl_Window@@UAE@XZ) referenced in function "public: virtual void * __thiscall Fl_Gl_Window::`scalar deleting destructor'(unsigned int)" (??_GFl_Gl_Window@@UAEPAXI@Z)
Example.obj : error LNK2019: unresolved external symbol "public: void __thiscall Fl_Widget::redraw(void)" (?redraw@Fl_Widget@@QAEXXZ) referenced in function "private: virtual void __thiscall MyGlWindow::resize(int,int,int,int)" (?resize@MyGlWindow@@EAEXHHHH@Z)
Example.obj : error LNK2019: unresolved external symbol "public: static int __cdecl Fl::run(void)" (?run@Fl@@SAHXZ) referenced in function _main
Example.obj : error LNK2019: unresolved external symbol "public: virtual void __thiscall Fl_Window::show(void)" (?show@Fl_Window@@UAEXXZ) referenced in function _main
Example.obj : error LNK2019: unresolved external symbol "public: __thiscall Fl_Window::Fl_Window(int,int,char const *)" (??0Fl_Window@@QAE@HHPBD@Z) referenced in function _main
C:\Documents and Settings\Jonathan\My Documents\Visual Studio 2005\Projects\OpenGL Window\Debug\OpenGL Window.exe : fatal error LNK1120: 15 unresolved externals
Build log was saved at "file://c:\Documents and Settings\Jonathan\My Documents\Visual Studio 2005\Projects\OpenGL Window\OpenGL Window\Debug\BuildLog.htm"
OpenGL Window - 16 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



Now this is probably a problem on my part in terms of the setup, I kinda just took the fltk include files and included them, I dunno what else to do, help?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I'd just go with wxWidgets. It's much easier to use than MFC, and is much easier to go cross-platform with (if you were ever thinking of that). Also, if you're intending to make a complicated GUI, you can also get wxGlade, a nice free WYSIWYG GUI design tool that allows you to generate wxWidgets GUI code, so you don't have to know all the gritty details of the API.

Share this post


Link to post
Share on other sites
I've decided to use FLTK, I'm having a bit of trouble getting it to work though..


------ Build started: Project: OpenGL Window, Configuration: Debug Win32 ------
Compiling...
Example.cpp
Linking...
Example.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall Fl_Window::~Fl_Window(void)" (??1Fl_Window@@UAE@XZ) referenced in function __unwindfunclet$??0Fl_Gl_Window@@QAE@HHHHPBD@Z$0
Example.obj : error LNK2019: unresolved external symbol "private: void __thiscall Fl_Gl_Window::init(void)" (?init@Fl_Gl_Window@@AAEXXZ) referenced in function "public: __thiscall Fl_Gl_Window::Fl_Gl_Window(int,int,int,int,char const *)" (??0Fl_Gl_Window@@QAE@HHHHPBD@Z)
Example.obj : error LNK2019: unresolved external symbol "public: __thiscall Fl_Window::Fl_Window(int,int,int,int,char const *)" (??0Fl_Window@@QAE@HHHHPBD@Z) referenced in function "public: __thiscall Fl_Gl_Window::Fl_Gl_Window(int,int,int,int,char const *)" (??0Fl_Gl_Window@@QAE@HHHHPBD@Z)
Example.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Fl_Window::draw(void)" (?draw@Fl_Window@@MAEXXZ)
Example.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Fl_Window::handle(int)" (?handle@Fl_Window@@UAEHH@Z)
Example.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Gl_Window::resize(int,int,int,int)" (?resize@Fl_Gl_Window@@UAEXHHHH@Z)
Example.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Gl_Window::flush(void)" (?flush@Fl_Gl_Window@@UAEXXZ)
Example.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Gl_Window::show(void)" (?show@Fl_Gl_Window@@UAEXXZ)
Example.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Gl_Window::hide(void)" (?hide@Fl_Gl_Window@@UAEXXZ)
Example.obj : error LNK2001: unresolved external symbol "private: virtual void __thiscall Fl_Gl_Window::draw_overlay(void)" (?draw_overlay@Fl_Gl_Window@@EAEXXZ)
Example.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall Fl_Gl_Window::~Fl_Gl_Window(void)" (??1Fl_Gl_Window@@UAE@XZ) referenced in function "public: virtual void * __thiscall Fl_Gl_Window::`scalar deleting destructor'(unsigned int)" (??_GFl_Gl_Window@@UAEPAXI@Z)
Example.obj : error LNK2019: unresolved external symbol "public: void __thiscall Fl_Widget::redraw(void)" (?redraw@Fl_Widget@@QAEXXZ) referenced in function "private: virtual void __thiscall MyGlWindow::resize(int,int,int,int)" (?resize@MyGlWindow@@EAEXHHHH@Z)
Example.obj : error LNK2019: unresolved external symbol "public: static int __cdecl Fl::run(void)" (?run@Fl@@SAHXZ) referenced in function _main
Example.obj : error LNK2019: unresolved external symbol "public: virtual void __thiscall Fl_Window::show(void)" (?show@Fl_Window@@UAEXXZ) referenced in function _main
Example.obj : error LNK2019: unresolved external symbol "public: __thiscall Fl_Window::Fl_Window(int,int,char const *)" (??0Fl_Window@@QAE@HHPBD@Z) referenced in function _main
C:\Documents and Settings\Jonathan\My Documents\Visual Studio 2005\Projects\OpenGL Window\Debug\OpenGL Window.dll : fatal error LNK1120: 15 unresolved externals
Build log was saved at "file://c:\Documents and Settings\Jonathan\My Documents\Visual Studio 2005\Projects\OpenGL Window\OpenGL Window\Debug\BuildLog.htm"
OpenGL Window - 16 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



Linker errors, can anyone point me to a tutorial on how to set this up, not the FLTK website though, it sucks.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Seriously do not bother with FLTK. I've used it for over a year in two of my projects which ended up being over 5,0000 lines of code. Half way through the project I started realizing the serious limitations of FLTK. FLTK is largely error prone. Support and documentations is very limited at best. Not to mention if you don't want your application looking like 100% crap, stay away from FLTK. FLTK should never be considered for a real project that is going to be more than a couple hundred lines of code.


I am sure other people on here will vouch for wxWdigets.

http://www.wxwidgets.org/

It is simply the best GUI library I have ever used and I've used pretty much all the popular ones (FOX, QT, FLTK). wxWidgets is a very mature codebase, great support, great documentation and very easy to use.


Share this post


Link to post
Share on other sites
Alright this is getting to be a fucking pain, the documentation on ANY of these libraries is absulutely disgusting. I've tried to use fltk, that blew, I've tried cegui, that blew worse...

WXWidgets is the only thing I havn't tried, but I don't think I have anything to look forward to.

Share this post


Link to post
Share on other sites
Yes wxWidgets does supprot OpenGL rendering. The documentation is excellent, but as I already said, it is quite tricky to install. It was pretty frustrating for me to get working and your temper seems worse than mine [smile]. Once you get it installed, however, it is really easy and even fun to work with.

Good Luck

Share this post


Link to post
Share on other sites

This topic is 4301 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this