Skip to content

File Context.h

File List > editor > Context.h

Go to the documentation of this file

#pragma once

#include "ID.h"
#include "SelectionManager.h"
#include "Events.h"
#include "RenderConfigs.h"

class SceneContext
{
public:
    UID* active_scene{ nullptr }; 

    void UseScene(UID* scene) { active_scene = scene; };

    /* Read-only accessors */

    const ObjectID* GetActiveCamera() const;

    const ObjectID* GetActiveEnvironment() const;

    const ObjectID* GetPPS(int _tar) const;

    const std::vector<const ObjectID*> GetObjectIDs() const;
};

class EditorContext
{
public:
    SelectionManager<ObjectID> selections; 
};

class RenderContext
{
private:
    RenderConfigs* config{ nullptr }; 

public:
    RenderConfigs* GetConfig() const { return config; }
    void UseConfig(RenderConfigs* _config) { config = _config; };
};

class Context {
public:
    SceneContext scene{};   
    EditorContext editor{}; 
    RenderContext render{}; 

public:
    explicit Context(EventPool& pool);

    Context(const Context&) = delete;
    Context& operator=(const Context&) = delete;
};