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:
2023-05-29 15:52:08 -07:00
parent d6625ba094
commit cdc0c03dd3
30 changed files with 419 additions and 600 deletions

View 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;
};
}

View File

@ -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;
};
}