public void rendering(GL2GL3 gl) { updateCanvasSize(gl); currentSO.rendering(gl); currentSO.iterate(gl); if (switched) { scene.shader1f(gl, gamma, "gamma"); scene.shader1f(gl, heightscale, "heightscale"); scene.shadowmapshader1f(gl, heightscale, "heightscale"); switched = false; } // screenshot("SS/ipsj2/", 1024, 1024); }
public void keyPressed(KeyEvent e) { currentSO.keyPressed(e); switch (e.getKeyChar()) { case 's': if (shadowswitch == 0) { shadowswitch = 1; } else { shadowswitch = 0; } switched = true; break; case 'h': if (heightctrl) { heightctrl = false; } else { heightctrl = true; } break; case 'p': gamma += 0.1; System.out.println(gamma); switched = true; break; case 'o': gamma -= 0.1; System.out.println(gamma); switched = true; break; } }
private void updateCanvasSize(GL2GL3 gl) { if (CANVAS_WIDTH_prev != CANVAS_WIDTH || CANVAS_HEIGHT_prev != CANVAS_HEIGHT) { currentSO.setCanvasSize(gl, CANVAS_WIDTH, CANVAS_HEIGHT); CANVAS_WIDTH_prev = CANVAS_WIDTH; CANVAS_HEIGHT_prev = CANVAS_HEIGHT; } }
public void actionPerformed(ActionEvent e) { currentSO.actionPerformed(e); }
public void mouseMoved(MouseEvent e) { if (currentSO == null) { return; } currentSO.mouseMoved(e); }
public void mouseReleased(MouseEvent e) { if ((e.getModifiers() & MouseEvent.BUTTON3_MASK) != 0) rightclicking = false; currentSO.mouseReleased(e); }
public void mousePressed(MouseEvent e) { if ((e.getModifiers() & MouseEvent.BUTTON3_MASK) != 0) rightclicking = true; currentSO.mousePressed(e); }
public void mouseDragged(MouseEvent e) { currentSO.mouseDragged(e); }