Advertisement
vivienneanthony

full code

Jan 23rd, 2016
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.65 KB | None | 0 0
  1. HEADER
  2.  
  3. #pragma once
  4.  
  5.  
  6. // struct for panels
  7. typedef struct PanelTab
  8. {
  9.     const char *tabName;
  10.     void (*handler)(void);
  11.  
  12. };
  13.  
  14. class RightFrameImGuiUI : public Object
  15. {
  16.     URHO3D_OBJECT(RightFrameImGuiUI, Object);
  17.  
  18. public:
  19.     RightFrameImGuiUI(Context * context);
  20.     virtual ~RightFrameImGuiUI();
  21.  
  22.     // Show Right Frame
  23.     static bool * ShowRightFrame(void);
  24.  
  25.  
  26. protected:
  27. private:
  28.     static bool initialized;
  29.     static PanelTab tabNames[];
  30.  
  31.     static void ShowSettingsPanel(void);
  32. };
  33.  
  34.  
  35. SOURCE
  36.  
  37. ///////////////////////////////////////////////////////
  38.  
  39.  
  40. bool RightFrameImGuiUI::initialized= false;
  41.  
  42. PanelTab RightFrameImGuiUI::tabNames[] = {{"Inspector",RightFrameImGuiUI::ShowSettingsPanel},
  43.                                          {"ViewSettings", RightFrameImGuiUI::ShowSettingsPanel}};
  44.  
  45. RightFrameImGuiUI::RightFrameImGuiUI(Context * context = g_pApp->GetGameLogic()->GetContext())
  46.     :Object(context)
  47. {
  48.     //ctor
  49. }
  50.  
  51. bool * RightFrameImGuiUI::ShowRightFrame(void)
  52. {
  53.     // return p_opened;
  54.     bool * p_opened = NULL;
  55.  
  56.     // create tool bar
  57.     ImGuiWindowFlags window_flags = 0;
  58.  
  59.     // get windows size
  60.     unsigned int Width = g_pApp->GetGraphics()->GetWidth();
  61.     unsigned int Height = g_pApp->GetGraphics()->GetHeight();
  62.  
  63.     // set flags
  64.     window_flags |= ImGuiWindowFlags_NoTitleBar;
  65.  
  66.     // create    window
  67.     ImGui::Begin("RightFrame",  p_opened, ImVec2(200,Height-8-128), 0.5, window_flags  );
  68.  
  69.  
  70.     ImGui::End();
  71.  
  72.     initialized = true;
  73.  
  74.     // test
  75.     void (*DoPanel)() = (*tabNames[0].handler)();
  76.  
  77.  
  78.  
  79.     return p_opened;
  80. }
  81.  
  82. void RightFrameImGuiUI::ShowSettingsPanel(void)
  83. {
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement