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 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"
|
||||||
|
|
||||||
@ -18,6 +19,12 @@ namespace hgl
|
|||||||
*/
|
*/
|
||||||
class DefaultThemeEngine:public ThemeEngine
|
class DefaultThemeEngine:public ThemeEngine
|
||||||
{
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
Material *material;
|
||||||
|
Pipeline *pieline;
|
||||||
|
}panel;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
using ThemeEngine::ThemeEngine;
|
using ThemeEngine::ThemeEngine;
|
||||||
@ -27,6 +34,10 @@ namespace hgl
|
|||||||
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
|
||||||
|
@ -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
|
Loading…
x
Reference in New Issue
Block a user