316{
317 int searchLength = strlen(searchStr);
318 ImGui::Columns(4, NULL);
319 float width = ImGui::GetContentRegionAvail().x;
320
321 if(width <= 5)
322 {
323 width = 50;
324 }
325
326 ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(0.3f, 0.3f, 0.3f, 0.7f));
327
328 for(int i=0; i<textureStoreItems.size(); i++)
329 {
330 bool tmp = false;
332
333 if(searchLength == 0 || strcasestr(item.name.c_str(), searchStr) != NULL)
334 {
335 tmp = item.downloaded;
336
337
338 if(item.downloaded)
339 {
340 ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(0.5f, 0.5f, 0.5f, 0.7f));
341 }
342
343 ImGui::PushID(item.name.data());
344 ImGui::BeginChild("##texture_thumb", ImVec2(width, 300), true);
345 ImGui::Image((ImTextureID)item.texThumbnail->GetRendererID(), ImVec2(width, 150));
346 ImGui::Text(item.name.data());
347
348 if(!item.downloaded)
349 {
350 if(ImGui::Button("Download 1K"))
351 {
352 DownloadTexture(i, 1);
353 tmp = false;
354 }
355
356 if(ImGui::Button("Download 2K"))
357 {
358 DownloadTexture(i, 2);
359 tmp = false;
360 }
361
362 if(ImGui::Button("Download 4K"))
363 {
364 DownloadTexture(i, 4);
365 tmp = false;
366 }
367 }
368
369 else
370 {
371 static bool tmp = false;
372
373
374 TEXTURE_STORE_ITEM_DND("Albedo", abledo)
375 TEXTURE_STORE_ITEM_DND("Normal", normal)
376 TEXTURE_STORE_ITEM_DND("Metallic", metallic)
377 TEXTURE_STORE_ITEM_DND("Roughness", roughness)
378 TEXTURE_STORE_ITEM_DND("AO", ao)
379 TEXTURE_STORE_ITEM_DND("ARM", arm)
380
381
382 if(ImGui::Button("Delete"))
383 {
384 DeleteTexture(i);
385 }
386 }
387
388
389
390
391
392
393
394 ImGui::EndChild();
395 ImGui::PopID();
396
397 if(tmp)
398 {
399 ImGui::PopStyleColor();
400 }
401
402 ImGui::NextColumn();
403 }
404 }
405
406 ImGui::PopStyleColor();
407 ImGui::Columns(1);
408}