File ImguiManager.h¶
-
namespace
Gsage -
class
ImguiDockspaceView: public Gsage::ImguiViewCollection - #include <ImguiManager.h>
Renders window collection into workspace
Public Functions
-
ImguiDockspaceView(ImguiManager *manager, const std::string &name)¶
-
void
render(int x, int y, int width, int height)¶ Render views
- Parameters
x: dockspace xy: dockspace ywidth: dockspace widthheight: dockspace height
-
bool
activateDock(const std::string &name)¶ Activate dock
- Return
true if dock was found
- Parameters
name: Dock name
Private Members
-
ImguiManager *
mManager¶
-
DataProxy
mState¶
-
std::unique_ptr<ImGuiDockspaceRenderer>
mDockspace¶
-
std::string
mName¶
-
-
class
ImguiManager: public UIManager, public EventSubscriber<ImguiManager>, public Gsage::ImguiViewCollection Public Types
-
typedef std::function<ImguiRenderer *()>
RendererFactory¶
Public Functions
-
ImguiManager()¶
-
virtual
~ImguiManager()¶
-
virtual void
initialize(GsageFacade *facade, lua_State *L = 0)¶ Initialize ui manager
- Parameters
called: by gsage facade on setupfacade: Gsage FacadeL: init with lua state
-
lua_State *
getLuaState()¶ Gets Rocket lua state
-
void
setLuaState(lua_State *L)¶ Update load state
- Parameters
L: lua_State
-
void
setUp()¶ Configures rendering
-
void
tearDown()¶ Tear down imgui manager
-
bool
handleSystemChange(EventDispatcher *sender, const Event &event)¶ SystemChangeEvent::SYSTEM_ADDED and SystemChangeEvent::SYSTEM_REMOVED handler
-
bool
handleMouseEvent(EventDispatcher *sender, const Event &event)¶ Handle mouse event from engine
- Parameters
sender: EventDispatcherevent: Event
-
const std::string &
getType()¶
-
void
addRendererFactory(const std::string &type, RendererFactory f)¶ This method is called by render system interfaces plugins
- Parameters
type: Type of render system to use for. RenderSystem must properly return “type” field from getSystemInfo callf: Factory method to create renderables
-
void
removeRendererFactory(const std::string &type)¶ Unregister renderer factory
-
ImGuiContext *
getImGuiContext(std::string name, const ImVec2 &initialSize)¶ Get or create new ImGuiContext instance
- Parameters
name: Context nameinitialSize: Initial context size
-
virtual void
renderViews(ImguiRenderer::Context &ctx)¶ Render a single imgui frame
Public Static Attributes
-
const std::string
TYPE¶
Private Types
-
typedef std::map<std::string, RendererFactory>
RendererFactories¶
-
typedef std::vector<ImVector<ImWchar>>
GlyphRanges¶
Private Functions
-
bool
handleKeyboardEvent(EventDispatcher *sender, const Event &event)¶ Handle keyboard event from engine
-
bool
handleInputEvent(EventDispatcher *sender, const Event &event)¶ Handle input event from engine
-
bool
doCapture()¶ Check if mouse event can be captured by any rocket element
-
bool
render(EventDispatcher *dispatcher, const Event &e)¶ This function does not handle actual render system rendering, it only updates ImGUI draw list
Private Members
-
ImguiRenderer *
mRenderer¶
-
ImFontAtlas *
mFontAtlas¶
-
bool
mIsSetUp¶
-
RendererFactories
mRendererFactories¶
-
std::string
mPendingSystemType¶
-
std::string
mUsedRendererType¶
-
ImVector<ImFont *>
mFonts¶
-
GlyphRanges
mGlyphRanges¶
-
std::map<std::string, ImGuiContext *>
mContexts¶
-
ImGuiDockspaceRenderer *
mCurrentDockspace¶
Friends
-
friend
Gsage::ImguiDockspaceView
-
typedef std::function<ImguiRenderer *()>
-
class
ImguiRenderer Subclassed by Gsage::ImguiOgreRenderer
Public Functions
-
ImguiRenderer()¶
-
virtual
~ImguiRenderer()¶
-
virtual void
initialize(Engine *facade, lua_State *L)¶ Set engine, setup lua bindings
- Parameters
engine: Gsage CEL: lua state
-
void
setMousePosition(const std::string &name, ImVec2 position)¶ Update mouse position for the render target
- Parameters
name: render target nameposition: mouse position
-
virtual void
createFontTexture(unsigned char *pixels, int width, int height) = 0¶ Create font texture in the underlying render system
- Parameters
pixels: Raw texturewidth: Texture widthheight: Texture height
-
virtual void
setImguiContext(ImGuiContext *ctx) = 0¶ Imgui context is not shared across plugins, so pass it to renderer
- Parameters
ctx: Context to use
-
void
render()¶
Protected Functions
Protected Attributes
-
std::map<std::string, ImVec2>
mMousePositions¶
-
Engine *
mEngine¶
-
std::map<std::string, bool>
mRenderTargetWhitelist¶
-
std::mutex
mContextLock¶
-
std::map<ImGuiContext *, std::string>
mContextNames¶
-
ImguiManager *
mManager¶
Friends
-
friend
Gsage::ImguiManager
-
struct
Context¶
-
-
class
ImguiViewCollection Subclassed by Gsage::ImguiDockspaceView, Gsage::ImguiManager
Public Functions
Protected Types
-
typedef std::map<std::string, RenderView>
Views¶
-
typedef std::map<std::string, RenderView>
-
class