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