180ddc3586
* renderer updates: material shadertype, customshaders * custom shader updates * hologram fix * editor windows refactor * major gui update: - gui no longer lifetime manager - window no longer needs gui to construct - removed gui constructors/destructors - rewritten every editor window * renderer update * gui hasfocus fix * editor fix * renderpath upgrades: hybrid forward-deferred * fix * water ripple refactor * cmake fix * cmake fix * renderer fix * volumetric light fix * customshader stencilref * cmake fix * rtdeferred fix * editor update * raytraced shadows denoise * anisotropic shader * sss stencil greater * added cartoon shader * using precomputed tangents * added unlit object shader * importer update * editor update * editor fix * vulkan envmap rendering fix * terrain shader simplification (normal texture mapping instead of triplanar) * added subsurface profiles, reduced gbuffer * denoise disocclusion fallback * editor fix * more sorting priority for blend than instancing * hairparticle culling * particle updates; font update instancing instead of index buffer; vulkan/dx12 fixes; * shader fixes * hairparticle trianglestrip and no cross section * editor fix * cam wnd update * terrain shader fix
64 lines
1.4 KiB
C++
64 lines
1.4 KiB
C++
#pragma once
|
|
#include "CommonInclude.h"
|
|
#include "wiGraphicsDevice.h"
|
|
#include "wiScene.h"
|
|
|
|
#include <list>
|
|
|
|
class wiWidget;
|
|
|
|
class wiGUIElement : public wiScene::TransformComponent
|
|
{
|
|
protected:
|
|
void ApplyScissor(const wiGraphics::Rect rect, wiGraphics::CommandList cmd, bool constrain_to_parent = true) const;
|
|
public:
|
|
wiGraphics::Rect scissorRect;
|
|
|
|
wiGUIElement* parent = nullptr;
|
|
void AttachTo(wiGUIElement* parent);
|
|
void Detach();
|
|
};
|
|
|
|
class wiGUI : public wiGUIElement
|
|
{
|
|
friend class wiWidget;
|
|
private:
|
|
std::list<wiWidget*> widgets;
|
|
std::vector<wiWidget*> priorityChangeQueue;
|
|
wiWidget* activeWidget = nullptr;
|
|
bool focus = false;
|
|
bool visible = true;
|
|
XMFLOAT2 pointerpos = XMFLOAT2(0, 0);
|
|
Hitbox2D pointerhitbox;
|
|
public:
|
|
|
|
void Update(float dt);
|
|
void Render(wiGraphics::CommandList cmd) const;
|
|
|
|
void AddWidget(wiWidget* widget);
|
|
void RemoveWidget(wiWidget* widget);
|
|
wiWidget* GetWidget(const std::string& name);
|
|
|
|
void ActivateWidget(wiWidget* widget);
|
|
void DeactivateWidget(wiWidget* widget);
|
|
const wiWidget* GetActiveWidget() const;
|
|
// true if another widget is currently active
|
|
bool IsWidgetDisabled(wiWidget* widget);
|
|
|
|
// returns true if any gui element has the focus
|
|
bool HasFocus();
|
|
|
|
void SetVisible(bool value) { visible = value; }
|
|
bool IsVisible() { return visible; }
|
|
|
|
const XMFLOAT2& GetPointerPos() const
|
|
{
|
|
return pointerpos;
|
|
}
|
|
const Hitbox2D& GetPointerHitbox() const
|
|
{
|
|
return pointerhitbox;
|
|
}
|
|
};
|
|
|