working heightmap shader?

This commit is contained in:
Jorijn van der Graaf 2025-05-25 23:04:56 +02:00
commit fe15d3e8ca
15 changed files with 331 additions and 76 deletions

View file

@ -26,10 +26,9 @@ module;
export module Crafter.Graphics:UiElement;
import Crafter.Event;
import :Types;
import Crafter.Component;
export namespace Crafter {
class UiElement : public Component {
class UiElement {
public:
Event<MouseMoveEvent> onMouseMove;
Event<MouseMoveEvent> onMouseEnter;
@ -54,12 +53,8 @@ export namespace Crafter {
float anchorOffsetX;
float anchorOffsetY;
std::vector<Pixel_RU8_GU8_BU8_AU8> buffer;
ComponentRef<UiElement> parent;
ComponentRefVectorOwning<UiElement> children;
std::vector<UiElement> children;
UiElement(float anchorX, float anchorY, std::uint32_t bufferWidth, std::uint32_t bufferHeight, std::uint32_t absoluteWidth, std::uint32_t absoluteHeight, float anchorOffsetX = 0.5, float anchorOffsetY = 0.5, float z = 0, bool ignoreScaling = false);
UiElement(float anchorX, float anchorY, std::uint32_t bufferWidth, std::uint32_t bufferHeight, std::uint32_t absoluteWidth, std::uint32_t absoluteHeight, UiElement* parent, float anchorOffsetX = 0.5, float anchorOffsetY = 0.5, float z = 0, bool ignoreScaling = false);
UiElement(float anchorX, float anchorY, std::uint32_t bufferWidth, std::uint32_t bufferHeight, float relativeWidth, float relativeHeight, float anchorOffsetX = 0.5, float anchorOffsetY = 0.5, float z = 0, bool ignoreScaling = false);
UiElement(float anchorX, float anchorY, std::uint32_t bufferWidth, std::uint32_t bufferHeight, float relativeWidth, float relativeHeight, UiElement* parent, float anchorOffsetX = 0.5, float anchorOffsetY = 0.5, float z = 0, bool ignoreScaling = false);
virtual ~UiElement() {};
};
}