/* process keyboard input. receives key and mouse position */ void processNormalInput(unsigned char key, int x, int y) { // esc key code if (key == ESC_KEY_CODE) { exit(0); } /* change camera mode */ if (key == 'c') { camera.change_mode(); } /* add new boid to flock */ if (key == 'a') { bflock.add_new_boid(); } /* remove boid from flock */ if (key == 'r') { bflock.remove_boid(); } /* camera zoom-in, zoom-out */ if (key == 'q') { camera.zoom(ZOOM_OUT); } if (key == 'e') { camera.zoom(ZOOM_IN); } /* activate debug mode */ if (key == 'd') { debug = (debug + 1) % 2; nextFrame = true; } /* start simulation */ if (key == 's') { started = true; } /* advance frame */ if (key == 'n') { nextFrame = true; } /* enable-disable fog */ if (key == 'f') { if (fog_enabled) { disable_fog(); fog_enabled = false; } else { enable_fog(); fog_enabled = true; } } }
void glstav_reset(void) { int i; glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &glstav_multitext_units); glstav_bump_mapping = TRUE; glstav_cull = FALSE; glstav_cull_mod = K_CHYBA; cull_on(); cull_back(); glstav_lighting = TRUE; light_on_off(FALSE); glstav_specular = TRUE; specular_off(); glstav_diffuse = FALSE; glstav_mlha = TRUE; glstav_mlha_causal = FALSE; disable_fog(); glstav_blending = TRUE; blend_off(); glstav_deph_test = FALSE; deph_test_set(TRUE); glstav_alfa_test = TRUE; alfa_test_off(); glAlphaFunc(GL_GREATER, 0.5f); glstav_zmask = FALSE; zmask_set(TRUE); glstav_array_diffuse = FALSE; glstav_array_specular = FALSE; glstav_array_normal = FALSE; for (i = 0; i < 6; i++) { glstav_genenv_s[i] = FALSE; glstav_genenv_t[i] = FALSE; glstav_genenv_r[i] = FALSE; glstav_genenv_q[i] = FALSE; glstav_text_blok[i] = K_CHYBA; glstav_textury_1d[i] = FALSE; glstav_textury_2d[i] = FALSE; glstav_last_text_1d[i] = FALSE; glstav_last_text_2d[i] = FALSE; glstav_text_array[i] = FALSE; glstav_text_map_indicie[i] = FALSE; } glstav_alfa_blok = K_CHYBA; glstav_text_array_akt = K_CHYBA; glstav_text_poly_indicie = K_CHYBA; glstav_text_akt = K_CHYBA; glstav_text_akt_client = FALSE; glstav_pn_triangles = FALSE; }