Update some things.
This commit is contained in:
parent
f215bc3742
commit
f9d6e7a70a
35 changed files with 575 additions and 905 deletions
|
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue