Cogs.Core
VideoCaptureSystem.h
1#pragma once
2#include "VideoCaptureComponent.h"
3#include "Systems/ComponentSystem.h"
4
5namespace Cogs::Core
6{
8 {
9 struct IVideoEncoder* encoder = nullptr;
10 int64_t nextEncodeTime = 0;
11 int64_t nextRestartTime = 0;
12 };
13
14 class VideoCaptureSystem : public ComponentSystemWithDataPool<VideoCaptureComponent, VideoCaptureData>
15 {
16 public:
17 void initialize(Context * context) override;
18 void cleanup(Context * context) override;
19
20 VideoCaptureSystem(Memory::Allocator * allocator, SizeType capacity) : ComponentSystemWithDataPool(allocator, capacity) {}
21
22 void preUpdate(Context * context) override;
23 void update(Context * context) override;
24 void postRender(Context * context);
25
26 void destroyComponent(ComponentHandle component) override;
27
28 class VideoCaptureRenderer *renderer = nullptr;
29 };
30}// namespace ...
Context * context
Pointer to the Context instance the system lives in.
void update()
Updates the system state to that of the current frame.
void preUpdate()
Run the pre-update method of the system.
Component system with parallel data per component stored in a pool similar to how the components them...
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
void destroyComponent(ComponentHandle component) override
void initialize(Context *context) override
Initialize the system.
void cleanup(Context *context) override
Provided for custom cleanup logic in derived systems.
Base allocator implementation.
Definition: Allocator.h:30
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
ComponentIndex SizeType
Type used to track the size of pools.
Definition: Component.h:19
Handle to a Component instance.
Definition: Component.h:67