Update some things.

This commit is contained in:
Signal 2026-04-06 18:30:52 -04:00
parent f215bc3742
commit 4ad41f2e2e
34 changed files with 573 additions and 905 deletions

View file

@ -4,8 +4,9 @@
#include <GLFW/glfw3.h>
#include <webgpu/webgpu.h>
#include "Shared.h"
#include <Shared.h>
#include "Events.h"
#include "Client.h"
namespace Artifact {
@ -23,6 +24,8 @@ enum class Key {
DeleteForward, DeleteBackward,
ArrowLeft, ArrowRight, ArrowUp, ArrowDown,
Tab,
Last
};
namespace Events {
@ -72,7 +75,16 @@ struct MouseEvent {
}
class Window: public EventTarget, public BaseSubsystem {
class WindowImpl: public EventTarget, public ClientSubsystem {
public:
virtual bool shouldClose() = 0;
virtual WGPUSurface createWGPUSurface(WGPUInstance instance) = 0;
virtual void setPointerLock() = 0;
virtual void releasePointerLock() = 0;
virtual bool isKeyDown(Key key) = 0;
};
class Window: public WindowImpl {
private:
GLFWwindow * window = nullptr;
public:
@ -80,9 +92,12 @@ public:
void render() override;
WGPUSurface createWGPUSurface(WGPUInstance instance);
WGPUSurface createWGPUSurface(WGPUInstance instance) override;
void setTitle(std::string title);
bool shouldClose();
bool shouldClose() override;
void setPointerLock() override;
void releasePointerLock() override;
bool isKeyDown(Key key) override;
};
}