From 177edb18b1c93707542fe54780e7c0b82a8eabb7 Mon Sep 17 00:00:00 2001 From: PedroEdiaz Date: Sun, 11 May 2025 17:30:29 -0600 Subject: [PATCH] feat(main.c, input.c): Print important information to stdout --- src/input.c | 7 ++++--- src/main.c | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/input.c b/src/input.c index 3ffe263..c70afdc 100644 --- a/src/input.c +++ b/src/input.c @@ -60,7 +60,7 @@ void __key_callback_input( if (selected_coord == projection.z) return; - selected_coord = projection.w; + projection.w = selected_coord; } if (projection.w >= projection.m) @@ -88,8 +88,11 @@ void __key_callback_input( projection.z = tmp; animate_index = 3; break; + default: + return; } + printf("[AXIS] (X,Y,Z,W) = (%d,%d,%d,%d)\n", projection.x, projection.y, projection.z, projection.w); return; } @@ -232,8 +235,6 @@ end: if (0) { printf("QUAT: %2.5f %2.5f %2.5f %2.5f\n", q[0], q[1], q[2], q[3]); - printf("PROY: %3d %3d %3d (%3d)\n", projection.x, projection.y, - projection.z, projection.w); printf("\n"); } */ diff --git a/src/main.c b/src/main.c index 224a7f0..e0248e8 100644 --- a/src/main.c +++ b/src/main.c @@ -18,6 +18,24 @@ struct projection projection = {.x = 0, .y = 1, .z = 2, .w = 3, .mesh = NULL}; const char *wname = "manigraph: manifold grapher"; +const char *input_map = + "\n" + "DRAG AND DROP: Graph a klein file from the file system\n" + "LEFT-CLICK: Rotate surface on DRAG direction\n" + "SCROLL: Rotate surface on SCROLL direction\n" + "\n" + "W,S: Rotate sufrace on X axis\n" + "A,D: Rotate sufrace on Y axis\n" + "Q,E: Rotate sufrace on Z axis\n" + "LEFT-RIGHT: Rotate sufrace Horizontally\n" + "UP-DOWN: Rotate sufrace Vetrically\n" + "\n" + "Z: Rotate W axis to X axis\n" + "X: Rotate W axis to Y axis\n" + "C: Rotate W axis to Z axis\n" + "1-9: Rotate n axis to W axis\n" + "\n" +; unsigned char color[4] = {0x2F, 0x3C, 0x7E, 0xff}; @@ -129,7 +147,11 @@ int main(void) fix_matrix_load(shader_plain, (float)WIDTH / HEIGHT); } + mlog("[INPUTS] Imprimiendo...\n"); + printf(input_map); + mlog("[MAIN LOOP] Inicializando...\n"); + #ifdef EMSCRIPTEN emscripten_set_main_loop(&main_loop, 60, 1); return 0;