diff options
Diffstat (limited to 'inc/scene.hpp')
-rw-r--r-- | inc/scene.hpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/inc/scene.hpp b/inc/scene.hpp index 8e286db..05cdac0 100644 --- a/inc/scene.hpp +++ b/inc/scene.hpp @@ -2,13 +2,14 @@ #define SCENE_HPP #include "model_instance.hpp" +#include "renderable.hpp" #include "vector.hpp" #include <cstdint> #include <tonc.h> class Scene { public: - usu::vector<Renderable> renderables; + usu::vector<std::shared_ptr<Renderable>> renderables; std::tuple<std::uint16_t, std::uint16_t> viewport_dimension; // <width, height> std::tuple<std::uint16_t, std::uint16_t> scene_dimension; @@ -16,8 +17,13 @@ public: FIXED z_plane; Scene(); - void render(); 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 |