|
|
|
@ -73,8 +73,8 @@ void ImGui_ImplDX9_RenderDrawLists(ImDrawData* draw_data)
|
|
|
|
|
for (int n = 0; n < draw_data->CmdListsCount; n++)
|
|
|
|
|
{
|
|
|
|
|
const ImDrawList* cmd_list = draw_data->CmdLists[n];
|
|
|
|
|
const ImDrawVert* vtx_src = &cmd_list->VtxBuffer[0];
|
|
|
|
|
for (int i = 0; i < cmd_list->VtxBuffer.size(); i++)
|
|
|
|
|
const ImDrawVert* vtx_src = cmd_list->VtxBuffer.Data;
|
|
|
|
|
for (int i = 0; i < cmd_list->VtxBuffer.Size; i++)
|
|
|
|
|
{
|
|
|
|
|
vtx_dst->pos[0] = vtx_src->pos.x;
|
|
|
|
|
vtx_dst->pos[1] = vtx_src->pos.y;
|
|
|
|
@ -85,8 +85,8 @@ void ImGui_ImplDX9_RenderDrawLists(ImDrawData* draw_data)
|
|
|
|
|
vtx_dst++;
|
|
|
|
|
vtx_src++;
|
|
|
|
|
}
|
|
|
|
|
memcpy(idx_dst, &cmd_list->IdxBuffer[0], cmd_list->IdxBuffer.size() * sizeof(ImDrawIdx));
|
|
|
|
|
idx_dst += cmd_list->IdxBuffer.size();
|
|
|
|
|
memcpy(idx_dst, cmd_list->IdxBuffer.Data, cmd_list->IdxBuffer.Size * sizeof(ImDrawIdx));
|
|
|
|
|
idx_dst += cmd_list->IdxBuffer.Size;
|
|
|
|
|
}
|
|
|
|
|
g_pVB->Unlock();
|
|
|
|
|
g_pIB->Unlock();
|
|
|
|
@ -138,7 +138,7 @@ void ImGui_ImplDX9_RenderDrawLists(ImDrawData* draw_data)
|
|
|
|
|
for (int n = 0; n < draw_data->CmdListsCount; n++)
|
|
|
|
|
{
|
|
|
|
|
const ImDrawList* cmd_list = draw_data->CmdLists[n];
|
|
|
|
|
for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.size(); cmd_i++)
|
|
|
|
|
for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++)
|
|
|
|
|
{
|
|
|
|
|
const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i];
|
|
|
|
|
if (pcmd->UserCallback)
|
|
|
|
@ -150,11 +150,11 @@ void ImGui_ImplDX9_RenderDrawLists(ImDrawData* draw_data)
|
|
|
|
|
const RECT r = { (LONG)pcmd->ClipRect.x, (LONG)pcmd->ClipRect.y, (LONG)pcmd->ClipRect.z, (LONG)pcmd->ClipRect.w };
|
|
|
|
|
g_pd3dDevice->SetTexture(0, (LPDIRECT3DTEXTURE9)pcmd->TextureId);
|
|
|
|
|
g_pd3dDevice->SetScissorRect(&r);
|
|
|
|
|
g_pd3dDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, vtx_offset, 0, (UINT)cmd_list->VtxBuffer.size(), idx_offset, pcmd->ElemCount/3);
|
|
|
|
|
g_pd3dDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, vtx_offset, 0, (UINT)cmd_list->VtxBuffer.Size, idx_offset, pcmd->ElemCount/3);
|
|
|
|
|
}
|
|
|
|
|
idx_offset += pcmd->ElemCount;
|
|
|
|
|
}
|
|
|
|
|
vtx_offset += cmd_list->VtxBuffer.size();
|
|
|
|
|
vtx_offset += cmd_list->VtxBuffer.Size;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Restore the DX9 state
|
|
|
|
|