Examples: Most examples apps detect if ImDrawIdx was changed to 32-bits instead of 16

This commit is contained in:
ocornut
2015-11-08 11:00:31 +00:00
parent 4982cd136e
commit e46c7b70eb
6 changed files with 7 additions and 6 deletions

View File

@ -47,7 +47,7 @@ void ImGui_ImplDX9_RenderDrawLists(ImDrawData* draw_data)
{
if (g_pIB) { g_pIB->Release(); g_pIB = NULL; }
g_IndexBufferSize = draw_data->TotalIdxCount + 10000;
if (g_pd3dDevice->CreateIndexBuffer(g_IndexBufferSize * sizeof(ImDrawIdx), D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, D3DFMT_INDEX16, D3DPOOL_DEFAULT, &g_pIB, NULL) < 0)
if (g_pd3dDevice->CreateIndexBuffer(g_IndexBufferSize * sizeof(ImDrawIdx), D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, sizeof(ImDrawIdx) == 2 ? D3DFMT_INDEX16 : D3DFMT_INDEX32, D3DPOOL_DEFAULT, &g_pIB, NULL) < 0)
return;
}