Probleme avec addGLEventListener
Bonjour,
Mon probleme est peut etre simple a resoudre pour certains mais vue que je suis debutante dans le domaine de JOGL j'ai passe toute la journee essayant de le resoudre mais en vain.
Je je veux developper un jeux 3d et me basant sur certain tutoriels j'ai opte pour JOGL (ou JSR231).
Pour l'instant je n'ai pas trop de ressources a part un tuto que j'ai trouve sur developpez.net.
mon probleme est quand j'essaye de compiler un code simple j'ai l'erreur suivante:
Citation:
cannot find symbol - symbol : method addGLEventListener(javax.media.opengl.GLCanvas)
l
voila mon code:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
| /**
* @(#)MyFrame.java
*
*
* @author
* @version 1.00 2008/10/12
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import com.sun.opengl.util.*;
import javax.media.opengl.*;
import javax.media.opengl.GLCanvas;
import javax.media.opengl.GLEventListener;
public class MyFrame extends JFrame
{
public JPanel mypanel = new JPanel();
public MyFrame()
{
Container content = new Container();
content = getContentPane();
content.add(mypanel);
GLCanvas mycanavas = new GLCanvas();
mypanel.add(mycanavas);
MyListener jl = new MyListener();
jl.addGLEventListener(mycanavas);
final Animator animator = new Animator(mycanavas);
setSize(500,500);
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
animator.start();
}
class MyListener implements GLEventListener
{
public void init(GLAutoDrawable drawable)
{
GL gl = drawable.getGL();
gl.setSwapInterval(1);
}
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
{
GL gl = drawable.getGL();
}
public void display(GLAutoDrawable drawable)
{
GL gl = drawable.getGL();
}
public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged)
{
}
}
} |
Pourriez vous m'aider ?
J'aurais aime savoir si vous connaissez aussi des tutos qui expliquent pas a pas comment developpez des surfaces 3d avec JOGL.
Merci