gbarubik/inc/scene.hpp

30 lines
770 B
C++
Raw Normal View History

2023-11-25 19:05:01 -05:00
#ifndef SCENE_HPP
#define SCENE_HPP
2023-11-24 20:19:42 -05:00
2023-11-25 19:05:01 -05:00
#include "model_instance.hpp"
2023-11-26 18:09:41 -05:00
#include "renderable.hpp"
2023-11-24 20:19:42 -05:00
#include "vector.hpp"
#include <cstdint>
2023-11-25 19:05:01 -05:00
#include <tonc.h>
2023-11-24 20:19:42 -05:00
class Scene {
public:
2023-11-26 18:09:41 -05:00
usu::vector<std::shared_ptr<Renderable>> renderables;
2023-11-28 15:58:18 -05:00
std::tuple<std::uint32_t, std::uint32_t>
2023-11-25 19:05:01 -05:00
viewport_dimension; // <width, height>
2023-11-28 15:58:18 -05:00
std::tuple<std::uint32_t, std::uint32_t> scene_dimension;
2023-11-25 19:05:01 -05:00
VECTOR directional_light;
FIXED z_plane;
2023-11-24 20:19:42 -05:00
2023-11-25 19:05:01 -05:00
Scene();
POINT project_2d(VECTOR vertex);
2023-11-26 18:09:41 -05:00
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);
}
2023-11-24 20:19:42 -05:00
};
#endif // SCENE_HPP