feat(main.c, input.c): Print important information to stdout

This commit is contained in:
PedroEdiaz
2025-05-11 17:30:29 -06:00
parent 605f4610ce
commit 177edb18b1
2 changed files with 26 additions and 3 deletions

View File

@@ -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");
}
*/

View File

@@ -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;