linux-wallpaperengine/src/WallpaperEngine/Render/CObject.h
Alexis Maiquez c13d743022 Container access should happen through CContext
Textures now have a cache system that prevents loading them more than once

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-11-03 14:27:05 +01:00

37 lines
806 B
C++

#pragma once
#include <string>
#include "WallpaperEngine/Core/CObject.h"
#include "CScene.h"
namespace WallpaperEngine::Render
{
class CScene;
class CObject
{
public:
template<class T> const T* as () const { assert (is<T>()); return (const T*) this; }
template<class T> T* as () { assert (is<T>()); return (T*) this; }
template<class T> bool is () { return this->m_type == T::Type; }
virtual void render () = 0;
CScene* getScene () const;
const CContainer* getContainer () const;
const int getId () const;
protected:
CObject (CScene* scene, std::string type, Core::CObject *object);
~CObject ();
private:
std::string m_type;
CScene* m_scene;
Core::CObject* m_object;
};
}