diff options
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 |