Branimir Karadžić vor 8 Jahren
Ursprung
Commit
e62ffe9984
1 geänderte Dateien mit 27 neuen und 0 gelöschten Zeilen
  1. 27 0
      examples/common/example-glue.cpp

+ 27 - 0
examples/common/example-glue.cpp

@@ -124,6 +124,33 @@ void showExampleDialog(entry::AppI* _app, const char* _errorText)
 		{
 			cmdExec("app restart");
 		}
+
+		num = caps->numGPUs;
+		if (0 != num)
+		{
+			current = 0;
+			for (uint8_t ii = 0; ii < num; ++ii)
+			{
+				const bgfx::Caps::GPU& gpu = caps->gpu[ii];
+
+				items[ii] = gpu.vendorId == BGFX_PCI_ID_AMD    ? "AMD"
+						  : gpu.vendorId == BGFX_PCI_ID_INTEL  ? "Intel"
+						  : gpu.vendorId == BGFX_PCI_ID_NVIDIA ? "nVidia"
+						  : "Unknown?"
+						  ;
+
+				if (caps->vendorId == gpu.vendorId
+				&&  caps->deviceId == gpu.deviceId)
+				{
+					current = ii;
+				}
+			}
+
+			if (ImGui::Combo("GPU", &current, items, num) )
+			{
+				cmdExec("app restart");
+			}
+		}
 	}
 #endif // 0