hi y’all
Everything is set up and everything works, but when I execute my code all I get is a gray screen, allthough no errors were given and my code seems right…
(here is my code)
public class probeersel extends JFrame {
/** Creates a new instance of probeersel */
public probeersel() {
super(“JOGL-probeersel”);
// Move to here:
setSize(800, 600);
//centerWindow(this);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
GLCapabilities caps = new GLCapabilities();
caps.setDoubleBuffered(true);
caps.setHardwareAccelerated(true);
GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(caps);
canvas.addGLEventListener(new tekening3D());
// Not needed:
canvas.setSize(800, 600);
getContentPane().add(canvas, BorderLayout.CENTER);
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
probeersel app = new probeersel();
//show what we've done
app.setVisible(true);
}
}
class tekening3D implements GLEventListener {
public void init(GLDrawable drawable) {
GL gl = drawable.getGL();
gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
gl.glColor3i(0, 0, 0);
gl.glPointSize(4.0f);
}
public void display(GLDrawable drawable) {
GL gl = drawable.getGL();
gl.glBegin( GL.GL_LINES );
gl.glVertex2i(50, 200);
gl.glVertex2i(75, 250);
gl.glVertex2i(60, 200);
gl.glVertex2i(85, 250);
gl.glEnd();
}
public void reshape(GLDrawable drawable, int x, int y, int width, int height) {}
public void displayChanged(GLDrawable drawable,
boolean modeChanged,
boolean deviceChanged) {}
}