Wait for Multidimentional struct

This commit is contained in:
PedroEdiaz
2024-10-18 14:01:25 -06:00
parent 7c8cfcbfce
commit 0552616bf9
7 changed files with 48 additions and 14 deletions

View File

@@ -1,6 +1,7 @@
#include "main.h"
#include <cglm/quat.h>
#include <GLFW/glfw3.h>
#include <stdio.h>
#define ANGLE ((float)0x01/0xff*2*GLM_PI)
@@ -17,6 +18,17 @@ vec3 axis[3] =
{0, 0, 1},
};
void __key_callback(GLFWwindow * window, int key, int scancode, int action, int mods )
{
if( action != GLFW_PRESS)
return;
if( GLFW_KEY_0 <= key && key <= GLFW_KEY_9 )
{
printf("%d\n", key-GLFW_KEY_0 );
}
}
void __window_callback(GLFWwindow * window, int w, int h)
{
int m;
@@ -37,8 +49,8 @@ void __mouse_callback(GLFWwindow* window, int button, int action, int mods)
return;
glfwGetCursorPos(window, &xpos, &ypos);
glReadPixels((int)xpos, (int)(window_height - ypos), 1, 1, GL_GREEN, GL_UNSIGNED_BYTE, &green_value);
glReadPixels((int)xpos, (int)(window_height - ypos), 1, 1, GL_GREEN,
GL_UNSIGNED_BYTE, &green_value);
switch(green_value)
{