瀏覽代碼

imgui: update submodule to a cleaner branch.

legacy
Sam Hocevar 8 年之前
父節點
當前提交
5fb319b10c
共有 4 個文件被更改,包括 21 次插入11 次删除
  1. +1
    -1
      doc/tutorial/15_lolimgui.cpp
  2. +1
    -1
      src/3rdparty/imgui
  3. +14
    -7
      src/lolimgui.cpp
  4. +5
    -2
      src/lolimgui.h

+ 1
- 1
doc/tutorial/15_lolimgui.cpp 查看文件

@@ -64,7 +64,7 @@ public:
ImGui::Text("Scroll: %f", io.MouseWheel);
ImGui::Text("Maj: %s", io.KeyShift ? "true" : "false");
ImGui::Text("Ctrl: %s", io.KeyCtrl ? "true" : "false");
ImGui::Text("Clipboard %s", LolImGui::GetClipboard());
ImGui::Text("Clipboard %s", LolImGui::GetClipboard().C());
ImGui::InputText("base input", buf, 512);
}
ImGui::End();


+ 1
- 1
src/3rdparty/imgui

@@ -1 +1 @@
Subproject commit cb7e1c18b57092da146307557b3e9d1fead7430f
Subproject commit 6742ac4587de26f9bec2a12cb0b2f33a4d84df94

+ 14
- 7
src/lolimgui.cpp 查看文件

@@ -128,8 +128,9 @@ void LolImGui::Init()

//Func pointer
io.RenderDrawListsFn = LolImGui::RenderDrawLists;
io.SetClipboardTextFn = LolImGui::SetClipboard;
io.GetClipboardTextFn = LolImGui::GetClipboard;
io.SetClipboardTextFn = LolImGui::SetClipboardCallback;
io.GetClipboardTextFn = LolImGui::GetClipboardCallback;
io.ClipboardUserData = &g_lolimgui->m_clipboard;
}

/* CALLBACKS
@@ -154,14 +155,20 @@ void LolImGui::Shutdown()
}

//-----------------------------------------------------------------------------
static String g_clipboard;
void LolImGui::SetClipboard(const char* text)
String LolImGui::GetClipboard()
{
g_clipboard = text;
return g_lolimgui ? g_lolimgui->m_clipboard : "";
}
const char* LolImGui::GetClipboard()

void LolImGui::SetClipboardCallback(void *data, const char* text)
{
String *clipboard = (String *)data;
*clipboard = text;
}
const char* LolImGui::GetClipboardCallback(void *data)
{
return g_clipboard.C();
String *clipboard = (String *)data;
return clipboard->C();
}

//-----------------------------------------------------------------------------


+ 5
- 2
src/lolimgui.h 查看文件

@@ -137,13 +137,15 @@ public:
static void Shutdown();

//-------------------------------------------------------------------------
static void SetClipboard(const char* text);
static const char* GetClipboard();
static String GetClipboard();

protected:
virtual void TickGame(float seconds);
virtual void TickDraw(float seconds, Scene &scene);

static void SetClipboardCallback(void *data, const char* text);
static const char* GetClipboardCallback(void *data);

static void RenderDrawLists(ImDrawData* draw_data);
void RenderDrawListsMethod(ImDrawData* draw_data);

@@ -172,6 +174,7 @@ protected:
InputDevice* m_keyboard = nullptr;
InputProfile m_profile;
//map<ImGuiKey_, LolImGuiKey> m_keys;
String m_clipboard;
};

//-----------------------------------------------------------------------------


Loading…
取消
儲存