Where Do I begin, GUI programming?

Started by
14 comments, last by Simian Man 18 years, 1 month ago
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?
----------------------------------------------------------Rating me down will only make me stronger.----------------------------------------------------------
Advertisement
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.
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.
----------------------------------------------------------Rating me down will only make me stronger.----------------------------------------------------------
I am not sure if OpenGL can render to any windows control, but perhaps a windows form will work with some controls?
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.

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.
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
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.cppLinking...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$0Example.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 _mainExample.obj : error LNK2019: unresolved external symbol "public: virtual void __thiscall Fl_Window::show(void)" (?show@Fl_Window@@UAEXXZ) referenced in function _mainExample.obj : error LNK2019: unresolved external symbol "public: __thiscall Fl_Window::Fl_Window(int,int,char const *)" (??0Fl_Window@@QAE@HHPBD@Z) referenced in function _mainC:\Documents and Settings\Jonathan\My Documents\Visual Studio 2005\Projects\OpenGL Window\Debug\OpenGL Window.exe : fatal error LNK1120: 15 unresolved externalsBuild 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?
----------------------------------------------------------Rating me down will only make me stronger.----------------------------------------------------------
Change your project settings...make the project a
'Multi-threaded Debug DLL (/MDd)'
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.

This topic is closed to new replies.

Advertisement