Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HEADER
- #pragma once
- // struct for panels
- typedef struct PanelTab
- {
- const char *tabName;
- void (*handler)(void);
- };
- class RightFrameImGuiUI : public Object
- {
- URHO3D_OBJECT(RightFrameImGuiUI, Object);
- public:
- RightFrameImGuiUI(Context * context);
- virtual ~RightFrameImGuiUI();
- // Show Right Frame
- static bool * ShowRightFrame(void);
- protected:
- private:
- static bool initialized;
- static PanelTab tabNames[];
- static void ShowSettingsPanel(void);
- };
- SOURCE
- ///////////////////////////////////////////////////////
- bool RightFrameImGuiUI::initialized= false;
- PanelTab RightFrameImGuiUI::tabNames[] = {{"Inspector",RightFrameImGuiUI::ShowSettingsPanel},
- {"ViewSettings", RightFrameImGuiUI::ShowSettingsPanel}};
- RightFrameImGuiUI::RightFrameImGuiUI(Context * context = g_pApp->GetGameLogic()->GetContext())
- :Object(context)
- {
- //ctor
- }
- bool * RightFrameImGuiUI::ShowRightFrame(void)
- {
- // return p_opened;
- bool * p_opened = NULL;
- // create tool bar
- ImGuiWindowFlags window_flags = 0;
- // get windows size
- unsigned int Width = g_pApp->GetGraphics()->GetWidth();
- unsigned int Height = g_pApp->GetGraphics()->GetHeight();
- // set flags
- window_flags |= ImGuiWindowFlags_NoTitleBar;
- // create window
- ImGui::Begin("RightFrame", p_opened, ImVec2(200,Height-8-128), 0.5, window_flags );
- ImGui::End();
- initialized = true;
- // test
- void (*DoPanel)() = (*tabNames[0].handler)();
- return p_opened;
- }
- void RightFrameImGuiUI::ShowSettingsPanel(void)
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement