update GUI codes.(WIP)
This commit is contained in:
parent
fd49c76b53
commit
f6cf9dc1b8
@ -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"
|
||||
|
||||
@ -18,6 +19,12 @@ namespace hgl
|
||||
*/
|
||||
class DefaultThemeEngine:public ThemeEngine
|
||||
{
|
||||
struct
|
||||
{
|
||||
Material *material;
|
||||
Pipeline *pieline;
|
||||
}panel;
|
||||
|
||||
public:
|
||||
|
||||
using ThemeEngine::ThemeEngine;
|
||||
@ -27,6 +34,10 @@ namespace hgl
|
||||
void Clear() override;
|
||||
|
||||
ThemeForm *CreateForm(Form *,RenderTarget *,RenderCommand *) override;
|
||||
|
||||
public:
|
||||
|
||||
void DrawPanel(RenderCommand *,const RectScope2f &);
|
||||
};//class DefaultThemeEngine:public ThemeEngine
|
||||
}//namespace gui
|
||||
}//namespace hgl
|
||||
|
@ -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
|
Loading…
x
Reference in New Issue
Block a user