Topic: MGui "v2" news

Hi there,

I wanted to post some news about some development I'm working on,
there was some things to do around MGui (Maratis GUI system) and the window management
and I'm finally starting to see the end of the tunnel.

I had to modify the window system management to move to GLFW 3 and stop writing all the system
dependency manually, it will make things easier and we will benefit from GLFW community and tests.

The first benefit will be the possibility to handle separate windows on desktop, with multitasking.
GLFW 3 was totally reorganized and the logic is really good.

I also wrote a new image loader that uses FreeImage library (to stop using DevIL),
the development is more alive than DevIL's and the license is more permissive.

MGui was rewritten to be more flexible and dynamic, text drawing is now handled by MEngine and
can use standard fonts and unicode text (it will finally allow non-english users like russians to type text).

Here is the first glimpse of a color picker window :

And right now I'm working on a generic GUI node system :
That could be used to handle objects hierarchy, visual game logic etc.

So this is the good news,
the bad news is that I was forced to refactor a lot of MGui code and it broke a lot of compatibility,
there will be a lot of work to adapt MaratisUI...

When I have a viable base code I'll create a new branch on svn.


Re: MGui "v2" news

looks awesome even though i don't understand some stuff i cannot wait to test it .
nice going Anael smile

Re: MGui "v2" news

I committed all this into a new "Experimental" branch,
it's still in progress but the core is functional.

- MGui version 2 (rewritten, data independent, real fonts, node system...)
- glfw 3 context, multithread
- freeimage loader
- a collection of image filters (edge detection, blur, etc)
- UTF8 text
- premake build system

I don't know premake a lot, does someone know how to have premake to embed data (images, fonts...) if the output is a xcode project ?

Re: MGui "v2" news

Thank you, I only tested on mac,
I probably made a mistake in the premake of glfw, I updated if you want to try again.

Re: MGui "v2" news

that's strange,
in premake the includedirs of "MSDK/MGui/Includes/" is the same for all platforms,
but as I said I'm not an expert with premake.

Re: MGui "v2" news

For FreeImageTag.h, I found a case sensitive path problem in the freeimage premake
and for MGui I modified the Test premake

Re: MGui "v2" news


Unfortunately the "No OpenGL" error is still there.

Last edited by com3D (2013-08-13 12:53:16)

Re: MGui "v2" news

It seems to be missing a define to get glXGetProcAddress, I added something to the premake,
and I found out that MGui code was not in the source control, hence not finding MGui.h, it's added now.

Re: MGui "v2" news

mh, no clue for that,
MCore is pretty simple, there is no platform code except dirent for windows.

Re: MGui "v2" news

what are the errors ?

Re: MGui "v2" news

ok, I think I know, thanks, checking that.

Re: MGui "v2" news

There was some code requiring c++99
I changed that and modified the way tinyutf8 was called

Re: MGui "v2" news

it's highly experimental still unfortunately : )
thanks for so much back and forth testing.

Re: MGui "v2" news

yes I forgot something, it's not warning on mac as uint32_t is available by default,

Re: MGui "v2" news


the pthread lib is not linked it seems,
I added it in the Tests/ premake file : links { "GL", "dl", "X11", "Xxf86vm", "pthread" }
but I'm unsure, can you try to modify the premake file if it still doesn't work ? maybe by renaming "pthread" > "libpthread".

if it still doesn't link, be also sure you have lib pthread installed (but I think it's default on linux).

Re: MGui "v2" news

Status for Windows build:

> glee, mcommon, mcore, mengine, tinycthread build OK

> Test:
main.cpp(161): error C3861: 'Sleep' : identificateur introuvable

Last edited by com3D (2013-10-13 19:28:20)

Re: MGui "v2" news

for Sleep it's probably a missing include,
I'll try to check all that on each platform when I can.

Re: MGui "v2" news

Looking forward to try out !


Re: MGui "v2" news

com3D wrote:


This is solved changing these lines:


Casting problems.

Also, FYI, if you want to use the MGui source directly you have to set the preprocessor "MGUI_STATIC" in your VS project.

Last edited by 255 (2013-10-01 21:57:42)

Re: MGui "v2" news

Hey 255,

Thanks for contribution.
Did you finally get it to work using premake to generate your VS project ?


Re: MGui "v2" news

I've followed these instructions.
I'm using VS C++ 2010.

Re: MGui "v2" news


For linux, I've added a few links to the main premake file (Xrandr, Xi and rt) :

links { "X11", "Xxf86vm", "Xrandr", "Xi", "GL", "dl", "pthread", "rt" }

I've also got rid of the "undefined reference" errors.

Now, the project compiles OK. big_smile

But launching the "Test" binary, I get nothing to display in the 800x600 window named Test1.

Last edited by com3D (2013-10-08 07:43:44)

Re: MGui "v2" news

good com3D, if you don't see a text in the window is maybe because there is no font,
open main.cpp and change the path of the font "/Library/Fonts/Arial.ttf" for one on your system.

tell me if it works after.

Re: MGui "v2" news

com3D wrote:

Finally got a "Hello world !" display without altering the default main.cpp big_smile

However the above error happens almost all the time and for now I don't know why it sometimes works...

Recompile glfw as a "Shared Library" and link against that. Static linking is only for special cases on Linux and in many cases wont work correctly.

I have an Ogre project. I built an easy to use SDK that came with all the library's compiled statically, and were included. I constantly got "Undefined Reference" errors  even thou I had all required headers included, I was linking properly with required libs and even in the correct order. Didn't matter sometimes it worked sometimes not. Eventually I had to resort to asking for help.

Ogre Devs Question
The first question they asked me. "Are these libs static builds"?

Ummm yahh.

Final Response from Ogre Devs
Ogre static builds are for windows, use the shared libs build option.

Same goes for SFML and countless other projects.

Last edited by zester (2013-10-06 16:57:12)


Re: MGui "v2" news

MGuiWindow is missing a removeObject methods (e.g. removeImage, removeButton).
If I just do "delete" it crashes because the window still has it in its vector.

Last edited by 255 (2013-10-06 19:31:30)