Initial commit.
This commit is contained in:
commit
cb0391ce80
56 changed files with 3485 additions and 0 deletions
43
Client/Graphics/Graphics.h
Normal file
43
Client/Graphics/Graphics.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#pragma once
|
||||
|
||||
#include <webgpu/webgpu.h>
|
||||
|
||||
#include <Shared.h>
|
||||
#include "../Client.h"
|
||||
#include "../Platform/Window.h"
|
||||
|
||||
namespace Artifact {
|
||||
|
||||
class Graphics;
|
||||
|
||||
class GraphicsSubsystem {
|
||||
public:
|
||||
Graphics * graphics;
|
||||
virtual void init() {}
|
||||
virtual void reload() {}
|
||||
virtual void deinit() {}
|
||||
virtual void render(WGPUTextureView nextTexture, WGPUCommandEncoder encoder) {}
|
||||
};
|
||||
|
||||
class Graphics: public ClientSubsystem, public Engine<GraphicsSubsystem> {
|
||||
public:
|
||||
WGPUInstance instance = nullptr;
|
||||
WGPUSurface surface = nullptr;
|
||||
WGPUAdapter adapter = nullptr;
|
||||
WGPUDevice device = nullptr;
|
||||
|
||||
WGPUTexture depthTexture = nullptr;
|
||||
WGPUTextureView depthTextureView = nullptr;
|
||||
WGPUQueue queue = nullptr;
|
||||
|
||||
WindowImpl * window;
|
||||
|
||||
void init() override;
|
||||
void deinit() override;
|
||||
void render() override;
|
||||
|
||||
WGPUTexture createTextureFromData(const void* data, uint32_t width, uint32_t height);
|
||||
WGPUTexture createTextureFromFile(const char* file);
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue