mirror of
https://github.com/enduro2d/enduro2d.git
synced 2026-03-22 04:44:09 +07:00
dummy camera system
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include "components/spine_player.hpp"
|
||||
#include "components/sprite_renderer.hpp"
|
||||
|
||||
#include "systems/camera_system.hpp"
|
||||
#include "systems/flipbook_system.hpp"
|
||||
#include "systems/frame_system.hpp"
|
||||
#include "systems/gizmos_system.hpp"
|
||||
|
||||
@@ -61,6 +61,7 @@ namespace e2d
|
||||
class spine_player;
|
||||
class sprite_renderer;
|
||||
|
||||
class camera_system;
|
||||
class flipbook_system;
|
||||
class frame_system;
|
||||
class gizmos_system;
|
||||
|
||||
26
headers/enduro2d/high/systems/camera_system.hpp
Normal file
26
headers/enduro2d/high/systems/camera_system.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
/*******************************************************************************
|
||||
* This file is part of the "Enduro2D"
|
||||
* For conditions of distribution and use, see copyright notice in LICENSE.md
|
||||
* Copyright (C) 2018-2019, by Matvey Cherevko (blackmatov@gmail.com)
|
||||
******************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "_systems.hpp"
|
||||
|
||||
namespace e2d
|
||||
{
|
||||
class camera_system final
|
||||
: public ecs::system<ecs::after<systems::update_event>> {
|
||||
public:
|
||||
camera_system();
|
||||
~camera_system() noexcept;
|
||||
|
||||
void process(
|
||||
ecs::registry& owner,
|
||||
const ecs::after<systems::update_event>& trigger) override;
|
||||
private:
|
||||
class internal_state;
|
||||
std::unique_ptr<internal_state> state_;
|
||||
};
|
||||
}
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <enduro2d/high/components/spine_player.hpp>
|
||||
#include <enduro2d/high/components/sprite_renderer.hpp>
|
||||
|
||||
#include <enduro2d/high/systems/camera_system.hpp>
|
||||
#include <enduro2d/high/systems/flipbook_system.hpp>
|
||||
#include <enduro2d/high/systems/frame_system.hpp>
|
||||
#include <enduro2d/high/systems/gizmos_system.hpp>
|
||||
@@ -55,6 +56,8 @@ namespace
|
||||
|
||||
bool initialize() final {
|
||||
ecs::registry_filler(the<world>().registry())
|
||||
.feature<struct camera_feature>(ecs::feature()
|
||||
.add_system<camera_system>())
|
||||
.feature<struct flipbook_feature>(ecs::feature()
|
||||
.add_system<flipbook_system>())
|
||||
.feature<struct frame_feature>(ecs::feature()
|
||||
|
||||
43
sources/enduro2d/high/systems/camera_system.cpp
Normal file
43
sources/enduro2d/high/systems/camera_system.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
/*******************************************************************************
|
||||
* This file is part of the "Enduro2D"
|
||||
* For conditions of distribution and use, see copyright notice in LICENSE.md
|
||||
* Copyright (C) 2018-2019, by Matvey Cherevko (blackmatov@gmail.com)
|
||||
******************************************************************************/
|
||||
|
||||
#include <enduro2d/high/systems/camera_system.hpp>
|
||||
|
||||
#include <enduro2d/high/components/camera.hpp>
|
||||
|
||||
namespace e2d
|
||||
{
|
||||
//
|
||||
// camera_system::internal_state
|
||||
//
|
||||
|
||||
class camera_system::internal_state final : private noncopyable {
|
||||
public:
|
||||
internal_state() = default;
|
||||
~internal_state() noexcept = default;
|
||||
|
||||
void process_update(ecs::registry& owner) {
|
||||
E2D_UNUSED(owner);
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
// camera_system
|
||||
//
|
||||
|
||||
camera_system::camera_system()
|
||||
: state_(new internal_state()) {}
|
||||
camera_system::~camera_system() noexcept = default;
|
||||
|
||||
void camera_system::process(
|
||||
ecs::registry& owner,
|
||||
const ecs::after<systems::update_event>& trigger)
|
||||
{
|
||||
E2D_UNUSED(trigger);
|
||||
E2D_PROFILER_SCOPE("camera_system.process_update");
|
||||
state_->process_update(owner);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user