update GUI codes.(WIP)
This commit is contained in:
parent
fd49c76b53
commit
f6cf9dc1b8
@ -36,7 +36,7 @@ namespace hgl
|
||||
class VBoxLayout:public LayoutBase
|
||||
{
|
||||
public:
|
||||
};//class VBoxLayout:public LayoutBase
|
||||
};//class VBoxLayout:public LayoutBase
|
||||
|
||||
/**
|
||||
* 水平分布布局器
|
||||
|
@ -29,6 +29,8 @@ namespace hgl
|
||||
|
||||
virtual ThemeForm *CreateForm(Form *,RenderTarget *,RenderCommand *)=0;
|
||||
|
||||
virtual bool Render(ThemeForm *);
|
||||
|
||||
public:
|
||||
|
||||
ThemeEngine(GPUDevice *dev){device=dev;}
|
||||
|
@ -37,6 +37,11 @@ namespace hgl
|
||||
|
||||
RectScope2f position; ///<所在位置
|
||||
|
||||
public:
|
||||
|
||||
Widget * GetParent (){return parent_widget;}
|
||||
ThemeEngine * GetThemeEngine (){return theme_engine;}
|
||||
|
||||
public:
|
||||
|
||||
const bool IsVisible ()const{return visible;}
|
||||
|
@ -22,5 +22,12 @@ namespace hgl
|
||||
{
|
||||
return(new DefaultThemeForm(f,rt,rc));
|
||||
}
|
||||
|
||||
void DefaultThemeEngine::DrawPanel(RenderCommand *rc,const RectScope2f &rs)
|
||||
{
|
||||
if(!rc)return;
|
||||
|
||||
|
||||
}
|
||||
}//namespace gui
|
||||
}//namespace hgl
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include<hgl/gui/ThemeEngine.h>
|
||||
#include<hgl/graph/VKMaterialInstance.h>
|
||||
#include<hgl/graph/VKPipeline.h>
|
||||
#include<hgl/type/Map.h>
|
||||
#include"DefaultThemeForm.h"
|
||||
|
||||
@ -14,10 +15,16 @@ namespace hgl
|
||||
class Form; ///<窗体
|
||||
|
||||
/**
|
||||
* 缺省GUI主题引擎
|
||||
*/
|
||||
* 缺省GUI主题引擎
|
||||
*/
|
||||
class DefaultThemeEngine:public ThemeEngine
|
||||
{
|
||||
struct
|
||||
{
|
||||
Material *material;
|
||||
Pipeline *pieline;
|
||||
}panel;
|
||||
|
||||
public:
|
||||
|
||||
using ThemeEngine::ThemeEngine;
|
||||
@ -25,8 +32,12 @@ namespace hgl
|
||||
|
||||
bool Init() override;
|
||||
void Clear() override;
|
||||
|
||||
|
||||
ThemeForm *CreateForm(Form *,RenderTarget *,RenderCommand *) override;
|
||||
|
||||
public:
|
||||
|
||||
void DrawPanel(RenderCommand *,const RectScope2f &);
|
||||
};//class DefaultThemeEngine:public ThemeEngine
|
||||
}//namespace gui
|
||||
}//namespace hgl
|
||||
|
@ -11,7 +11,7 @@ namespace hgl
|
||||
if(!cmd_buf->BeginRenderPass())
|
||||
return(false);
|
||||
|
||||
|
||||
|
||||
|
||||
cmd_buf->EndRenderPass();
|
||||
return(true);
|
||||
|
@ -106,6 +106,15 @@ namespace hgl
|
||||
return(true);
|
||||
}
|
||||
|
||||
bool ThemeEngine::Render(ThemeForm *tf)
|
||||
{
|
||||
tf->BeginRender();
|
||||
|
||||
tf->Render();
|
||||
|
||||
tf->EndRender();
|
||||
}
|
||||
|
||||
bool ThemeEngine::Render(Form *f)
|
||||
{
|
||||
if(!f)return(false);
|
||||
@ -119,11 +128,7 @@ namespace hgl
|
||||
if(!form_list.Get(f,tf))
|
||||
return(false);
|
||||
|
||||
tf->BeginRender();
|
||||
|
||||
tf->Render();
|
||||
|
||||
tf->EndRender();
|
||||
return Render(tf);
|
||||
}
|
||||
}//namespace gui
|
||||
}//namespace hgl
|
@ -68,4 +68,4 @@ RenderableInstance *CreateRenderableInstance(Renderable *r,MaterialInstance *mi,
|
||||
buffer_size.Discard();
|
||||
return ri;
|
||||
}
|
||||
VK_NAMESPACE_END
|
||||
VK_NAMESPACE_END
|
||||
|
Loading…
x
Reference in New Issue
Block a user