Added IRenderable, removed shader programs and allow more nuanced control of render passes, UI items are now rendered same as other scene item components.
This commit is contained in:
20
src/dawn/scene/components/display/IRenderable.hpp
Normal file
20
src/dawn/scene/components/display/IRenderable.hpp
Normal file
@ -0,0 +1,20 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "display/shader/Shader.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class IRenderable {
|
||||
public:
|
||||
/**
|
||||
* Returns the render passes for this renderable item, typically a scene
|
||||
* item component, e.g. a Material or a UI Item.
|
||||
*
|
||||
* @return Array of renderable passes.
|
||||
*/
|
||||
virtual std::vector<struct ShaderPassItem> getRenderPasses() = 0;
|
||||
};
|
||||
}
|
@ -6,9 +6,10 @@
|
||||
#pragma once
|
||||
#include "scene/SceneItemComponent.hpp"
|
||||
#include "display/shader/ShaderManager.hpp"
|
||||
#include "scene/components/display/IRenderable.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class Material : public SceneItemComponent {
|
||||
class Material : public SceneItemComponent, public IRenderable {
|
||||
public:
|
||||
/**
|
||||
* Material component constructor.
|
||||
@ -16,12 +17,5 @@ namespace Dawn {
|
||||
* @param item Scene Item this component belongs to.
|
||||
*/
|
||||
Material(SceneItem *item);
|
||||
|
||||
/**
|
||||
* Returns the shader that this material uses.
|
||||
*
|
||||
* @return Shader that belongs to this material.
|
||||
*/
|
||||
virtual Shader * getShader() = 0;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user