diff options
author | Elizabeth (Lizzy) Hunt <elizabeth.hunt@simponic.xyz> | 2023-11-28 14:47:29 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-28 14:47:29 -0700 |
commit | 4dcdd32bf7578acf3ea9bc1e98d39d82e3e1afdd (patch) | |
tree | 2d9eb3fbc17d453ee33e478bafb9936beff12eb3 /inc/scene.hpp | |
parent | ebc517c800a90f6f0ed157e5c3bd7c3bd18165b5 (diff) | |
parent | 3197f9e40cd7079e19990c64c98de667e2457d75 (diff) | |
download | gbarubik-4dcdd32bf7578acf3ea9bc1e98d39d82e3e1afdd.tar.gz gbarubik-4dcdd32bf7578acf3ea9bc1e98d39d82e3e1afdd.zip |
Cube
Diffstat (limited to 'inc/scene.hpp')
-rw-r--r-- | inc/scene.hpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/inc/scene.hpp b/inc/scene.hpp index f84bcd7..6dd4c35 100644 --- a/inc/scene.hpp +++ b/inc/scene.hpp @@ -1,20 +1,29 @@ -#ifndef CANVAS_HPP -#define CANVAS_HPP +#ifndef SCENE_HPP +#define SCENE_HPP -#include "mesh.hpp" +#include "model_instance.hpp" +#include "renderable.hpp" #include "vector.hpp" #include <cstdint> +#include <tonc.h> class Scene { -private: - usu::vector<Mesh> meshes; - std::uint32_t width; - std::uint32_t height; - public: - Scene(); + usu::vector<std::shared_ptr<Renderable>> renderables; + std::tuple<std::uint32_t, std::uint32_t> + viewport_dimension; // <width, height> + std::tuple<std::uint32_t, std::uint32_t> scene_dimension; + VECTOR directional_light; + FIXED z_plane; - void render(); + Scene(); + POINT project_2d(VECTOR vertex); + POINT viewport_to_scene(POINT p); + void draw_line(POINT p0, POINT p1, std::uint8_t pal_idx); + static inline void render(std::shared_ptr<Scene> scene_ctx) { + for (std::shared_ptr<Renderable> renderable : scene_ctx->renderables) + renderable->render(scene_ctx); + } }; #endif // SCENE_HPP |