rendering element rewrite
This commit is contained in:
parent
4c286e1fd8
commit
3d40256bde
22 changed files with 799 additions and 795 deletions
|
|
@ -45,7 +45,6 @@ import Crafter.Event;
|
|||
|
||||
export namespace Crafter {
|
||||
class Transform;
|
||||
class RenderingElement;
|
||||
class Window {
|
||||
public:
|
||||
std::int_fast32_t width;
|
||||
|
|
@ -76,7 +75,7 @@ export namespace Crafter {
|
|||
std::chrono::nanoseconds totalUpdate;
|
||||
std::vector<std::pair<const EventListener<FrameTime>*, std::chrono::nanoseconds>> updateTimings;
|
||||
std::chrono::nanoseconds totalRender;
|
||||
std::vector<std::tuple<const RenderingElement*, std::uint_fast32_t, std::uint_fast32_t, std::chrono::nanoseconds>> renderTimings;
|
||||
std::vector<std::tuple<const Transform*, std::uint_fast32_t, std::uint_fast32_t, std::chrono::nanoseconds>> renderTimings;
|
||||
std::chrono::nanoseconds vblank;
|
||||
std::chrono::nanoseconds totalFrame;
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> frameEnd;
|
||||
|
|
@ -87,13 +86,13 @@ export namespace Crafter {
|
|||
|
||||
class WindowKeyboard {
|
||||
public:
|
||||
bool heldkeys[255] = {};
|
||||
Event<void> onKeyDown[255];
|
||||
Event<void> onKeyHold[255];
|
||||
Event<void> onKeyUp[255];
|
||||
Event<char> onAnyKeyDown;
|
||||
Event<char> onAnyKeyHold;
|
||||
Event<char> onAnyKeyUp;
|
||||
bool heldkeys[static_cast<std::uint32_t>(CrafterKeys::CrafterKeysMax)] = {};
|
||||
Event<void> onKeyDown[static_cast<std::uint32_t>(CrafterKeys::CrafterKeysMax)];
|
||||
Event<void> onKeyHold[static_cast<std::uint32_t>(CrafterKeys::CrafterKeysMax)];
|
||||
Event<void> onKeyUp[static_cast<std::uint32_t>(CrafterKeys::CrafterKeysMax)];
|
||||
Event<CrafterKeys> onAnyKeyDown;
|
||||
Event<CrafterKeys> onAnyKeyHold;
|
||||
Event<CrafterKeys> onAnyKeyUp;
|
||||
};
|
||||
|
||||
class MouseElement;
|
||||
|
|
@ -138,7 +137,6 @@ export namespace Crafter {
|
|||
};
|
||||
|
||||
#ifdef CRAFTER_GRAPHICS_WAYLAND
|
||||
class RenderingElement;
|
||||
class WindowWayland final : public WindowKeyboard, public WindowMouse, public WindowFramebuffer, public WindowTitle {
|
||||
public:
|
||||
Pixel_BU8_GU8_RU8_AU8* framebuffer = nullptr;
|
||||
|
|
@ -162,6 +160,7 @@ export namespace Crafter {
|
|||
xkb_state* xkb_state;
|
||||
void RenderElement(Transform* transform);
|
||||
void Render() override;
|
||||
void QueueRender();
|
||||
void StartSync() override;
|
||||
void StartUpdate() override;
|
||||
void StopUpdate() override;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue