diff --git a/src/main.cpp b/src/main.cpp index 5e21371..428d749 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1941,6 +1941,23 @@ int main(int argc, char **argv) { SDL_free(map_path); } + if (event.key.key == SDLK_F5) { + recreate_tile_textures(); + WGPUBindGroupEntry world_bind_group_entries[] = { + { .binding = 0, .textureView = tile_textures_array_view }, + { .binding = 1, .sampler = pixel_sampler }, + { .binding = 2, .buffer = tint_color_buffer, .offset = 0, .size = WGPU_WHOLE_SIZE }, + }; + + WGPUBindGroupDescriptor world_bind_group_descriptor = { + .label = { .data = "world_bind_group", .length = WGPU_STRLEN }, + .layout = wgpuRenderPipelineGetBindGroupLayout(world_render_pipeline, 1), + .entryCount = SDL_arraysize(world_bind_group_entries), + .entries = world_bind_group_entries, + }; + world_bind_group = wgpuDeviceCreateBindGroup(device, &world_bind_group_descriptor); + } + if (event.key.key == SDLK_R) { if (selected_tile != -1 && selected_rotation != -1) { if (modifiers & SDL_KMOD_SHIFT) {