|
|
|
@ -48,6 +48,7 @@ static Uint64 g_Time = 0; |
|
|
|
|
static bool g_MousePressed[3] = { false, false, false }; |
|
|
|
|
static GLuint g_FontTexture = 0; |
|
|
|
|
static SDL_Cursor* g_MouseCursors[ImGuiMouseCursor_COUNT] = { 0 }; |
|
|
|
|
static char* g_ClipboardTextData = NULL; |
|
|
|
|
|
|
|
|
|
// OpenGL2 Render function.
|
|
|
|
|
// (this used to be set in io.RenderDrawListsFn and called by ImGui::Render(), but you can now call this directly from your main loop)
|
|
|
|
@ -135,7 +136,10 @@ void ImGui_ImplSdlGL2_RenderDrawData(ImDrawData* draw_data) |
|
|
|
|
|
|
|
|
|
static const char* ImGui_ImplSdlGL2_GetClipboardText(void*) |
|
|
|
|
{ |
|
|
|
|
return SDL_GetClipboardText(); |
|
|
|
|
if (g_ClipboardTextData) SDL_free(g_ClipboardTextData); |
|
|
|
|
g_ClipboardTextData = SDL_GetClipboardText(); |
|
|
|
|
|
|
|
|
|
return g_ClipboardTextData; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void ImGui_ImplSdlGL2_SetClipboardText(void*, const char* text) |
|
|
|
@ -285,6 +289,9 @@ void ImGui_ImplSdlGL2_Shutdown() |
|
|
|
|
SDL_FreeCursor(g_MouseCursors[cursor_n]); |
|
|
|
|
memset(g_MouseCursors, 0, sizeof(g_MouseCursors)); |
|
|
|
|
|
|
|
|
|
// Remove previously allocated clipboard text data
|
|
|
|
|
if (g_ClipboardTextData) SDL_free(g_ClipboardTextData); |
|
|
|
|
|
|
|
|
|
// Destroy OpenGL objects
|
|
|
|
|
ImGui_ImplSdlGL2_InvalidateDeviceObjects(); |
|
|
|
|
} |
|
|
|
|