摄像机系统,和子对象绑定
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user