摄像机系统,和子对象绑定

This commit is contained in:
ArchZer0
2026-08-17 16:15:05 +08:00
parent 63d97f058a
commit 7b7756f0fe
20 changed files with 744 additions and 132 deletions
+7
View File
@@ -13,6 +13,10 @@
#include <actor.hpp>
namespace boundard {
class Camera;
}
namespace boundard::render {
struct InputEvent {
@@ -51,6 +55,7 @@ class Renderer {
void init(int width, int height, const char* title);
void draw(const Actor* const* actors, size_t actor_count);
void draw(const Actor* const* actors, size_t actor_count, const Camera* camera);
bool should_close() const;
void poll_events() const;
@@ -119,6 +124,7 @@ class RenderLoop {
void stop();
void set_actors(std::vector<Actor*> actors);
void set_camera(Camera* camera);
void poll_events() const;
bool should_close() const;
@@ -134,6 +140,7 @@ class RenderLoop {
std::atomic<bool> running_{false};
mutable std::mutex actors_mutex_;
std::vector<Actor*> actors_;
Camera* camera_ = nullptr;
};
} // namespace boundard::render