rt64/examples/rhi_test.cpp

22 lines
667 B
C++
Raw Normal View History

2024-01-20 14:14:50 +00:00
#include "rhi/rt64_render_interface.h"
namespace RT64 {
extern std::unique_ptr<RenderInterface> CreateD3D12Interface();
extern std::unique_ptr<RenderInterface> CreateVulkanInterface();
}
int main(int argc, char** argv) {
std::unique_ptr<RT64::RenderInterface> renderInterface = RT64::CreateVulkanInterface();
2024-01-20 14:14:50 +00:00
#ifdef _WIN32
// Windows only: Can also use D3D12.
2024-01-20 14:14:50 +00:00
const bool useVulkan = true;
if (!useVulkan) {
2024-01-20 14:14:50 +00:00
renderInterface = RT64::CreateD3D12Interface();
}
#endif
2024-01-20 14:14:50 +00:00
// Execute a blocking test that creates a window and draws some geometry to test the render interface.
RT64::RenderInterfaceTest(renderInterface.get());
}