[2.1] MyGui updated and working

Design / architecture / roadmap discussions related to future of Ogre3D (version 2.0 and above)
Post Reply
Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 533
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 11

[2.1] MyGui updated and working

Post by Slicky » Sat Sep 08, 2018 11:19 am

This is a fix that is not mine. I basically applied a patch that was submitted but not applied by al2950. I have been hassling to get the latest Ogre 2.1 to work with MyGui so now it works (at least for me). I have only done the GL3+ part so far. I will add more or someone else can help.

My fork is here: https://github.com/Stuggy/mygui

Make sure you use the pulldown to choose the Ogre2.1 branch before you clone.

I hope it is useful to someone. It has taken me days to try and get GUI stuff working.

It would be nice if someone could do a similar thing with for example ImGui using the latest 2.1.
4 x

rujialiu
Greenskin
Posts: 136
Joined: Mon May 09, 2016 8:21 am
x 11

Re: [2.1] MyGui updated and working

Post by rujialiu » Wed Sep 12, 2018 4:10 pm

Slicky wrote:
Sat Sep 08, 2018 11:19 am
It would be nice if someone could do a similar thing with for example ImGui using the latest 2.1.
I've integrated ImGui to Ogre 2.2 without any trouble. However, I haven't done it with Ogre 2.1 because it looks harder and I don't really need it :)
0 x

Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 533
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 11

Re: [2.1] MyGui updated and working

Post by Slicky » Wed Sep 12, 2018 4:12 pm

I need to see how to get 2.2 I just found 2.1 and don't remember seeing 2.2.

Anyway, is there anything special to share as far as getting it to work?
0 x

rujialiu
Greenskin
Posts: 136
Joined: Mon May 09, 2016 8:21 am
x 11

Re: [2.1] MyGui updated and working

Post by rujialiu » Wed Sep 12, 2018 4:19 pm

Slicky wrote:
Wed Sep 12, 2018 4:12 pm
I need to see how to get 2.2 I just found 2.1 and don't remember seeing 2.2.

Anyway, is there anything special to share as far as getting it to work?
It's in 2-2-WIP branch. It's (almost) fully functional, quite stable for my software(no crashes or other weird things), but very few people are using it so it's still considered WIP.

Integrating ImGui to Ogre 2.2 is very easy: just save API context (DX11 in our case), call ImGui's render functions and restore API context. That's all. Ogre 2.2 provided easy helpers for doing this. I don't know whether Ogre 2.1 can be done equaly easily though.

I can post some codes tomorrow (when I'm back to my office) if you want.
0 x

Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 533
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 11

Re: [2.1] MyGui updated and working

Post by Slicky » Wed Sep 12, 2018 4:23 pm

Yes please I would like that. I started this thread about MyGui but I have also been struggling with ImGui and would appreciate any help.
0 x

Jay721
Halfling
Posts: 41
Joined: Mon Jan 29, 2018 8:19 am

Re: [2.1] MyGui updated and working

Post by Jay721 » Wed Sep 12, 2018 4:38 pm

I got MyGUI working on 2.1 now. I built MyGUI with FreeType, and it works in the demos. However, when integrating MyGUI with my application, I'm getting

Code: Select all

 Core  |  Error  |  ResourceTrueTypeFont: TrueType font 'DejaVuSansFont_15' disabled. Define MYGUI_USE_FREETYE if you need TrueType fonts

????
0 x

Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 533
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 11

Re: [2.1] MyGui updated and working

Post by Slicky » Wed Sep 12, 2018 4:43 pm

I think put that define into your app also. I don't think I have it in mine but it suggests that.
0 x

rujialiu
Greenskin
Posts: 136
Joined: Mon May 09, 2016 8:21 am
x 11

Re: [2.1] MyGui updated and working

Post by rujialiu » Thu Sep 13, 2018 3:25 am

Slicky wrote:
Wed Sep 12, 2018 4:23 pm
Yes please I would like that. I started this thread about MyGui but I have also been struggling with ImGui and would appreciate any help.
I've started a separate thread because this thread is supposed to be about MyGui, right? :)
0 x

Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 533
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 11

Re: [2.1] MyGui updated and working

Post by Slicky » Thu Nov 01, 2018 10:17 am

I noticed today that when I enable MyGui with a few widgets the FPS hit seems more than I would have expected. I'm only using debug mode so far. FPS goes from around 221 to around 155.

I am enabling and disabling it by toggling this line:

Code: Select all

//		pCompositorManager->addWorkspace(mSceneManager, mRenderWindow, mCamera, workspaceNameHash, true);
I wonder is it the way I have implemented it or is it normal to see a drop like this.
0 x

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 3775
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 134
Contact:

Re: [2.1] MyGui updated and working

Post by dark_sylinc » Thu Nov 01, 2018 3:01 pm

Please notice that a drop from 221 to 155 fps means 1.92ms.
If the app were to be running at 60 fps, that drop would lower your framerate to 53.78 fps
This may be what's expected if the widget covers the whole screen or there's too much overdraw and the GPU isn't superpowerful (e.g. mid to low end GPU, specially Intel GPUs), but certainly not normal for high end GPUs (e.g. GeForce 1080, Radeon Vega64).
0 x

Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 533
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 11

Re: [2.1] MyGui updated and working

Post by Slicky » Thu Nov 01, 2018 3:05 pm

I was also wondering that debug mode adds more time vs release. I haven't configured a release build yet. For now I'll assume based upon what you said that it is normal. Card is GeForce 1050ti.
0 x

al2950
OGRE Expert User
OGRE Expert User
Posts: 1131
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 51

Re: [2.1] MyGui updated and working

Post by al2950 » Thu Nov 01, 2018 4:04 pm

Slicky wrote:
Thu Nov 01, 2018 3:05 pm
I was also wondering that debug mode adds more time vs release. I haven't configured a release build yet. For now I'll assume based upon what you said that it is normal. Card is GeForce 1050ti.
If you are asking why debug is slower than release, its fairly extensive answer. In theory if all code was written perfectly with performance in mind, then debug would be almost as quick as release. However the reality is debug, for many developers, is expected to be slow. The std:: lib is pretty bad in debug, as it adds a bunch of checking during debug which can be useful, but causes fairly hefty performance penalties. This is why many game studios have their own version of the std:: library.

Basically dont even bother looking at performance figures in debug. (However be a good developer and dont ever think "Well the compiler will optimize that for me"!)
1 x

Post Reply