Skip to content

TheDimin/EnttEditor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WARNING THIS LIBRARY IS STILL UNDER CONSTRUCTION AND NOT READY FOR PRODUCTION YET.

EnttEditor

Editor for entt libary, using their build in reflection system

What do we add

We add a layer ontop of entt's build in Reflection system allowing you to use these types inline.

With support of properties we can draw types any way we want.

We also provide you with a framework to add reflect any custom type allowing you to easily add support for drawing your own types to Imgui. And add custom properties support by the types.

How to get Started.

Include Entt and ImGui in your project.

Include this project in your repo.

If you do not use GLM do not include GlmMetaInspectors

(Idealy you build your own high level window as it allows you to draw hierachies, But for sake of getting started quickly we provide a demo window !)

  1. Create a instance of the DemoWindow::DemoEntityWindow found in Examples/ExampleEntityWindow, Pass in the registery. (Lifetime of the EntityWindow should not exceed the registeries)
  2. Call DemoEntityWindow::Draw(true)within imgui draw context.

This should show you a imgui window like shown below image

how to show components

The Examples/ExampleEntityWindow.hcontains an example TransformComponent and NameComponent which are fully reflected !

  1. Within the body of the component Add the REFLECT() Macro. For this make sure to include "EnttEditor/MetaReflect.h"

image

  1. in the cpp file we add the IMPLEMENT_REFLECT_COMPONENT(<CLASS>) and include "EnttEditor/MetaReflectImplement.h" (DO NOT INCLUDE THIS IN THE HEADER)

  2. Give this a body and add the variables & functions with the entt::meta system. We provide a few extra Defines to make your life easier, these can be found in "EnttEditor/MetaReflect.h" A good example is the PROP_DISPLAYNAME or PROP_READONLY (PROP is used as aprefix for properties for data)

  3. Make sure to finish with FinishReflect() macro.

Full example below:

image

About

Editor for entt libary, using their build in reflection system

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages