mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 20:18:47 +02:00
AA branch: ImDrawCmd idx_count -> elem_count
This commit is contained in:
@ -131,9 +131,9 @@ static void ImGui_ImplDX11_RenderDrawLists(ImDrawData* draw_data)
|
||||
const D3D11_RECT r = { (LONG)pcmd->clip_rect.x, (LONG)pcmd->clip_rect.y, (LONG)pcmd->clip_rect.z, (LONG)pcmd->clip_rect.w };
|
||||
g_pd3dDeviceContext->PSSetShaderResources(0, 1, (ID3D11ShaderResourceView**)&pcmd->texture_id);
|
||||
g_pd3dDeviceContext->RSSetScissorRects(1, &r);
|
||||
g_pd3dDeviceContext->DrawIndexed(pcmd->idx_count, idx_offset, vtx_offset);
|
||||
g_pd3dDeviceContext->DrawIndexed(pcmd->elem_count, idx_offset, vtx_offset);
|
||||
}
|
||||
idx_offset += pcmd->idx_count;
|
||||
idx_offset += pcmd->elem_count;
|
||||
}
|
||||
vtx_offset += (int)cmd_list->vtx_buffer.size();
|
||||
}
|
||||
|
@ -109,9 +109,9 @@ static void ImGui_ImplDX9_RenderDrawLists(ImDrawData* draw_data)
|
||||
const RECT r = { (LONG)pcmd->clip_rect.x, (LONG)pcmd->clip_rect.y, (LONG)pcmd->clip_rect.z, (LONG)pcmd->clip_rect.w };
|
||||
g_pd3dDevice->SetTexture( 0, (LPDIRECT3DTEXTURE9)pcmd->texture_id );
|
||||
g_pd3dDevice->SetScissorRect(&r);
|
||||
g_pd3dDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, vtx_offset, 0, (UINT)cmd_list->vtx_buffer.size(), idx_offset, pcmd->idx_count/3);
|
||||
g_pd3dDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, vtx_offset, 0, (UINT)cmd_list->vtx_buffer.size(), idx_offset, pcmd->elem_count/3);
|
||||
}
|
||||
idx_offset += pcmd->idx_count;
|
||||
idx_offset += pcmd->elem_count;
|
||||
}
|
||||
vtx_offset += (int)cmd_list->vtx_buffer.size();
|
||||
}
|
||||
|
@ -97,9 +97,9 @@ static void ImGui_ImplGlfwGL3_RenderDrawLists(ImDrawData* draw_data)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, (GLuint)(intptr_t)pcmd->texture_id);
|
||||
glScissor((int)pcmd->clip_rect.x, (int)(height - pcmd->clip_rect.w), (int)(pcmd->clip_rect.z - pcmd->clip_rect.x), (int)(pcmd->clip_rect.w - pcmd->clip_rect.y));
|
||||
glDrawElementsBaseVertex(GL_TRIANGLES, (GLsizei)pcmd->idx_count, GL_UNSIGNED_SHORT, idx_buffer, vtx_offset);
|
||||
glDrawElementsBaseVertex(GL_TRIANGLES, (GLsizei)pcmd->elem_count, GL_UNSIGNED_SHORT, idx_buffer, vtx_offset);
|
||||
}
|
||||
idx_buffer += pcmd->idx_count;
|
||||
idx_buffer += pcmd->elem_count;
|
||||
}
|
||||
vtx_offset += (int)cmd_list->vtx_buffer.size();
|
||||
}
|
||||
|
@ -73,9 +73,9 @@ static void ImGui_ImplGlfw_RenderDrawLists(ImDrawData* draw_data)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, (GLuint)(intptr_t)pcmd->texture_id);
|
||||
glScissor((int)pcmd->clip_rect.x, (int)(height - pcmd->clip_rect.w), (int)(pcmd->clip_rect.z - pcmd->clip_rect.x), (int)(pcmd->clip_rect.w - pcmd->clip_rect.y));
|
||||
glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->idx_count, GL_UNSIGNED_SHORT, idx_buffer);
|
||||
glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->elem_count, GL_UNSIGNED_SHORT, idx_buffer);
|
||||
}
|
||||
idx_buffer += pcmd->idx_count;
|
||||
idx_buffer += pcmd->elem_count;
|
||||
}
|
||||
}
|
||||
#undef OFFSETOF
|
||||
|
Reference in New Issue
Block a user