]> git.lizzy.rs Git - dragonblocks_alpha.git/commitdiff
Add keybind to get mapblock
authorElias Fleckenstein <eliasfleckenstein@web.de>
Sat, 27 Mar 2021 20:14:43 +0000 (21:14 +0100)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Sat, 27 Mar 2021 20:14:43 +0000 (21:14 +0100)
src/client.c

index a25cbedf169b7c9d46a51f0aa054146642f12748..557ba041788dce35a906ea367083348312242b14 100644 (file)
@@ -75,6 +75,8 @@ static void client_loop()
                return;
        }
 
+       glfwSetInputMode(window, GLFW_STICKY_KEYS, GL_TRUE);
+
        const char *shader_path;
 
 #ifdef RELEASE
@@ -102,6 +104,12 @@ static void client_loop()
                glClear(GL_COLOR_BUFFER_BIT);
                glClearColor(0.52941176470588f, 0.8078431372549f, 0.92156862745098f, 1.0f);
 
+               if (glfwGetKey(window, GLFW_KEY_E) == GLFW_PRESS) {
+                       pthread_mutex_lock(&client.mtx);
+                       (void) (write_u32(client.fd, SC_GETBLOCK) && write_v3s32(client.fd, (v3s32) {0, 0, 0}));
+                       pthread_mutex_unlock(&client.mtx);
+               };
+
                scene_render(client.scene, prog);
 
                glfwSwapBuffers(window);