mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-07-16 14:22:24 +08:00

Textures now have a cache system that prevents loading them more than once Signed-off-by: Alexis Maiquez <almamu@almamu.com>
37 lines
806 B
C++
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;
|
|
};
|
|
} |