A portable imgui implementation for ogre-next

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
Nucleartree
Kobold
Posts: 28
Joined: Tue Apr 04, 2017 9:10 pm
Location: Cardiff, UK
x 16

A portable imgui implementation for ogre-next

Post by Nucleartree »

Hi everyone,
I've had an imgui implementation based on snippets of code I found around this forum for a while. It previously only supported ogre 2.1 and was a bit unstable. However, following this thread viewtopic.php?t=96798 someone ported it to 2.3 and shared their work. While I wasn't aware people were going to use my implementation :D I thought I'd take the time to separate it out into a more portable stand alone project so other people can benefit from it, while also including the work that person did.

https://github.com/edherbert/ogre-next-imgui
Image

Pretty much, with four files included in your project you can get gui rendering! Imgui takes a fairly platform agnostic approach so this repo also contains an example of the glue code you'll have to use to make it aware of inputs. Right now it's working with the following render systems:

  • Metal

  • OpenGL3+

  • D3D11

Vulkan does not work yet as it's still quite new and I have yet to figure out how root layouts work :D I'd like to have it there but it's not a priority for me right now. I've only tested this implementation with Ogre 2.3 but I imagine 2.2 should be straight forward. If anyone wants 2.1 my old implementation is here. I'll be maintaining this as part of my work so it should remain up to date.

Special Thanks
As mentioned, code for this came from all over the place. I've singled out the following posts as being related:

Original implementation: Crashy
Added Metal support: Me
General fixes: Various people
Updated to Ogre2.3: Vian

Thanks to these people.

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

Re: A portable imgui implementation for ogre-next

Post by dark_sylinc »

Awesome!

As for Vulkan, if you're only using low level materials, you can easily fix your problems using a prefab root layout:

Code: Select all

gpuProgram->setRootLayout( type, PrefabRootLayout:: Standard );
Nucleartree
Kobold
Posts: 28
Joined: Tue Apr 04, 2017 9:10 pm
Location: Cardiff, UK
x 16

Re: A portable imgui implementation for ogre-next

Post by Nucleartree »

Finally had some time to try this today. I was able to get it working in the end and pushed a change, all render systems are supported now!

In the end I used this snippet

Code: Select all

vertexShaderVK->setPrefabRootLayout(Ogre::PrefabRootLayout::Standard);

Thanks.

Post Reply