summaryrefslogtreecommitdiff
path: root/src/gpu/effects/hybrid_3d_effect.h
blob: 1b0eab77cc4db030330c60ce4d5aff02354bf22a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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"
#include "gpu/texture_manager.h"

class Hybrid3DEffect : public Effect {
 public:
  Hybrid3DEffect(WGPUDevice device, WGPUQueue queue, WGPUTextureFormat format);
  virtual ~Hybrid3DEffect() override = default;

  void init(MainSequence* demo) override;
  void render(WGPURenderPassEncoder pass, float time, float beat, float intensity, float aspect_ratio) override;

 private:
  Renderer3D renderer_;
  TextureManager texture_manager_;
  Scene scene_;
  Camera camera_;
  int width_ = 1280;
  int height_ = 720;
};