Initial commit.
This commit is contained in:
commit
cb0391ce80
56 changed files with 3485 additions and 0 deletions
46
Client/Graphics/UIRenderer.h
Normal file
46
Client/Graphics/UIRenderer.h
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
#pragma once
|
||||
|
||||
#define NK_INCLUDE_FIXED_TYPES
|
||||
#define NK_INCLUDE_STANDARD_IO
|
||||
#define NK_INCLUDE_STANDARD_VARARGS
|
||||
#define NK_INCLUDE_DEFAULT_ALLOCATOR
|
||||
#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT
|
||||
#define NK_INCLUDE_FONT_BAKING
|
||||
#define NK_INCLUDE_DEFAULT_FONT
|
||||
#include <nuklear.h>
|
||||
#include <webgpu/webgpu.h>
|
||||
|
||||
#include <Shared.h>
|
||||
#include "Graphics.h"
|
||||
#include "../Platform/Window.h"
|
||||
|
||||
namespace Artifact {
|
||||
|
||||
class UIRenderer: public GraphicsSubsystem, public EventTarget {
|
||||
nk_context ctx {};
|
||||
nk_font_atlas atlas {};
|
||||
|
||||
WGPURenderPipeline pipeline = nullptr;
|
||||
|
||||
WGPUBuffer vertexBuffer = nullptr;
|
||||
WGPUBuffer indexBuffer = nullptr;
|
||||
WGPUBuffer uniformBuffer = nullptr;
|
||||
WGPUSampler sampler = nullptr;
|
||||
WGPUBindGroupLayout bgl = nullptr;
|
||||
WGPUTexture fontTexture = nullptr;
|
||||
WGPUTextureView fontTextureView = nullptr;
|
||||
WGPUTexture dummyTexture = nullptr;
|
||||
WGPUTextureView dummyTextureView = nullptr;
|
||||
|
||||
nk_buffer vertexBufferNK;
|
||||
nk_buffer indexBufferNK;
|
||||
nk_buffer commandBufferNK;
|
||||
|
||||
void init() override;
|
||||
void reload() override;
|
||||
void render(WGPUTextureView nextTexture, WGPUCommandEncoder encoder) override;
|
||||
|
||||
WGPURenderPipeline makePipeline();
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue