Nebula
Loading...
Searching...
No Matches
frameplugin.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
9//------------------------------------------------------------------------------
10#include "frameop.h"
11#include "util/stringatom.h"
12#include <functional>
13namespace Frame
14{
15class FramePlugin : public FrameOp
16{
17public:
21 virtual ~FramePlugin();
22
24 {
25 void Run(const CoreGraphics::CmdBufferId cmdBuf, const IndexT frameIndex, const IndexT bufferIndex) override;
26 void Discard() override;
27
28#if NEBULA_GRAPHICS_DEBUG
30#endif
31
32 std::function<void(const CoreGraphics::CmdBufferId, IndexT, IndexT)> func;
33 };
34
36
37private:
38
39 void Build(const BuildContext& ctx) override;
40};
41
42
44extern void AddCallback(const Util::StringAtom name, std::function<void(const CoreGraphics::CmdBufferId, IndexT, IndexT)> func);
46extern const std::function<void(const CoreGraphics::CmdBufferId, IndexT, IndexT)>& GetCallback(const Util::StringAtom& str);
48extern void InitPluginTable();
49
51
52
53} // namespace Frame2
Definition frameop.h:32
Util::StringAtom name
Definition frameop.h:187
Definition frameplugin.h:16
virtual ~FramePlugin()
destructor
Definition frameplugin.cc:22
FramePlugin()
constructor
Definition frameplugin.cc:14
void Build(const BuildContext &ctx) override
build operation
Definition frameplugin.cc:64
FrameOp::Compiled * AllocCompiled(Memory::ArenaAllocator< BIG_CHUNK > &allocator) override
allocate instance of compiled
Definition frameplugin.cc:49
Allocates memory in chunks.
Definition arenaallocator.h:36
A collection of key/value pairs with quick value retrieval by key at roughly O(log n).
Definition dictionary.h:34
A StringAtom.
Definition stringatom.h:22
ImGUI debug interface for inspecting frame scripts.
Definition shaderserverbase.h:52
const std::function< void(const CoreGraphics::CmdBufferId, IndexT, IndexT)> & GetCallback(const Util::StringAtom &str)
get algorithm function call
Definition frameplugin.cc:91
Util::Dictionary< Util::StringAtom, std::function< void(const CoreGraphics::CmdBufferId, IndexT, IndexT)> > nameToFunction
Definition frameplugin.cc:85
void InitPluginTable()
initialize the plugin table
Definition frameplugin.cc:115
void AddCallback(const Util::StringAtom name, std::function< void(const CoreGraphics::CmdBufferId, IndexT, IndexT)> func)
add function callback to global dictionary
Definition frameplugin.cc:106
Definition commandbuffer.h:155
Definition frameop.h:162
Definition frameop.h:94
Definition frameplugin.h:24
std::function< void(const CoreGraphics::CmdBufferId, IndexT, IndexT)> func
Definition frameplugin.h:32
void Run(const CoreGraphics::CmdBufferId cmdBuf, const IndexT frameIndex, const IndexT bufferIndex) override
Run operation on a specific command buffer.
Definition frameplugin.cc:31
void Discard() override
Discard operation.
Definition frameplugin.cc:40
int IndexT
Definition types.h:48