get the list of graphics adapters that have been registered with the engine * * @name graphics.get_engine_adapters * @return adapters [type:table] array of adapter family name strings (e.g. "opengl", "vulkan", "webgpu") */
| 731 | * @return adapters [type:table] array of adapter family name strings (e.g. "opengl", "vulkan", "webgpu") |
| 732 | */ |
| 733 | static int Graphics_GetEngineAdapters(lua_State* L) |
| 734 | { |
| 735 | DM_LUA_STACK_CHECK(L, 1); |
| 736 | |
| 737 | uint32_t num_adapters = dmGraphics::GetRegisteredAdaptersCount(); |
| 738 | lua_createtable(L, (int) num_adapters, 0); |
| 739 | |
| 740 | for (uint32_t i = 0; i < num_adapters; ++i) |
| 741 | { |
| 742 | dmGraphics::HGraphicsAdapter adapter = dmGraphics::GetRegisteredAdapter(i); |
| 743 | dmGraphics::AdapterFamily adapter_family = dmGraphics::GetAdapterFamily(adapter); |
| 744 | |
| 745 | lua_pushstring(L, AdapterFamilyToName(adapter_family)); |
| 746 | lua_rawseti(L, -2, (int) i + 1); |
| 747 | } |
| 748 | |
| 749 | return 1; |
| 750 | } |
| 751 | |
| 752 | /*# get information about the currently installed graphics adapter |
| 753 | * |
nothing calls this directly
no test coverage detected