Examples: comment on setting the RenderDrawListsFn function.

This commit is contained in:
ocornut
2015-09-07 14:58:26 +01:00
parent dafad3903e
commit 7d6ddbe5c8
6 changed files with 17 additions and 17 deletions

View File

@ -30,7 +30,7 @@ struct CUSTOMVERTEX
// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure)
// If text or lines are blurry when integrating ImGui in your engine:
// - in your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f)
static void ImGui_ImplDX9_RenderDrawLists(ImDrawData* draw_data)
void ImGui_ImplDX9_RenderDrawLists(ImDrawData* draw_data)
{
// Create and grow buffers if needed
if (!g_pVB || g_VertexBufferSize < draw_data->TotalVtxCount)
@ -191,7 +191,7 @@ bool ImGui_ImplDX9_Init(void* hwnd, IDirect3DDevice9* device)
return false;
ImGuiIO& io = ImGui::GetIO();
io.KeyMap[ImGuiKey_Tab] = VK_TAB; // Keyboard mapping. ImGui will use those indices to peek into the io.KeyDown[] array that we will update during the application lifetime.
io.KeyMap[ImGuiKey_Tab] = VK_TAB; // Keyboard mapping. ImGui will use those indices to peek into the io.KeyDown[] array that we will update during the application lifetime.
io.KeyMap[ImGuiKey_LeftArrow] = VK_LEFT;
io.KeyMap[ImGuiKey_RightArrow] = VK_RIGHT;
io.KeyMap[ImGuiKey_UpArrow] = VK_UP;
@ -211,7 +211,7 @@ bool ImGui_ImplDX9_Init(void* hwnd, IDirect3DDevice9* device)
io.KeyMap[ImGuiKey_Y] = 'Y';
io.KeyMap[ImGuiKey_Z] = 'Z';
io.RenderDrawListsFn = ImGui_ImplDX9_RenderDrawLists;
io.RenderDrawListsFn = ImGui_ImplDX9_RenderDrawLists; // Alternatively you can set this to NULL and call ImGui::GetDrawData() after ImGui::Render() to get the same ImDrawData pointer.
io.ImeWindowHandle = g_hWnd;
return true;