diff options
Diffstat (limited to 'src/gpu/gpu.cc')
| -rw-r--r-- | src/gpu/gpu.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gpu/gpu.cc b/src/gpu/gpu.cc index 7b8e012..5537433 100644 --- a/src/gpu/gpu.cc +++ b/src/gpu/gpu.cc @@ -367,6 +367,7 @@ void gpu_init(PlatformState* platform_state) { g_config.usage = WGPUTextureUsage_RenderAttachment; g_config.width = platform_state->width; g_config.height = platform_state->height; + printf("WebGPU Init: %dx%d\n", g_config.width, g_config.height); g_config.presentMode = WGPUPresentMode_Fifo; g_config.alphaMode = WGPUCompositeAlphaMode_Opaque; wgpuSurfaceConfigure(g_surface, &g_config); @@ -381,6 +382,15 @@ void gpu_draw(float audio_peak, float aspect_ratio, float time, float beat) { g_main_sequence.render_frame(time, beat, audio_peak, aspect_ratio, g_surface); } +void gpu_resize(int width, int height) { + if (width <= 0 || height <= 0) + return; + g_config.width = width; + g_config.height = height; + wgpuSurfaceConfigure(g_surface, &g_config); + g_main_sequence.resize(width, height); +} + #if !defined(STRIP_ALL) void gpu_simulate_until(float time) { g_main_sequence.simulate_until(time, 1.0f / 60.0f); |
