准备定义PrimitiveComponent用于取代原本SceneNode中的Renderable数据
This commit is contained in:
parent
ab3f771455
commit
f0512edb5a
@ -4,8 +4,12 @@
|
|||||||
#include<hgl/type/SortedSet.h>
|
#include<hgl/type/SortedSet.h>
|
||||||
#include<hgl/type/List.h>
|
#include<hgl/type/List.h>
|
||||||
|
|
||||||
namespace hgl::graph
|
#define COMPONENT_NAMESPACE hgl::graph
|
||||||
{
|
#define COMPONENT_NAMESPACE_BEGIN namespace COMPONENT_NAMESPACE {
|
||||||
|
#define COMPONENT_NAMESPACE_END }
|
||||||
|
|
||||||
|
COMPONENT_NAMESPACE_BEGIN
|
||||||
|
|
||||||
class ComponentManager;
|
class ComponentManager;
|
||||||
class SceneNode;
|
class SceneNode;
|
||||||
|
|
||||||
@ -81,4 +85,5 @@ namespace hgl::graph
|
|||||||
virtual void OnFocusLost(){} ///<焦点丢失事件
|
virtual void OnFocusLost(){} ///<焦点丢失事件
|
||||||
virtual void OnFocusGained(){} ///<焦点获得事件
|
virtual void OnFocusGained(){} ///<焦点获得事件
|
||||||
};//class ComponentManager
|
};//class ComponentManager
|
||||||
}//namespace hgl::graph
|
|
||||||
|
COMPONENT_NAMESPACE_END
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include<hgl/component/RenderComponent.h>
|
||||||
|
#include<hgl/graph/VKRenderable.h>
|
||||||
|
|
||||||
|
COMPONENT_NAMESPACE_BEGIN
|
||||||
|
|
||||||
|
class PrimitiveComponent:public RenderComponent
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
PrimitiveComponent()=default;
|
||||||
|
virtual ~PrimitiveComponent()=default;
|
||||||
|
|
||||||
|
Renderable *GetRenderable();
|
||||||
|
};//class PrimitiveComponent
|
||||||
|
|
||||||
|
COMPONENT_NAMESPACE_END
|
@ -2,18 +2,17 @@
|
|||||||
|
|
||||||
#include<hgl/component/Component.h>
|
#include<hgl/component/Component.h>
|
||||||
|
|
||||||
namespace hgl::graph
|
COMPONENT_NAMESPACE_BEGIN
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 可渲染组件
|
||||||
|
*/
|
||||||
|
class RenderComponent: public Component
|
||||||
{
|
{
|
||||||
/**
|
public:
|
||||||
* 可渲染组件
|
|
||||||
*/
|
|
||||||
class RenderComponent: public Component
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
RenderComponent()=default;
|
RenderComponent()=default;
|
||||||
virtual ~RenderComponent()=default;
|
virtual ~RenderComponent()=default;
|
||||||
|
};//class RenderComponent
|
||||||
|
|
||||||
virtual void Render()=0;
|
COMPONENT_NAMESPACE_END
|
||||||
};//class RenderComponent
|
|
||||||
}//namespace hgl::graph
|
|
||||||
|
@ -63,6 +63,7 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 原始可渲染对象(即仅一个模型一个材质)
|
* 原始可渲染对象(即仅一个模型一个材质)
|
||||||
|
* 未来考虑改名StaticMesh哦!
|
||||||
*/
|
*/
|
||||||
class Renderable ///可渲染对象实例
|
class Renderable ///可渲染对象实例
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user