From: <szt...@ya...> - 2003-03-22 13:08:55
|
Hi, I just started to leard openGL with famous GL4Java library and got some problems which I'm not able to solve by mylsef. My OS configuration is: Linux Debian 3.0, GL4Java 2.8.2.0, j2sdk1.4.1 Blackdown.org, Nvidia GForce2 drivers from nvidia.com(games are working ok, so driver works). I composed this simple program below from demos examples (this is demos/ronsDemos/animApplet.skel based). As you can see it does nothing except trying to run few gl commands on animation thread. Once i run it it crashes after openning window with message: ---------------------------- init(): X$myappletCanvas[canvas0,4,20,42x29] An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C97E188 Function=__nvsym17103+0x0 Library=/usr/lib/libGL.so Current Java thread: at gl4java.GLContext.gljMakeCurrentNative(Native Method) at gl4java.GLContext.gljMakeCurrent(GLContext.java:2472) - locked <0x44184330> (a gl4java.GLContext) at gl4java.awt.GLCanvas.sDisplay(GLCanvas.java:697) at gl4java.awt.GLAnimCanvas.run(GLAnimCanvas.java:466) at java.lang.Thread.run(Thread.java:536) Dynamic libraries: 08048000-0804d000 r-xp 00000000 03:03 291350 /usr/local/j2sdk1.4.1/bin/java .... ---------------------------- I have seen some threads on this forum mentioning similar problems, but answers were not enough detailed for me to be helpfull (I'm pretty new Linux user). regards, Tomasz Sztejka. This is my problematic code: public class X extends Frame { myappletCanvas canvas = null; public static void main(String [] ar) { X x = new X(); x.init(); x.setVisible(true); x.start(); }; public void init() { Dimension d = getSize(); setLayout(new BorderLayout()); canvas = new myappletCanvas(d.width, d.height); add("Center", canvas); } public void start() { canvas.start(); } public void stop() { canvas.stop(); } public void destroy() { canvas.stop(); canvas.destroy(); } private class myappletCanvas extends GLAnimCanvas { public myappletCanvas(int w, int h) { super(w, h); GLContext.gljNativeDebug = false; GLContext.gljClassDebug = false; setAnimateFps(60.0); } public void preInit() { doubleBuffer = true; stereoView = false; } public void init() { System.out.println("init(): " + this); reshape(getSize().width, getSize().height); glj.gljCheckGL(); } public void destroy() { System.out.println("destroy(): " + this); cvsDispose(); } public void reshape(int width, int height) { gl.glViewport(0,0,width,height); } public void display() { if (glj.gljMakeCurrent(true) == false) return; glj.gljSwap(); glj.gljCheckGL(); glj.gljFree(); if (!isSuspended()) repaint(); // Animate at full speed. } } } __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com |