summaryrefslogtreecommitdiff
path: root/src/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/effects/hybrid_3d_effect.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/gpu/effects/hybrid_3d_effect.h b/src/gpu/effects/hybrid_3d_effect.h
new file mode 100644
index 0000000..a0a82b5
--- /dev/null
+++ b/src/gpu/effects/hybrid_3d_effect.h
@@ -0,0 +1,27 @@
+// This file is part of the 64k demo project.
+// It defines the Hybrid3DEffect, integrating the 3D renderer into the demo timeline.
+
+#pragma once
+
+#include "gpu/effect.h"
+#include "3d/renderer.h"
+#include "3d/scene.h"
+#include "3d/camera.h"
+
+class Hybrid3DEffect : public Effect {
+ public:
+ Hybrid3DEffect();
+ virtual ~Hybrid3DEffect() override = default;
+
+ void init(WGPUDevice device, WGPUQueue queue, int width, int height) override;
+ void render(WGPURenderPassEncoder pass, float time, float beat, float alpha) override;
+
+ private:
+ Renderer3D renderer_;
+ Scene scene_;
+ Camera camera_;
+ WGPUDevice device_ = nullptr;
+ WGPUQueue queue_ = nullptr;
+ int width_ = 0;
+ int height_ = 0;
+};