summaryrefslogtreecommitdiff
path: root/inc/scene.hpp
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-11-26 16:09:41 -0700
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-11-26 16:09:41 -0700
commitdbccd866229a4b06d10fbafc3eb3343015caedba (patch)
treebffb0d36f48d5c1defd877fdbebd58a1b7eb7fde /inc/scene.hpp
parentf4a7739a40c095e0c837d78d00f13a1ef47d3a11 (diff)
downloadgbarubik-dbccd866229a4b06d10fbafc3eb3343015caedba.tar.gz
gbarubik-dbccd866229a4b06d10fbafc3eb3343015caedba.zip
checkpoint
Diffstat (limited to 'inc/scene.hpp')
-rw-r--r--inc/scene.hpp10
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