踊る犬.netブログ (旧)

EclipseでProce55ingのOpenGLを使用する

EclipseでProce55ingするにはここを参照。

  1. プロジェクトを右クリックして[プロパティ]を選択
  2. [ビルドパス]の[ライブラリ]タブでjogl.jarの[Native library location]のところに、例えば C:processing-0125-expertlibrariesopengllibrary と入力する。
  3. さらに、JFrame 内でPAppletEmbedded として動作させるには、
    public static void main(String[] args) { 
        JFrame f = new JFrame("Embedded");  
        f.setLayout(new BorderLayout()); 
        PApplet embed = new <font color="blue">PAppletのクラス名</font><font>(); 
        f.add(embed, BorderLayout.CENTER); 
        f.setSize(DIM, DIM); 
        f.setVisible(true); 
        // important to call this whenever embedding a PApplet. 
        // It ensures that the animation thread is started and 
        // that other internal variables are properly set. 
        embed.init(); 
    }
    

でOK。