#pragma once #ifndef NAZARA_SHADERNODES_SHADERGRAPH_HPP #define NAZARA_SHADERNODES_SHADERGRAPH_HPP #include #include #include #include #include #include class ShaderGraph { public: struct TextureEntry; ShaderGraph(); ~ShaderGraph() = default; std::size_t AddTexture(std::string name, Nz::ShaderAst::ExpressionType type); inline QtNodes::FlowScene& GetScene(); inline const TextureEntry& GetTexture(std::size_t textureIndex) const; inline const std::vector& GetTextures(); Nz::ShaderAst::StatementPtr ToAst(); void UpdateTexturePreview(std::size_t texture, QImage preview); struct TextureEntry { std::string name; Nz::ShaderAst::ExpressionType type; QImage preview; }; NazaraSignal(OnTextureListUpdate, ShaderGraph*); NazaraSignal(OnTexturePreviewUpdate, ShaderGraph*, std::size_t /*textureIndex*/); private: std::shared_ptr BuildRegistry(); QtNodes::FlowScene m_flowScene; std::vector m_textures; }; #include #endif