diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index d4f5bad..e79072f 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -34,6 +34,15 @@ ----------------------------------------------------------------------- Breaking Changes: +- Added an extra 'void* renderer_user_data' parameter to ImDrawCallback (stored in ImDrawCmd::UserCallback). + This allows custom rendering back-ends to pass custom local rendering information to the callback. + IF YOU USE AN OLD RENDERER BACK-END OR COPIED A RENDERER BACK-END BEFORE 1.71, + YOUR COMPILATION WILL FAIL ON THIS LINE: + pcmd->UserCallback(cmd_list, pcmd); + You can fix it by adding a trailing NULL parameter: + pcmd->UserCallback(cmd_list, pcmd, NULL); + If your back-end needs to support multiple versions, you can use a '#if (IMGUI_VERSION_NUM >= 17004)' test. + If you are using an old copied back-end, consider building the one directly in the imgui repository. - IO: changed AddInputCharacter(unsigned short c) signature to AddInputCharacter(unsigned int c). - Renamed SetNextTreeNodeOpen() to SetNextItemOpen(). Kept inline redirection function (will obsolete). - Window: rendering of child windows outer decorations (e.g. bg color, border, scrollbars) is now diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index d4f5bad..e79072f 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -34,6 +34,15 @@ ----------------------------------------------------------------------- Breaking Changes: +- Added an extra 'void* renderer_user_data' parameter to ImDrawCallback (stored in ImDrawCmd::UserCallback). + This allows custom rendering back-ends to pass custom local rendering information to the callback. + IF YOU USE AN OLD RENDERER BACK-END OR COPIED A RENDERER BACK-END BEFORE 1.71, + YOUR COMPILATION WILL FAIL ON THIS LINE: + pcmd->UserCallback(cmd_list, pcmd); + You can fix it by adding a trailing NULL parameter: + pcmd->UserCallback(cmd_list, pcmd, NULL); + If your back-end needs to support multiple versions, you can use a '#if (IMGUI_VERSION_NUM >= 17004)' test. + If you are using an old copied back-end, consider building the one directly in the imgui repository. - IO: changed AddInputCharacter(unsigned short c) signature to AddInputCharacter(unsigned int c). - Renamed SetNextTreeNodeOpen() to SetNextItemOpen(). Kept inline redirection function (will obsolete). - Window: rendering of child windows outer decorations (e.g. bg color, border, scrollbars) is now diff --git a/examples/imgui_impl_allegro5.cpp b/examples/imgui_impl_allegro5.cpp index 4689339..084fc9d 100644 --- a/examples/imgui_impl_allegro5.cpp +++ b/examples/imgui_impl_allegro5.cpp @@ -15,6 +15,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-11: Inputs: Don't filter character value from ALLEGRO_EVENT_KEY_CHAR before calling AddInputCharacter(). // 2019-04-30: Renderer: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-11-30: Platform: Added touchscreen support. @@ -149,7 +150,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplAllegro5_SetupRenderState(draw_data); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index d4f5bad..e79072f 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -34,6 +34,15 @@ ----------------------------------------------------------------------- Breaking Changes: +- Added an extra 'void* renderer_user_data' parameter to ImDrawCallback (stored in ImDrawCmd::UserCallback). + This allows custom rendering back-ends to pass custom local rendering information to the callback. + IF YOU USE AN OLD RENDERER BACK-END OR COPIED A RENDERER BACK-END BEFORE 1.71, + YOUR COMPILATION WILL FAIL ON THIS LINE: + pcmd->UserCallback(cmd_list, pcmd); + You can fix it by adding a trailing NULL parameter: + pcmd->UserCallback(cmd_list, pcmd, NULL); + If your back-end needs to support multiple versions, you can use a '#if (IMGUI_VERSION_NUM >= 17004)' test. + If you are using an old copied back-end, consider building the one directly in the imgui repository. - IO: changed AddInputCharacter(unsigned short c) signature to AddInputCharacter(unsigned int c). - Renamed SetNextTreeNodeOpen() to SetNextItemOpen(). Kept inline redirection function (will obsolete). - Window: rendering of child windows outer decorations (e.g. bg color, border, scrollbars) is now diff --git a/examples/imgui_impl_allegro5.cpp b/examples/imgui_impl_allegro5.cpp index 4689339..084fc9d 100644 --- a/examples/imgui_impl_allegro5.cpp +++ b/examples/imgui_impl_allegro5.cpp @@ -15,6 +15,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-11: Inputs: Don't filter character value from ALLEGRO_EVENT_KEY_CHAR before calling AddInputCharacter(). // 2019-04-30: Renderer: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-11-30: Platform: Added touchscreen support. @@ -149,7 +150,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplAllegro5_SetupRenderState(draw_data); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx10.cpp b/examples/imgui_impl_dx10.cpp index 22c4b9d..3d52eb5 100644 --- a/examples/imgui_impl_dx10.cpp +++ b/examples/imgui_impl_dx10.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX10: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX10: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). @@ -227,7 +228,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX10_SetupRenderState(draw_data, ctx); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index d4f5bad..e79072f 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -34,6 +34,15 @@ ----------------------------------------------------------------------- Breaking Changes: +- Added an extra 'void* renderer_user_data' parameter to ImDrawCallback (stored in ImDrawCmd::UserCallback). + This allows custom rendering back-ends to pass custom local rendering information to the callback. + IF YOU USE AN OLD RENDERER BACK-END OR COPIED A RENDERER BACK-END BEFORE 1.71, + YOUR COMPILATION WILL FAIL ON THIS LINE: + pcmd->UserCallback(cmd_list, pcmd); + You can fix it by adding a trailing NULL parameter: + pcmd->UserCallback(cmd_list, pcmd, NULL); + If your back-end needs to support multiple versions, you can use a '#if (IMGUI_VERSION_NUM >= 17004)' test. + If you are using an old copied back-end, consider building the one directly in the imgui repository. - IO: changed AddInputCharacter(unsigned short c) signature to AddInputCharacter(unsigned int c). - Renamed SetNextTreeNodeOpen() to SetNextItemOpen(). Kept inline redirection function (will obsolete). - Window: rendering of child windows outer decorations (e.g. bg color, border, scrollbars) is now diff --git a/examples/imgui_impl_allegro5.cpp b/examples/imgui_impl_allegro5.cpp index 4689339..084fc9d 100644 --- a/examples/imgui_impl_allegro5.cpp +++ b/examples/imgui_impl_allegro5.cpp @@ -15,6 +15,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-11: Inputs: Don't filter character value from ALLEGRO_EVENT_KEY_CHAR before calling AddInputCharacter(). // 2019-04-30: Renderer: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-11-30: Platform: Added touchscreen support. @@ -149,7 +150,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplAllegro5_SetupRenderState(draw_data); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx10.cpp b/examples/imgui_impl_dx10.cpp index 22c4b9d..3d52eb5 100644 --- a/examples/imgui_impl_dx10.cpp +++ b/examples/imgui_impl_dx10.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX10: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX10: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). @@ -227,7 +228,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX10_SetupRenderState(draw_data, ctx); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx11.cpp b/examples/imgui_impl_dx11.cpp index 3bcb03a..0b79903 100644 --- a/examples/imgui_impl_dx11.cpp +++ b/examples/imgui_impl_dx11.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX11: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX11: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). @@ -232,7 +233,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX11_SetupRenderState(draw_data, ctx); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index d4f5bad..e79072f 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -34,6 +34,15 @@ ----------------------------------------------------------------------- Breaking Changes: +- Added an extra 'void* renderer_user_data' parameter to ImDrawCallback (stored in ImDrawCmd::UserCallback). + This allows custom rendering back-ends to pass custom local rendering information to the callback. + IF YOU USE AN OLD RENDERER BACK-END OR COPIED A RENDERER BACK-END BEFORE 1.71, + YOUR COMPILATION WILL FAIL ON THIS LINE: + pcmd->UserCallback(cmd_list, pcmd); + You can fix it by adding a trailing NULL parameter: + pcmd->UserCallback(cmd_list, pcmd, NULL); + If your back-end needs to support multiple versions, you can use a '#if (IMGUI_VERSION_NUM >= 17004)' test. + If you are using an old copied back-end, consider building the one directly in the imgui repository. - IO: changed AddInputCharacter(unsigned short c) signature to AddInputCharacter(unsigned int c). - Renamed SetNextTreeNodeOpen() to SetNextItemOpen(). Kept inline redirection function (will obsolete). - Window: rendering of child windows outer decorations (e.g. bg color, border, scrollbars) is now diff --git a/examples/imgui_impl_allegro5.cpp b/examples/imgui_impl_allegro5.cpp index 4689339..084fc9d 100644 --- a/examples/imgui_impl_allegro5.cpp +++ b/examples/imgui_impl_allegro5.cpp @@ -15,6 +15,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-11: Inputs: Don't filter character value from ALLEGRO_EVENT_KEY_CHAR before calling AddInputCharacter(). // 2019-04-30: Renderer: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-11-30: Platform: Added touchscreen support. @@ -149,7 +150,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplAllegro5_SetupRenderState(draw_data); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx10.cpp b/examples/imgui_impl_dx10.cpp index 22c4b9d..3d52eb5 100644 --- a/examples/imgui_impl_dx10.cpp +++ b/examples/imgui_impl_dx10.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX10: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX10: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). @@ -227,7 +228,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX10_SetupRenderState(draw_data, ctx); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx11.cpp b/examples/imgui_impl_dx11.cpp index 3bcb03a..0b79903 100644 --- a/examples/imgui_impl_dx11.cpp +++ b/examples/imgui_impl_dx11.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX11: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX11: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). @@ -232,7 +233,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX11_SetupRenderState(draw_data, ctx); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx12.cpp b/examples/imgui_impl_dx12.cpp index b40e928..acc6563 100644 --- a/examples/imgui_impl_dx12.cpp +++ b/examples/imgui_impl_dx12.cpp @@ -13,6 +13,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX12: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX12: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-03-29: Misc: Various minor tidying up. @@ -219,7 +220,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX12_SetupRenderState(draw_data, ctx, fr); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index d4f5bad..e79072f 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -34,6 +34,15 @@ ----------------------------------------------------------------------- Breaking Changes: +- Added an extra 'void* renderer_user_data' parameter to ImDrawCallback (stored in ImDrawCmd::UserCallback). + This allows custom rendering back-ends to pass custom local rendering information to the callback. + IF YOU USE AN OLD RENDERER BACK-END OR COPIED A RENDERER BACK-END BEFORE 1.71, + YOUR COMPILATION WILL FAIL ON THIS LINE: + pcmd->UserCallback(cmd_list, pcmd); + You can fix it by adding a trailing NULL parameter: + pcmd->UserCallback(cmd_list, pcmd, NULL); + If your back-end needs to support multiple versions, you can use a '#if (IMGUI_VERSION_NUM >= 17004)' test. + If you are using an old copied back-end, consider building the one directly in the imgui repository. - IO: changed AddInputCharacter(unsigned short c) signature to AddInputCharacter(unsigned int c). - Renamed SetNextTreeNodeOpen() to SetNextItemOpen(). Kept inline redirection function (will obsolete). - Window: rendering of child windows outer decorations (e.g. bg color, border, scrollbars) is now diff --git a/examples/imgui_impl_allegro5.cpp b/examples/imgui_impl_allegro5.cpp index 4689339..084fc9d 100644 --- a/examples/imgui_impl_allegro5.cpp +++ b/examples/imgui_impl_allegro5.cpp @@ -15,6 +15,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-11: Inputs: Don't filter character value from ALLEGRO_EVENT_KEY_CHAR before calling AddInputCharacter(). // 2019-04-30: Renderer: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-11-30: Platform: Added touchscreen support. @@ -149,7 +150,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplAllegro5_SetupRenderState(draw_data); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx10.cpp b/examples/imgui_impl_dx10.cpp index 22c4b9d..3d52eb5 100644 --- a/examples/imgui_impl_dx10.cpp +++ b/examples/imgui_impl_dx10.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX10: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX10: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). @@ -227,7 +228,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX10_SetupRenderState(draw_data, ctx); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx11.cpp b/examples/imgui_impl_dx11.cpp index 3bcb03a..0b79903 100644 --- a/examples/imgui_impl_dx11.cpp +++ b/examples/imgui_impl_dx11.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX11: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX11: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). @@ -232,7 +233,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX11_SetupRenderState(draw_data, ctx); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx12.cpp b/examples/imgui_impl_dx12.cpp index b40e928..acc6563 100644 --- a/examples/imgui_impl_dx12.cpp +++ b/examples/imgui_impl_dx12.cpp @@ -13,6 +13,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX12: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX12: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-03-29: Misc: Various minor tidying up. @@ -219,7 +220,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX12_SetupRenderState(draw_data, ctx, fr); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx9.cpp b/examples/imgui_impl_dx9.cpp index 2ee76ca..a85a505 100644 --- a/examples/imgui_impl_dx9.cpp +++ b/examples/imgui_impl_dx9.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX9: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX9: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-03-29: Misc: Fixed erroneous assert in ImGui_ImplDX9_InvalidateDeviceObjects(). @@ -191,7 +192,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX9_SetupRenderState(draw_data); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index d4f5bad..e79072f 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -34,6 +34,15 @@ ----------------------------------------------------------------------- Breaking Changes: +- Added an extra 'void* renderer_user_data' parameter to ImDrawCallback (stored in ImDrawCmd::UserCallback). + This allows custom rendering back-ends to pass custom local rendering information to the callback. + IF YOU USE AN OLD RENDERER BACK-END OR COPIED A RENDERER BACK-END BEFORE 1.71, + YOUR COMPILATION WILL FAIL ON THIS LINE: + pcmd->UserCallback(cmd_list, pcmd); + You can fix it by adding a trailing NULL parameter: + pcmd->UserCallback(cmd_list, pcmd, NULL); + If your back-end needs to support multiple versions, you can use a '#if (IMGUI_VERSION_NUM >= 17004)' test. + If you are using an old copied back-end, consider building the one directly in the imgui repository. - IO: changed AddInputCharacter(unsigned short c) signature to AddInputCharacter(unsigned int c). - Renamed SetNextTreeNodeOpen() to SetNextItemOpen(). Kept inline redirection function (will obsolete). - Window: rendering of child windows outer decorations (e.g. bg color, border, scrollbars) is now diff --git a/examples/imgui_impl_allegro5.cpp b/examples/imgui_impl_allegro5.cpp index 4689339..084fc9d 100644 --- a/examples/imgui_impl_allegro5.cpp +++ b/examples/imgui_impl_allegro5.cpp @@ -15,6 +15,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-11: Inputs: Don't filter character value from ALLEGRO_EVENT_KEY_CHAR before calling AddInputCharacter(). // 2019-04-30: Renderer: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-11-30: Platform: Added touchscreen support. @@ -149,7 +150,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplAllegro5_SetupRenderState(draw_data); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx10.cpp b/examples/imgui_impl_dx10.cpp index 22c4b9d..3d52eb5 100644 --- a/examples/imgui_impl_dx10.cpp +++ b/examples/imgui_impl_dx10.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX10: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX10: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). @@ -227,7 +228,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX10_SetupRenderState(draw_data, ctx); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx11.cpp b/examples/imgui_impl_dx11.cpp index 3bcb03a..0b79903 100644 --- a/examples/imgui_impl_dx11.cpp +++ b/examples/imgui_impl_dx11.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX11: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX11: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). @@ -232,7 +233,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX11_SetupRenderState(draw_data, ctx); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx12.cpp b/examples/imgui_impl_dx12.cpp index b40e928..acc6563 100644 --- a/examples/imgui_impl_dx12.cpp +++ b/examples/imgui_impl_dx12.cpp @@ -13,6 +13,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX12: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX12: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-03-29: Misc: Various minor tidying up. @@ -219,7 +220,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX12_SetupRenderState(draw_data, ctx, fr); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx9.cpp b/examples/imgui_impl_dx9.cpp index 2ee76ca..a85a505 100644 --- a/examples/imgui_impl_dx9.cpp +++ b/examples/imgui_impl_dx9.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX9: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX9: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-03-29: Misc: Fixed erroneous assert in ImGui_ImplDX9_InvalidateDeviceObjects(). @@ -191,7 +192,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX9_SetupRenderState(draw_data); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_marmalade.cpp b/examples/imgui_impl_marmalade.cpp index a101c69..02d5390 100644 --- a/examples/imgui_impl_marmalade.cpp +++ b/examples/imgui_impl_marmalade.cpp @@ -12,6 +12,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-11: Inputs: Don't filter value from character callback before calling AddInputCharacter(). // 2018-11-30: Misc: Setting up io.BackendPlatformName/io.BackendRendererName so they can be displayed in the About Window. // 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_Marmalade_RenderDrawData() in the .h file so you can call it yourself. @@ -75,7 +76,7 @@ const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i]; if (pcmd->UserCallback) { - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index d4f5bad..e79072f 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -34,6 +34,15 @@ ----------------------------------------------------------------------- Breaking Changes: +- Added an extra 'void* renderer_user_data' parameter to ImDrawCallback (stored in ImDrawCmd::UserCallback). + This allows custom rendering back-ends to pass custom local rendering information to the callback. + IF YOU USE AN OLD RENDERER BACK-END OR COPIED A RENDERER BACK-END BEFORE 1.71, + YOUR COMPILATION WILL FAIL ON THIS LINE: + pcmd->UserCallback(cmd_list, pcmd); + You can fix it by adding a trailing NULL parameter: + pcmd->UserCallback(cmd_list, pcmd, NULL); + If your back-end needs to support multiple versions, you can use a '#if (IMGUI_VERSION_NUM >= 17004)' test. + If you are using an old copied back-end, consider building the one directly in the imgui repository. - IO: changed AddInputCharacter(unsigned short c) signature to AddInputCharacter(unsigned int c). - Renamed SetNextTreeNodeOpen() to SetNextItemOpen(). Kept inline redirection function (will obsolete). - Window: rendering of child windows outer decorations (e.g. bg color, border, scrollbars) is now diff --git a/examples/imgui_impl_allegro5.cpp b/examples/imgui_impl_allegro5.cpp index 4689339..084fc9d 100644 --- a/examples/imgui_impl_allegro5.cpp +++ b/examples/imgui_impl_allegro5.cpp @@ -15,6 +15,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-11: Inputs: Don't filter character value from ALLEGRO_EVENT_KEY_CHAR before calling AddInputCharacter(). // 2019-04-30: Renderer: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-11-30: Platform: Added touchscreen support. @@ -149,7 +150,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplAllegro5_SetupRenderState(draw_data); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx10.cpp b/examples/imgui_impl_dx10.cpp index 22c4b9d..3d52eb5 100644 --- a/examples/imgui_impl_dx10.cpp +++ b/examples/imgui_impl_dx10.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX10: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX10: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). @@ -227,7 +228,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX10_SetupRenderState(draw_data, ctx); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx11.cpp b/examples/imgui_impl_dx11.cpp index 3bcb03a..0b79903 100644 --- a/examples/imgui_impl_dx11.cpp +++ b/examples/imgui_impl_dx11.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX11: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX11: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). @@ -232,7 +233,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX11_SetupRenderState(draw_data, ctx); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx12.cpp b/examples/imgui_impl_dx12.cpp index b40e928..acc6563 100644 --- a/examples/imgui_impl_dx12.cpp +++ b/examples/imgui_impl_dx12.cpp @@ -13,6 +13,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX12: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX12: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-03-29: Misc: Various minor tidying up. @@ -219,7 +220,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX12_SetupRenderState(draw_data, ctx, fr); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx9.cpp b/examples/imgui_impl_dx9.cpp index 2ee76ca..a85a505 100644 --- a/examples/imgui_impl_dx9.cpp +++ b/examples/imgui_impl_dx9.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX9: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX9: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-03-29: Misc: Fixed erroneous assert in ImGui_ImplDX9_InvalidateDeviceObjects(). @@ -191,7 +192,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX9_SetupRenderState(draw_data); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_marmalade.cpp b/examples/imgui_impl_marmalade.cpp index a101c69..02d5390 100644 --- a/examples/imgui_impl_marmalade.cpp +++ b/examples/imgui_impl_marmalade.cpp @@ -12,6 +12,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-11: Inputs: Don't filter value from character callback before calling AddInputCharacter(). // 2018-11-30: Misc: Setting up io.BackendPlatformName/io.BackendRendererName so they can be displayed in the About Window. // 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_Marmalade_RenderDrawData() in the .h file so you can call it yourself. @@ -75,7 +76,7 @@ const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i]; if (pcmd->UserCallback) { - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_metal.mm b/examples/imgui_impl_metal.mm index f3f1b12..b37991b 100644 --- a/examples/imgui_impl_metal.mm +++ b/examples/imgui_impl_metal.mm @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: Metal: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: Metal: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-02-11: Metal: Projecting clipping rectangles correctly using draw_data->FramebufferScale to allow multi-viewports for retina display. @@ -495,7 +496,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) [self setupRenderState:drawData commandBuffer:commandBuffer commandEncoder:commandEncoder renderPipelineState:renderPipelineState vertexBuffer:vertexBuffer vertexBufferOffset:vertexBufferOffset]; else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index d4f5bad..e79072f 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -34,6 +34,15 @@ ----------------------------------------------------------------------- Breaking Changes: +- Added an extra 'void* renderer_user_data' parameter to ImDrawCallback (stored in ImDrawCmd::UserCallback). + This allows custom rendering back-ends to pass custom local rendering information to the callback. + IF YOU USE AN OLD RENDERER BACK-END OR COPIED A RENDERER BACK-END BEFORE 1.71, + YOUR COMPILATION WILL FAIL ON THIS LINE: + pcmd->UserCallback(cmd_list, pcmd); + You can fix it by adding a trailing NULL parameter: + pcmd->UserCallback(cmd_list, pcmd, NULL); + If your back-end needs to support multiple versions, you can use a '#if (IMGUI_VERSION_NUM >= 17004)' test. + If you are using an old copied back-end, consider building the one directly in the imgui repository. - IO: changed AddInputCharacter(unsigned short c) signature to AddInputCharacter(unsigned int c). - Renamed SetNextTreeNodeOpen() to SetNextItemOpen(). Kept inline redirection function (will obsolete). - Window: rendering of child windows outer decorations (e.g. bg color, border, scrollbars) is now diff --git a/examples/imgui_impl_allegro5.cpp b/examples/imgui_impl_allegro5.cpp index 4689339..084fc9d 100644 --- a/examples/imgui_impl_allegro5.cpp +++ b/examples/imgui_impl_allegro5.cpp @@ -15,6 +15,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-11: Inputs: Don't filter character value from ALLEGRO_EVENT_KEY_CHAR before calling AddInputCharacter(). // 2019-04-30: Renderer: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-11-30: Platform: Added touchscreen support. @@ -149,7 +150,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplAllegro5_SetupRenderState(draw_data); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx10.cpp b/examples/imgui_impl_dx10.cpp index 22c4b9d..3d52eb5 100644 --- a/examples/imgui_impl_dx10.cpp +++ b/examples/imgui_impl_dx10.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX10: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX10: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). @@ -227,7 +228,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX10_SetupRenderState(draw_data, ctx); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx11.cpp b/examples/imgui_impl_dx11.cpp index 3bcb03a..0b79903 100644 --- a/examples/imgui_impl_dx11.cpp +++ b/examples/imgui_impl_dx11.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX11: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX11: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). @@ -232,7 +233,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX11_SetupRenderState(draw_data, ctx); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx12.cpp b/examples/imgui_impl_dx12.cpp index b40e928..acc6563 100644 --- a/examples/imgui_impl_dx12.cpp +++ b/examples/imgui_impl_dx12.cpp @@ -13,6 +13,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX12: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX12: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-03-29: Misc: Various minor tidying up. @@ -219,7 +220,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX12_SetupRenderState(draw_data, ctx, fr); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx9.cpp b/examples/imgui_impl_dx9.cpp index 2ee76ca..a85a505 100644 --- a/examples/imgui_impl_dx9.cpp +++ b/examples/imgui_impl_dx9.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX9: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX9: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-03-29: Misc: Fixed erroneous assert in ImGui_ImplDX9_InvalidateDeviceObjects(). @@ -191,7 +192,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX9_SetupRenderState(draw_data); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_marmalade.cpp b/examples/imgui_impl_marmalade.cpp index a101c69..02d5390 100644 --- a/examples/imgui_impl_marmalade.cpp +++ b/examples/imgui_impl_marmalade.cpp @@ -12,6 +12,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-11: Inputs: Don't filter value from character callback before calling AddInputCharacter(). // 2018-11-30: Misc: Setting up io.BackendPlatformName/io.BackendRendererName so they can be displayed in the About Window. // 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_Marmalade_RenderDrawData() in the .h file so you can call it yourself. @@ -75,7 +76,7 @@ const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i]; if (pcmd->UserCallback) { - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_metal.mm b/examples/imgui_impl_metal.mm index f3f1b12..b37991b 100644 --- a/examples/imgui_impl_metal.mm +++ b/examples/imgui_impl_metal.mm @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: Metal: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: Metal: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-02-11: Metal: Projecting clipping rectangles correctly using draw_data->FramebufferScale to allow multi-viewports for retina display. @@ -495,7 +496,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) [self setupRenderState:drawData commandBuffer:commandBuffer commandEncoder:commandEncoder renderPipelineState:renderPipelineState vertexBuffer:vertexBuffer vertexBufferOffset:vertexBufferOffset]; else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_opengl2.cpp b/examples/imgui_impl_opengl2.cpp index 95720ff..45cf93c 100644 --- a/examples/imgui_impl_opengl2.cpp +++ b/examples/imgui_impl_opengl2.cpp @@ -18,6 +18,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-04-30: OpenGL: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-02-11: OpenGL: Projecting clipping rectangles correctly using draw_data->FramebufferScale to allow multi-viewports for retina display. // 2018-11-30: Misc: Setting up io.BackendRendererName so it can be displayed in the About Window. @@ -155,7 +156,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplOpenGL2_SetupRenderState(draw_data, fb_width, fb_height); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index d4f5bad..e79072f 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -34,6 +34,15 @@ ----------------------------------------------------------------------- Breaking Changes: +- Added an extra 'void* renderer_user_data' parameter to ImDrawCallback (stored in ImDrawCmd::UserCallback). + This allows custom rendering back-ends to pass custom local rendering information to the callback. + IF YOU USE AN OLD RENDERER BACK-END OR COPIED A RENDERER BACK-END BEFORE 1.71, + YOUR COMPILATION WILL FAIL ON THIS LINE: + pcmd->UserCallback(cmd_list, pcmd); + You can fix it by adding a trailing NULL parameter: + pcmd->UserCallback(cmd_list, pcmd, NULL); + If your back-end needs to support multiple versions, you can use a '#if (IMGUI_VERSION_NUM >= 17004)' test. + If you are using an old copied back-end, consider building the one directly in the imgui repository. - IO: changed AddInputCharacter(unsigned short c) signature to AddInputCharacter(unsigned int c). - Renamed SetNextTreeNodeOpen() to SetNextItemOpen(). Kept inline redirection function (will obsolete). - Window: rendering of child windows outer decorations (e.g. bg color, border, scrollbars) is now diff --git a/examples/imgui_impl_allegro5.cpp b/examples/imgui_impl_allegro5.cpp index 4689339..084fc9d 100644 --- a/examples/imgui_impl_allegro5.cpp +++ b/examples/imgui_impl_allegro5.cpp @@ -15,6 +15,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-11: Inputs: Don't filter character value from ALLEGRO_EVENT_KEY_CHAR before calling AddInputCharacter(). // 2019-04-30: Renderer: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-11-30: Platform: Added touchscreen support. @@ -149,7 +150,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplAllegro5_SetupRenderState(draw_data); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx10.cpp b/examples/imgui_impl_dx10.cpp index 22c4b9d..3d52eb5 100644 --- a/examples/imgui_impl_dx10.cpp +++ b/examples/imgui_impl_dx10.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX10: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX10: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). @@ -227,7 +228,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX10_SetupRenderState(draw_data, ctx); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx11.cpp b/examples/imgui_impl_dx11.cpp index 3bcb03a..0b79903 100644 --- a/examples/imgui_impl_dx11.cpp +++ b/examples/imgui_impl_dx11.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX11: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX11: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). @@ -232,7 +233,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX11_SetupRenderState(draw_data, ctx); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx12.cpp b/examples/imgui_impl_dx12.cpp index b40e928..acc6563 100644 --- a/examples/imgui_impl_dx12.cpp +++ b/examples/imgui_impl_dx12.cpp @@ -13,6 +13,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX12: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX12: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-03-29: Misc: Various minor tidying up. @@ -219,7 +220,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX12_SetupRenderState(draw_data, ctx, fr); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx9.cpp b/examples/imgui_impl_dx9.cpp index 2ee76ca..a85a505 100644 --- a/examples/imgui_impl_dx9.cpp +++ b/examples/imgui_impl_dx9.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX9: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX9: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-03-29: Misc: Fixed erroneous assert in ImGui_ImplDX9_InvalidateDeviceObjects(). @@ -191,7 +192,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX9_SetupRenderState(draw_data); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_marmalade.cpp b/examples/imgui_impl_marmalade.cpp index a101c69..02d5390 100644 --- a/examples/imgui_impl_marmalade.cpp +++ b/examples/imgui_impl_marmalade.cpp @@ -12,6 +12,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-11: Inputs: Don't filter value from character callback before calling AddInputCharacter(). // 2018-11-30: Misc: Setting up io.BackendPlatformName/io.BackendRendererName so they can be displayed in the About Window. // 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_Marmalade_RenderDrawData() in the .h file so you can call it yourself. @@ -75,7 +76,7 @@ const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i]; if (pcmd->UserCallback) { - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_metal.mm b/examples/imgui_impl_metal.mm index f3f1b12..b37991b 100644 --- a/examples/imgui_impl_metal.mm +++ b/examples/imgui_impl_metal.mm @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: Metal: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: Metal: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-02-11: Metal: Projecting clipping rectangles correctly using draw_data->FramebufferScale to allow multi-viewports for retina display. @@ -495,7 +496,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) [self setupRenderState:drawData commandBuffer:commandBuffer commandEncoder:commandEncoder renderPipelineState:renderPipelineState vertexBuffer:vertexBuffer vertexBufferOffset:vertexBufferOffset]; else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_opengl2.cpp b/examples/imgui_impl_opengl2.cpp index 95720ff..45cf93c 100644 --- a/examples/imgui_impl_opengl2.cpp +++ b/examples/imgui_impl_opengl2.cpp @@ -18,6 +18,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-04-30: OpenGL: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-02-11: OpenGL: Projecting clipping rectangles correctly using draw_data->FramebufferScale to allow multi-viewports for retina display. // 2018-11-30: Misc: Setting up io.BackendRendererName so it can be displayed in the About Window. @@ -155,7 +156,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplOpenGL2_SetupRenderState(draw_data, fb_width, fb_height); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_opengl3.cpp b/examples/imgui_impl_opengl3.cpp index 2bf4ea8..867f7fc 100644 --- a/examples/imgui_impl_opengl3.cpp +++ b/examples/imgui_impl_opengl3.cpp @@ -13,6 +13,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: OpenGL: Desktop GL only: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: OpenGL: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-03-29: OpenGL: Not calling glBindBuffer more than necessary in the render loop. @@ -291,7 +292,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplOpenGL3_SetupRenderState(draw_data, fb_width, fb_height, vertex_array_object); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index d4f5bad..e79072f 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -34,6 +34,15 @@ ----------------------------------------------------------------------- Breaking Changes: +- Added an extra 'void* renderer_user_data' parameter to ImDrawCallback (stored in ImDrawCmd::UserCallback). + This allows custom rendering back-ends to pass custom local rendering information to the callback. + IF YOU USE AN OLD RENDERER BACK-END OR COPIED A RENDERER BACK-END BEFORE 1.71, + YOUR COMPILATION WILL FAIL ON THIS LINE: + pcmd->UserCallback(cmd_list, pcmd); + You can fix it by adding a trailing NULL parameter: + pcmd->UserCallback(cmd_list, pcmd, NULL); + If your back-end needs to support multiple versions, you can use a '#if (IMGUI_VERSION_NUM >= 17004)' test. + If you are using an old copied back-end, consider building the one directly in the imgui repository. - IO: changed AddInputCharacter(unsigned short c) signature to AddInputCharacter(unsigned int c). - Renamed SetNextTreeNodeOpen() to SetNextItemOpen(). Kept inline redirection function (will obsolete). - Window: rendering of child windows outer decorations (e.g. bg color, border, scrollbars) is now diff --git a/examples/imgui_impl_allegro5.cpp b/examples/imgui_impl_allegro5.cpp index 4689339..084fc9d 100644 --- a/examples/imgui_impl_allegro5.cpp +++ b/examples/imgui_impl_allegro5.cpp @@ -15,6 +15,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-11: Inputs: Don't filter character value from ALLEGRO_EVENT_KEY_CHAR before calling AddInputCharacter(). // 2019-04-30: Renderer: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-11-30: Platform: Added touchscreen support. @@ -149,7 +150,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplAllegro5_SetupRenderState(draw_data); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx10.cpp b/examples/imgui_impl_dx10.cpp index 22c4b9d..3d52eb5 100644 --- a/examples/imgui_impl_dx10.cpp +++ b/examples/imgui_impl_dx10.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX10: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX10: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). @@ -227,7 +228,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX10_SetupRenderState(draw_data, ctx); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx11.cpp b/examples/imgui_impl_dx11.cpp index 3bcb03a..0b79903 100644 --- a/examples/imgui_impl_dx11.cpp +++ b/examples/imgui_impl_dx11.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX11: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX11: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). @@ -232,7 +233,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX11_SetupRenderState(draw_data, ctx); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx12.cpp b/examples/imgui_impl_dx12.cpp index b40e928..acc6563 100644 --- a/examples/imgui_impl_dx12.cpp +++ b/examples/imgui_impl_dx12.cpp @@ -13,6 +13,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX12: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX12: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-03-29: Misc: Various minor tidying up. @@ -219,7 +220,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX12_SetupRenderState(draw_data, ctx, fr); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx9.cpp b/examples/imgui_impl_dx9.cpp index 2ee76ca..a85a505 100644 --- a/examples/imgui_impl_dx9.cpp +++ b/examples/imgui_impl_dx9.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX9: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX9: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-03-29: Misc: Fixed erroneous assert in ImGui_ImplDX9_InvalidateDeviceObjects(). @@ -191,7 +192,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX9_SetupRenderState(draw_data); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_marmalade.cpp b/examples/imgui_impl_marmalade.cpp index a101c69..02d5390 100644 --- a/examples/imgui_impl_marmalade.cpp +++ b/examples/imgui_impl_marmalade.cpp @@ -12,6 +12,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-11: Inputs: Don't filter value from character callback before calling AddInputCharacter(). // 2018-11-30: Misc: Setting up io.BackendPlatformName/io.BackendRendererName so they can be displayed in the About Window. // 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_Marmalade_RenderDrawData() in the .h file so you can call it yourself. @@ -75,7 +76,7 @@ const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i]; if (pcmd->UserCallback) { - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_metal.mm b/examples/imgui_impl_metal.mm index f3f1b12..b37991b 100644 --- a/examples/imgui_impl_metal.mm +++ b/examples/imgui_impl_metal.mm @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: Metal: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: Metal: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-02-11: Metal: Projecting clipping rectangles correctly using draw_data->FramebufferScale to allow multi-viewports for retina display. @@ -495,7 +496,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) [self setupRenderState:drawData commandBuffer:commandBuffer commandEncoder:commandEncoder renderPipelineState:renderPipelineState vertexBuffer:vertexBuffer vertexBufferOffset:vertexBufferOffset]; else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_opengl2.cpp b/examples/imgui_impl_opengl2.cpp index 95720ff..45cf93c 100644 --- a/examples/imgui_impl_opengl2.cpp +++ b/examples/imgui_impl_opengl2.cpp @@ -18,6 +18,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-04-30: OpenGL: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-02-11: OpenGL: Projecting clipping rectangles correctly using draw_data->FramebufferScale to allow multi-viewports for retina display. // 2018-11-30: Misc: Setting up io.BackendRendererName so it can be displayed in the About Window. @@ -155,7 +156,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplOpenGL2_SetupRenderState(draw_data, fb_width, fb_height); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_opengl3.cpp b/examples/imgui_impl_opengl3.cpp index 2bf4ea8..867f7fc 100644 --- a/examples/imgui_impl_opengl3.cpp +++ b/examples/imgui_impl_opengl3.cpp @@ -13,6 +13,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: OpenGL: Desktop GL only: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: OpenGL: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-03-29: OpenGL: Not calling glBindBuffer more than necessary in the render loop. @@ -291,7 +292,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplOpenGL3_SetupRenderState(draw_data, fb_width, fb_height, vertex_array_object); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_vulkan.cpp b/examples/imgui_impl_vulkan.cpp index b55cb19..8e09103 100644 --- a/examples/imgui_impl_vulkan.cpp +++ b/examples/imgui_impl_vulkan.cpp @@ -22,6 +22,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: Vulkan: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: Vulkan: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-04-04: *BREAKING CHANGE*: Vulkan: Added ImageCount/MinImageCount fields in ImGui_ImplVulkan_InitInfo, required for initialization (was previously a hard #define IMGUI_VK_QUEUED_FRAMES 2). Added ImGui_ImplVulkan_SetMinImageCount(). @@ -394,7 +395,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplVulkan_SetupRenderState(draw_data, command_buffer, rb, fb_width, fb_height); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index d4f5bad..e79072f 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -34,6 +34,15 @@ ----------------------------------------------------------------------- Breaking Changes: +- Added an extra 'void* renderer_user_data' parameter to ImDrawCallback (stored in ImDrawCmd::UserCallback). + This allows custom rendering back-ends to pass custom local rendering information to the callback. + IF YOU USE AN OLD RENDERER BACK-END OR COPIED A RENDERER BACK-END BEFORE 1.71, + YOUR COMPILATION WILL FAIL ON THIS LINE: + pcmd->UserCallback(cmd_list, pcmd); + You can fix it by adding a trailing NULL parameter: + pcmd->UserCallback(cmd_list, pcmd, NULL); + If your back-end needs to support multiple versions, you can use a '#if (IMGUI_VERSION_NUM >= 17004)' test. + If you are using an old copied back-end, consider building the one directly in the imgui repository. - IO: changed AddInputCharacter(unsigned short c) signature to AddInputCharacter(unsigned int c). - Renamed SetNextTreeNodeOpen() to SetNextItemOpen(). Kept inline redirection function (will obsolete). - Window: rendering of child windows outer decorations (e.g. bg color, border, scrollbars) is now diff --git a/examples/imgui_impl_allegro5.cpp b/examples/imgui_impl_allegro5.cpp index 4689339..084fc9d 100644 --- a/examples/imgui_impl_allegro5.cpp +++ b/examples/imgui_impl_allegro5.cpp @@ -15,6 +15,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-11: Inputs: Don't filter character value from ALLEGRO_EVENT_KEY_CHAR before calling AddInputCharacter(). // 2019-04-30: Renderer: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-11-30: Platform: Added touchscreen support. @@ -149,7 +150,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplAllegro5_SetupRenderState(draw_data); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx10.cpp b/examples/imgui_impl_dx10.cpp index 22c4b9d..3d52eb5 100644 --- a/examples/imgui_impl_dx10.cpp +++ b/examples/imgui_impl_dx10.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX10: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX10: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). @@ -227,7 +228,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX10_SetupRenderState(draw_data, ctx); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx11.cpp b/examples/imgui_impl_dx11.cpp index 3bcb03a..0b79903 100644 --- a/examples/imgui_impl_dx11.cpp +++ b/examples/imgui_impl_dx11.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX11: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX11: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). @@ -232,7 +233,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX11_SetupRenderState(draw_data, ctx); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx12.cpp b/examples/imgui_impl_dx12.cpp index b40e928..acc6563 100644 --- a/examples/imgui_impl_dx12.cpp +++ b/examples/imgui_impl_dx12.cpp @@ -13,6 +13,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX12: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX12: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-03-29: Misc: Various minor tidying up. @@ -219,7 +220,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX12_SetupRenderState(draw_data, ctx, fr); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx9.cpp b/examples/imgui_impl_dx9.cpp index 2ee76ca..a85a505 100644 --- a/examples/imgui_impl_dx9.cpp +++ b/examples/imgui_impl_dx9.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX9: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX9: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-03-29: Misc: Fixed erroneous assert in ImGui_ImplDX9_InvalidateDeviceObjects(). @@ -191,7 +192,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX9_SetupRenderState(draw_data); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_marmalade.cpp b/examples/imgui_impl_marmalade.cpp index a101c69..02d5390 100644 --- a/examples/imgui_impl_marmalade.cpp +++ b/examples/imgui_impl_marmalade.cpp @@ -12,6 +12,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-11: Inputs: Don't filter value from character callback before calling AddInputCharacter(). // 2018-11-30: Misc: Setting up io.BackendPlatformName/io.BackendRendererName so they can be displayed in the About Window. // 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_Marmalade_RenderDrawData() in the .h file so you can call it yourself. @@ -75,7 +76,7 @@ const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i]; if (pcmd->UserCallback) { - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_metal.mm b/examples/imgui_impl_metal.mm index f3f1b12..b37991b 100644 --- a/examples/imgui_impl_metal.mm +++ b/examples/imgui_impl_metal.mm @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: Metal: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: Metal: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-02-11: Metal: Projecting clipping rectangles correctly using draw_data->FramebufferScale to allow multi-viewports for retina display. @@ -495,7 +496,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) [self setupRenderState:drawData commandBuffer:commandBuffer commandEncoder:commandEncoder renderPipelineState:renderPipelineState vertexBuffer:vertexBuffer vertexBufferOffset:vertexBufferOffset]; else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_opengl2.cpp b/examples/imgui_impl_opengl2.cpp index 95720ff..45cf93c 100644 --- a/examples/imgui_impl_opengl2.cpp +++ b/examples/imgui_impl_opengl2.cpp @@ -18,6 +18,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-04-30: OpenGL: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-02-11: OpenGL: Projecting clipping rectangles correctly using draw_data->FramebufferScale to allow multi-viewports for retina display. // 2018-11-30: Misc: Setting up io.BackendRendererName so it can be displayed in the About Window. @@ -155,7 +156,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplOpenGL2_SetupRenderState(draw_data, fb_width, fb_height); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_opengl3.cpp b/examples/imgui_impl_opengl3.cpp index 2bf4ea8..867f7fc 100644 --- a/examples/imgui_impl_opengl3.cpp +++ b/examples/imgui_impl_opengl3.cpp @@ -13,6 +13,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: OpenGL: Desktop GL only: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: OpenGL: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-03-29: OpenGL: Not calling glBindBuffer more than necessary in the render loop. @@ -291,7 +292,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplOpenGL3_SetupRenderState(draw_data, fb_width, fb_height, vertex_array_object); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_vulkan.cpp b/examples/imgui_impl_vulkan.cpp index b55cb19..8e09103 100644 --- a/examples/imgui_impl_vulkan.cpp +++ b/examples/imgui_impl_vulkan.cpp @@ -22,6 +22,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: Vulkan: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: Vulkan: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-04-04: *BREAKING CHANGE*: Vulkan: Added ImageCount/MinImageCount fields in ImGui_ImplVulkan_InitInfo, required for initialization (was previously a hard #define IMGUI_VK_QUEUED_FRAMES 2). Added ImGui_ImplVulkan_SetMinImageCount(). @@ -394,7 +395,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplVulkan_SetupRenderState(draw_data, command_buffer, rb, fb_width, fb_height); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/imgui.cpp b/imgui.cpp index 72ea25e..00c22dd 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -289,7 +289,7 @@ const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i]; if (pcmd->UserCallback) { - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { @@ -369,6 +369,14 @@ When you are not sure about a old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all imgui files. You can read releases logs https://github.com/ocornut/imgui/releases for more details. + - 2019/XX/XX (1.XX) - added an extra 'void* renderer_user_data' parameter to ImDrawCallback (stored in ImDrawCmd::UserCallback). + this allows custom rendering back-ends to pass custom local rendering information to the callback. + if you use an renderer back-end based on or copied from one before version 1.71, compilation will fail on this line: + pcmd->UserCallback(cmd_list, pcmd); + you can fix it by adding a trailing NULL parameter: + pcmd->UserCallback(cmd_list, pcmd, NULL); + if your back-end needs to support multiple versions, you can use a '#if (IMGUI_VERSION_NUM >= 17004)' test. + if you are using an old copied back-end, consider building the one directly in the imgui repository. - 2019/06/07 (1.71) - rendering of child window outer decorations (bg color, border, scrollbars) is now performed as part of the parent window. If you have overlapping child windows in a same parent, and relied on their relative z-order to be mapped to their submission order, this will affect your rendering. This optimization is disabled if the parent window has no visual output, because it appears to be the most common situation leading to the creation of overlapping child windows. diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index d4f5bad..e79072f 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -34,6 +34,15 @@ ----------------------------------------------------------------------- Breaking Changes: +- Added an extra 'void* renderer_user_data' parameter to ImDrawCallback (stored in ImDrawCmd::UserCallback). + This allows custom rendering back-ends to pass custom local rendering information to the callback. + IF YOU USE AN OLD RENDERER BACK-END OR COPIED A RENDERER BACK-END BEFORE 1.71, + YOUR COMPILATION WILL FAIL ON THIS LINE: + pcmd->UserCallback(cmd_list, pcmd); + You can fix it by adding a trailing NULL parameter: + pcmd->UserCallback(cmd_list, pcmd, NULL); + If your back-end needs to support multiple versions, you can use a '#if (IMGUI_VERSION_NUM >= 17004)' test. + If you are using an old copied back-end, consider building the one directly in the imgui repository. - IO: changed AddInputCharacter(unsigned short c) signature to AddInputCharacter(unsigned int c). - Renamed SetNextTreeNodeOpen() to SetNextItemOpen(). Kept inline redirection function (will obsolete). - Window: rendering of child windows outer decorations (e.g. bg color, border, scrollbars) is now diff --git a/examples/imgui_impl_allegro5.cpp b/examples/imgui_impl_allegro5.cpp index 4689339..084fc9d 100644 --- a/examples/imgui_impl_allegro5.cpp +++ b/examples/imgui_impl_allegro5.cpp @@ -15,6 +15,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-11: Inputs: Don't filter character value from ALLEGRO_EVENT_KEY_CHAR before calling AddInputCharacter(). // 2019-04-30: Renderer: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-11-30: Platform: Added touchscreen support. @@ -149,7 +150,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplAllegro5_SetupRenderState(draw_data); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx10.cpp b/examples/imgui_impl_dx10.cpp index 22c4b9d..3d52eb5 100644 --- a/examples/imgui_impl_dx10.cpp +++ b/examples/imgui_impl_dx10.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX10: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX10: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). @@ -227,7 +228,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX10_SetupRenderState(draw_data, ctx); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx11.cpp b/examples/imgui_impl_dx11.cpp index 3bcb03a..0b79903 100644 --- a/examples/imgui_impl_dx11.cpp +++ b/examples/imgui_impl_dx11.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX11: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX11: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). @@ -232,7 +233,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX11_SetupRenderState(draw_data, ctx); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx12.cpp b/examples/imgui_impl_dx12.cpp index b40e928..acc6563 100644 --- a/examples/imgui_impl_dx12.cpp +++ b/examples/imgui_impl_dx12.cpp @@ -13,6 +13,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX12: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX12: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-03-29: Misc: Various minor tidying up. @@ -219,7 +220,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX12_SetupRenderState(draw_data, ctx, fr); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_dx9.cpp b/examples/imgui_impl_dx9.cpp index 2ee76ca..a85a505 100644 --- a/examples/imgui_impl_dx9.cpp +++ b/examples/imgui_impl_dx9.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: DirectX9: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX9: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-03-29: Misc: Fixed erroneous assert in ImGui_ImplDX9_InvalidateDeviceObjects(). @@ -191,7 +192,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplDX9_SetupRenderState(draw_data); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_marmalade.cpp b/examples/imgui_impl_marmalade.cpp index a101c69..02d5390 100644 --- a/examples/imgui_impl_marmalade.cpp +++ b/examples/imgui_impl_marmalade.cpp @@ -12,6 +12,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-11: Inputs: Don't filter value from character callback before calling AddInputCharacter(). // 2018-11-30: Misc: Setting up io.BackendPlatformName/io.BackendRendererName so they can be displayed in the About Window. // 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_Marmalade_RenderDrawData() in the .h file so you can call it yourself. @@ -75,7 +76,7 @@ const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i]; if (pcmd->UserCallback) { - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_metal.mm b/examples/imgui_impl_metal.mm index f3f1b12..b37991b 100644 --- a/examples/imgui_impl_metal.mm +++ b/examples/imgui_impl_metal.mm @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: Metal: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: Metal: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-02-11: Metal: Projecting clipping rectangles correctly using draw_data->FramebufferScale to allow multi-viewports for retina display. @@ -495,7 +496,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) [self setupRenderState:drawData commandBuffer:commandBuffer commandEncoder:commandEncoder renderPipelineState:renderPipelineState vertexBuffer:vertexBuffer vertexBufferOffset:vertexBufferOffset]; else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_opengl2.cpp b/examples/imgui_impl_opengl2.cpp index 95720ff..45cf93c 100644 --- a/examples/imgui_impl_opengl2.cpp +++ b/examples/imgui_impl_opengl2.cpp @@ -18,6 +18,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-04-30: OpenGL: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-02-11: OpenGL: Projecting clipping rectangles correctly using draw_data->FramebufferScale to allow multi-viewports for retina display. // 2018-11-30: Misc: Setting up io.BackendRendererName so it can be displayed in the About Window. @@ -155,7 +156,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplOpenGL2_SetupRenderState(draw_data, fb_width, fb_height); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_opengl3.cpp b/examples/imgui_impl_opengl3.cpp index 2bf4ea8..867f7fc 100644 --- a/examples/imgui_impl_opengl3.cpp +++ b/examples/imgui_impl_opengl3.cpp @@ -13,6 +13,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: OpenGL: Desktop GL only: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: OpenGL: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-03-29: OpenGL: Not calling glBindBuffer more than necessary in the render loop. @@ -291,7 +292,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplOpenGL3_SetupRenderState(draw_data, fb_width, fb_height, vertex_array_object); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/examples/imgui_impl_vulkan.cpp b/examples/imgui_impl_vulkan.cpp index b55cb19..8e09103 100644 --- a/examples/imgui_impl_vulkan.cpp +++ b/examples/imgui_impl_vulkan.cpp @@ -22,6 +22,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-06-05: Misc: Added extra NULL parameter to the pcmd->UserCallback() call to fix compilation with the new ImDrawCallback api. // 2019-05-29: Vulkan: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: Vulkan: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-04-04: *BREAKING CHANGE*: Vulkan: Added ImageCount/MinImageCount fields in ImGui_ImplVulkan_InitInfo, required for initialization (was previously a hard #define IMGUI_VK_QUEUED_FRAMES 2). Added ImGui_ImplVulkan_SetMinImageCount(). @@ -394,7 +395,7 @@ if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) ImGui_ImplVulkan_SetupRenderState(draw_data, command_buffer, rb, fb_width, fb_height); else - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { diff --git a/imgui.cpp b/imgui.cpp index 72ea25e..00c22dd 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -289,7 +289,7 @@ const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i]; if (pcmd->UserCallback) { - pcmd->UserCallback(cmd_list, pcmd); + pcmd->UserCallback(cmd_list, pcmd, NULL); } else { @@ -369,6 +369,14 @@ When you are not sure about a old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all imgui files. You can read releases logs https://github.com/ocornut/imgui/releases for more details. + - 2019/XX/XX (1.XX) - added an extra 'void* renderer_user_data' parameter to ImDrawCallback (stored in ImDrawCmd::UserCallback). + this allows custom rendering back-ends to pass custom local rendering information to the callback. + if you use an renderer back-end based on or copied from one before version 1.71, compilation will fail on this line: + pcmd->UserCallback(cmd_list, pcmd); + you can fix it by adding a trailing NULL parameter: + pcmd->UserCallback(cmd_list, pcmd, NULL); + if your back-end needs to support multiple versions, you can use a '#if (IMGUI_VERSION_NUM >= 17004)' test. + if you are using an old copied back-end, consider building the one directly in the imgui repository. - 2019/06/07 (1.71) - rendering of child window outer decorations (bg color, border, scrollbars) is now performed as part of the parent window. If you have overlapping child windows in a same parent, and relied on their relative z-order to be mapped to their submission order, this will affect your rendering. This optimization is disabled if the parent window has no visual output, because it appears to be the most common situation leading to the creation of overlapping child windows. diff --git a/imgui.h b/imgui.h index d5de110..f17b330 100644 --- a/imgui.h +++ b/imgui.h @@ -47,7 +47,7 @@ // Version // (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens) #define IMGUI_VERSION "1.71" -#define IMGUI_VERSION_NUM 17100 +#define IMGUI_VERSION_NUM 17100+1 #define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx)) // Define attributes of all API symbols declarations (e.g. for DLL under Windows) @@ -1771,10 +1771,11 @@ // you can poke into the draw list for that! Draw callback may be useful for example to: // A) Change your GPU render state, // B) render a complex 3D scene inside a UI element without an intermediate texture/render target, etc. -// The expected behavior from your rendering function is 'if (cmd.UserCallback != NULL) { cmd.UserCallback(parent_list, cmd); } else { RenderTriangles() }' +// The expected behavior from your rendering function is 'if (cmd.UserCallback != NULL) { cmd.UserCallback(parent_list, cmd, NULL); } else { RenderTriangles() }' +// Pre-1.71 versions were missing the 'void* renderer_user_data', if you are getting a compile error on an old back-end, add an extra 'NULL' parameter to the call. // If you want to override the signature of ImDrawCallback, you can simply use e.g. '#define ImDrawCallback MyDrawCallback' (in imconfig.h) + update rendering back-end accordingly. #ifndef ImDrawCallback -typedef void (*ImDrawCallback)(const ImDrawList* parent_list, const ImDrawCmd* cmd); +typedef void (*ImDrawCallback)(const ImDrawList* parent_list, const ImDrawCmd* cmd, void* renderer_user_data); #endif // Special Draw callback value to request renderer back-end to reset the graphics/render state. @@ -1784,7 +1785,7 @@ #define ImDrawCallback_ResetRenderState (ImDrawCallback)(-1) // Typically, 1 command = 1 GPU draw call (unless command is a callback) -// Pre 1.71 back-ends will typically ignore the VtxOffset/IdxOffset fields. When 'io.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset' +// Pre-1.71 back-ends will typically ignore the VtxOffset/IdxOffset fields. When 'io.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset' // is enabled, those fields allow us to render meshes larger than 64K vertices while keeping 16-bits indices. struct ImDrawCmd {