1#include "EditorExtension.h"
3#include "ExtensionRegistry.h"
7#include "Renderer/IRenderer.h"
8#include "Renderer/RenderStateUpdater.h"
10#include "Commands/SparseBuildOctreeCommand.h"
11#include "Commands/AssetPipeCommand.h"
12#include "Commands/AssetStatsCommand.h"
13#include "Resources/ResourceStore.h"
15#include "EditorRenderTask.h"
26 editorTask.init(context->getDefaultView(), device);
33 editorTask.apply(renderingContext->taskContext);
50 const std::string resourceArchive =
"Cogs.Core.Extensions.Editor.zip";
52 bool resourceArchiveAdded =
false;
53 auto manifest = getResourceManifest(context);
54 for (
auto& item : manifest) {
55 if (item.find(resourceArchive) != std::string::npos) {
57 resourceArchiveAdded =
true;
61 if (!resourceArchiveAdded) {
65 context->
resourceStore->addSearchPath(
"../Extensions/Editor/Data/");
77 context->
engine->getEditor()->initialize();
85 delete renderExtension;
86 renderExtension =
nullptr;
93 }
const editorExtension;
A Context instance contains all the services, systems and runtime components needed to use Cogs.
class IRenderer * renderer
Renderer.
std::unique_ptr< class ResourceStore > resourceStore
ResourceStore service instance.
std::unique_ptr< class Engine > engine
Engine instance.
WireFrame Rendering task for Selected entity outline and extra cameras.
static void add(Extension *extension, StringView version)
Adds the given extension to the registry, ensuring the initialization methods are called at appropria...
Defines an extension to the renderer, capable of doing custom rendering.
virtual void registerExtension(IRendererExtension *extension)=0
Register an extension with the renderer.
virtual void unregisterExtension(IRendererExtension *extension)=0
Unregister an extension with the renderer.
Represents a graphics device used to manage graphics resources and issue drawing commands.
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
Contains reflection support.
void cleanup(Context *context) override
Cleanup context bound extension content.
bool initialize(Context *context) override
Initialize extension for the given context.
const char * getExtensionKey() const override
Get the extensions unique key, used to check for extension presence and retrieve extension specific d...
void initialize(Context *context, IGraphicsDevice *device) override
Initialize the extension using the given context and device.
void handleEvent(uint32_t eventId, const DrawContext *renderingContext) override
Called when rendering events occur.
Defines an extension to Cogs.Core and provides methods to override in order to initialize extension c...
@ RenderGui
Rendering GUI elements.