aboutsummaryrefslogtreecommitdiff
path: root/src/rendering/render_api.h
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-08-23 17:21:37 +0200
committerhachem <im@hachem.wtf>2026-08-23 17:21:37 +0200
commit3fd33ecff7472e4d6fc9e6b3905f56982e497ef2 (patch)
tree66e5812f1a18b926e88a0dd549fe14e7c7327165 /src/rendering/render_api.h
parente3aa33fc9a99d8b817bda42a567a4c347e18ab32 (diff)
[feat]: complete RHI api
Diffstat (limited to 'src/rendering/render_api.h')
-rw-r--r--src/rendering/render_api.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/rendering/render_api.h b/src/rendering/render_api.h
new file mode 100644
index 0000000..62742c9
--- /dev/null
+++ b/src/rendering/render_api.h
@@ -0,0 +1,25 @@
+#pragma once
+
+namespace Donut
+{
+ // Which graphics backend the app runs on, selected once at startup (from
+ // settings) before the window is created. The rendering itself goes through
+ // the RHI (rendering/rhi.h) and the shared renderers; this is only the
+ // backend selector the window + application branch on.
+ class RendererAPI
+ {
+ public:
+ enum class API
+ {
+ None = 0,
+ OpenGL = 1,
+ Vulkan = 2,
+ };
+
+ static auto get_api() -> API { return s_api; }
+ static auto set_api(API api) -> void { s_api = api; }
+
+ private:
+ inline static API s_api = API::None;
+ };
+}