Scopri come trovare la baby-sitter perfetta per i tuoi bambini con i consigli pratici di Ernesto.it. Analizziamo le migliori strategie per selezionare un professionista affidabile, garantendo sicurezza e serenità. Leggi il nostro articolo per suggerimenti utili e risorse preziose.
Trova professionisti vicino a te
Trova professionisti
#include
#include
#include
#include
#include
#include
#define GLM_FORCE_RADIANS
#include
#include
#include
#include "main.h"
bool cannon_keyboard_input = true;
bool drag_pan = false, old_cki;
double drag_oldx = -1, drag_oldy = -1;
using namespace std;
/* Executed when a regular key is pressed/released/held-down */
/* Prefered for Keyboard events */
void keyboard(GLFWwindow *window, int key, int scancode, int action, int mods) {
// Function is called first on GLFW_PRESS.
if (action == GLFW_RELEASE) {
// switch (key) {
// case GLFW_KEY_C:
// rectangle_rot_status = !rectangle_rot_status;
// break;
// case GLFW_KEY_P:
// triangle_rot_status = !triangle_rot_status;
// break;
// case GLFW_KEY_X:
//// do something ..
// break;
// default:
// break;
// }
} else if (action == GLFW_PRESS) {
switch (key) {
case GLFW_KEY_ESCAPE:
quit(window);
break;
default:
break;
}
}
}
/* Executed for character input (like in text boxes) */
void keyboardChar(GLFWwindow *window, unsigned int key) {
switch (key) {
case 'Q':
case 'q':
quit(window);
break;
default:
break;
}
}
/* Executed when a mouse button is pressed/released */
void mouseButton(GLFWwindow *window, int button, int action, int mods) {
switch (button) {
case GLFW_MOUSE_BUTTON_LEFT:
if (action == GLFW_PRESS) {
// Do something
return;
} else if (action == GLFW_RELEASE) {
// Do something
}
break;
// case GLFW_MOUSE_BUTTON_RIGHT:
// if (action == GLFW_RELEASE) {
// rectangle_rot_dir *= -1;
// }
// break;
default:
break;
}
}
void scroll_callback(GLFWwindow *window, double xoffset, double yoffset) {
if (yoffset == -1) {
// zoom out
} else if (yoffset == 1) {
// zoom in
}
}