Refactor ImTextureID casting for SDL_Texture rendering

This commit is contained in:
scawful
2024-10-09 01:59:15 -04:00
parent 0b1387bb49
commit e8e6ab00bf
7 changed files with 45 additions and 44 deletions

View File

@@ -229,9 +229,10 @@ void GfxSheetAssetBrowser::Draw(
if (display_label) {
ImU32 label_col = GetColorU32(
item_is_selected ? ImGuiCol_Text : ImGuiCol_TextDisabled);
draw_list->AddImage((void*)bmp_manager[item_data->ID].texture(),
box_min, box_max, ImVec2(0, 0), ImVec2(1, 1),
GetColorU32(ImVec4(1, 1, 1, 1)));
draw_list->AddImage(
(ImTextureID)(intptr_t)bmp_manager[item_data->ID].texture(),
box_min, box_max, ImVec2(0, 0), ImVec2(1, 1),
GetColorU32(ImVec4(1, 1, 1, 1)));
draw_list->AddText(ImVec2(box_min.x, box_max.y - GetFontSize()),
label_col,
absl::StrFormat("%X", item_data->ID).c_str());