private static void OnKeyboardUp(byte key, int x, int y) { if (key == 'l') { lighting = !lighting; } else if (key == 'f') { fullscreen = !fullscreen; if (fullscreen) { Glut.glutFullScreen(); } else { Glut.glutPositionWindow(0, 0); Glut.glutReshapeWindow(1280, 720); } } else if (key == 32) { autoRotate = !autoRotate; } else if (key == 27) { Glut.glutLeaveMainLoop(); } }
private static void OnKeyboardUp(byte key, int x, int y) { if (key == 'w') { up = false; } else if (key == 's') { down = false; } else if (key == 'd') { right = false; } else if (key == 'a') { left = false; } else if (key == 'f') { fullscreen = !fullscreen; if (fullscreen) { Glut.glutFullScreen(); } else { Glut.glutPositionWindow(0, 0); Glut.glutReshapeWindow(1280, 720); } } }
private static void WindowedMode() { Glut.glutKeyboardFunc(new Glut.KeyboardCallback(Keyboard)); Glut.glutPassiveMotionFunc(null); Glut.glutMouseFunc(null); Glut.glutSetCursor(Glut.GLUT_CURSOR_INHERIT); Glut.glutPositionWindow(50, 50); Glut.glutReshapeWindow(320, 320); }
private static void OnKeyboardUp(byte key, int x, int y) { if (key == 'l') { lighting = !lighting; } else if (key == ' ') { autoRotate = !autoRotate; } else if (key == 'a') { left = false; } else if (key == 'w') { up = false; } else if (key == 'd') { right = false; } else if (key == 's') { down = false; } else if (key == 'f') { fullscreen = !fullscreen; if (fullscreen) { Glut.glutFullScreen(); } else { Glut.glutPositionWindow(0, 0); Glut.glutReshapeWindow(1280, 720); } } else if (key == 'b') { alpha = !alpha; if (alpha) { Gl.Enable(EnableCap.Blend); Gl.Disable(EnableCap.DepthTest); } else { Gl.Disable(EnableCap.Blend); Gl.Enable(EnableCap.DepthTest); } } }
private void UpdateFullscreen(bool fullscreen) { if (fullscreen) { Glut.glutFullScreen(); } else { Glut.glutPositionWindow(0, 0); Glut.glutReshapeWindow(formWidth, formHeight); } }
private static void OnKeyboardUp(byte key, int x, int y) { if (key == 'w') up = false; else if (key == 's') down = false; else if (key == 'd') right = false; else if (key == 'a') left = false; else if (key == ' ') autoRotate = !autoRotate; else if (key == 'l') lighting = !lighting; else if (key == 'f') { fullscreen = !fullscreen; if (fullscreen) Glut.glutFullScreen(); else { Glut.glutPositionWindow(0, 0); Glut.glutReshapeWindow(1280, 720); } } }
private static void OnKeyboardUp(byte key, int x, int y) { if (key == 'f') { fullscreen = !fullscreen; if (fullscreen) { Glut.glutFullScreen(); } else { Glut.glutPositionWindow(0, 0); Glut.glutReshapeWindow(1280, 720); } } else if (key == 'r') { rainbow = !rainbow; program.Use(); program["static_colors"].SetValue(rainbow); } }
private static void OnKeyboardMoves(byte key, int x, int y) { if (key == 'a') { rotx = rotx + 3; } else if (key == 'z') { rotx = rotx - 3; } else if (key == 'e') { roty = roty + 3; } else if (key == 'r') { roty = roty - 3; } else if (key == 't') { rotz = rotz + 3; } else if (key == 'y') { rotz = rotz - 3; } else if (key == '+') { zoom = zoom + 3; } else if (key == '-') { zoom = zoom - 3; } else if (key == 'q') { translatex = translatex + 1; } else if (key == 's') { translatex = translatex - 1; } else if (key == 'd') { translatey = translatey + 1; } else if (key == 'g') { translatey = translatey - 1; } if (key == 'f') { fullscreen = !fullscreen; if (fullscreen) { Glut.glutFullScreen(); } else { Glut.glutPositionWindow(0, 0); Glut.glutReshapeWindow(1280, 720); } } }
private static void OnKeyboardUp(byte key, int x, int y) { if (key == 'w') { up = false; } else if (key == 's') { down = false; } else if (key == 'd') { right = false; } else if (key == 'a') { left = false; } else if (key == ' ') { autoRotate = !autoRotate; if (autoRotate) { wplayer.controls.play(); } else { wplayer.controls.stop(); } Rain.rainbow = !Rain.rainbow; Rain.program.Use(); Rain.program["static_colors"].SetValue(Rain.rainbow); Smoke.rainbow = !Smoke.rainbow; Smoke.program.Use(); Smoke.program["static_colors"].SetValue(Smoke.rainbow); } else if (key == 'l') { lighting = !lighting; } else if (key == 'z') { fullscreen = !fullscreen; if (fullscreen) { Glut.glutFullScreen(); } else { Glut.glutPositionWindow(0, 0); Glut.glutReshapeWindow(1280, 720); } } else if (key == 'b') { alpha = !alpha; if (alpha) { Gl.Enable(EnableCap.Blend); Gl.Disable(EnableCap.DepthTest); } else { Gl.Disable(EnableCap.Blend); Gl.Enable(EnableCap.DepthTest); } } if (key == 'f') { fullscreen = !fullscreen; if (fullscreen) { Glut.glutFullScreen(); } else { Glut.glutPositionWindow(0, 0); Glut.glutReshapeWindow(1280, 720); } } else if (key == 'r') { Rain.rainbow = !Rain.rainbow; Rain.program.Use(); Rain.program["static_colors"].SetValue(Rain.rainbow); Smoke.rainbow = !Smoke.rainbow; Smoke.program.Use(); Smoke.program["static_colors"].SetValue(Smoke.rainbow); } }