コード例 #1
0
ファイル: texgen.java プロジェクト: neosam/jogl-demos
  public void keyPressed(KeyEvent key) {
    switch (key.getKeyChar()) {
      case KeyEvent.VK_ESCAPE:
        System.exit(0);
        break;
      case 'e':
      case 'E':
        currentGenMode = GL2.GL_EYE_LINEAR;
        currentPlane = GL2.GL_EYE_PLANE;
        break;
      case 'o':
      case 'O':
        currentGenMode = GL2.GL_OBJECT_LINEAR;
        currentPlane = GL2.GL_OBJECT_PLANE;
        break;
      case 's':
      case 'S':
        currentCoeff = slanted;
        break;
      case 'x':
      case 'X':
        currentCoeff = xequalzero;
        break;

      default:
        break;
    }
    super.refresh();
  }
コード例 #2
0
  public void keyPressed(KeyEvent key) {
    this.key = key;
    switch (key.getKeyChar()) {
      case KeyEvent.VK_ESCAPE:
        System.exit(0);
        break;

      case '1':
        f1 = f1 + 0.25f;
        break;
      case '2':
        f2 = f2 + 0.25f;
        break;
      case '3':
        f3 = f3 + 0.25f;
        break;
      case '8':
        if (f1 > 0.25) f1 = f1 - 0.25f;
        break;
      case '9':
        if (f2 > 0.25) f2 = f2 - 0.25f;

        break;
      case '0':
        if (f3 > 0.25) f3 = f3 - 0.25f;
        break;
    }

    super.refresh();
  }
コード例 #3
0
ファイル: varray.java プロジェクト: neosam/jogl-demos
 public void mousePressed(MouseEvent mouse) {
   if (mouse.getButton() == MouseEvent.BUTTON1) {
     if (setupMethod == POINTER) {
       setupMethod = INTERLEAVED;
       // setupInterleave(gl);don't call
     } else if (setupMethod == INTERLEAVED) {
       setupMethod = POINTER;
       // setupPointers(gl);
     }
     // validate();
   }
   if (mouse.getButton() == MouseEvent.BUTTON2 || mouse.getButton() == MouseEvent.BUTTON3) {
     if (derefMethod == DRAWARRAY) derefMethod = ARRAYELEMENT;
     else if (derefMethod == ARRAYELEMENT) derefMethod = DRAWELEMENTS;
     else if (derefMethod == DRAWELEMENTS) derefMethod = DRAWARRAY;
     // validate();
   }
   super.refresh();
 }