[BUG] Linux X Server Error with LWJGL + Netbeans Platform RCP

Started by Vallant, August 02, 2013, 16:20:23

Previous topic - Next topic

Vallant

I embedded LWJGL into a module using a class that extends awt.Canvas
I'm running Ubuntu 13.04 with the Gnome 3 shell. I'm running this on a ATI Radeon X1200 video card (Weak I know, but still runs it at 60fps with 50 diffuse shader cubes).
In the constructor I have:
while (!isDisplayable()) {Thread.yield();}
	try {
		Display.setDisplayMode(new DisplayMode(640, 480));
		Display.setVSyncEnabled(false);
		Display.setParent(this);
		Display.create();
	} catch (LWJGLException ex) {
		System.err.println("Display could not be created");
		ex.printStackTrace(System.err);
		System.exit(-1);
	}


It starts up and runs fine and displays these errors but catches them and runs fine:
java.lang.Exception: Dangerous reflection access to sun.misc.Unsafe by class org.lwjgl.MemoryUtilSun$AccessorUnsafe detected!
[catch] at org.netbeans.TopSecurityManager.checkMemberAccess(TopSecurityManager.java:440)
   at java.lang.Class.checkMemberAccess(Class.java:2233)
   at java.lang.Class.getDeclaredFields(Class.java:1795)
   at org.lwjgl.MemoryUtilSun$AccessorUnsafe.getUnsafeInstance(MemoryUtilSun.java:74)
   at org.lwjgl.MemoryUtilSun$AccessorUnsafe.<init>(MemoryUtilSun.java:62)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
   at java.lang.Class.newInstance(Class.java:374)
   at org.lwjgl.MemoryUtil.loadAccessor(MemoryUtil.java:375)
   at org.lwjgl.MemoryUtil.<clinit>(MemoryUtil.java:63)
   at org.lwjgl.opengl.LinuxDisplay.setTitle(LinuxDisplay.java:759)
   at org.lwjgl.opengl.Display.setTitle(Display.java:541)
   at org.lwjgl.opengl.Display.createWindow(Display.java:312)
   at org.lwjgl.opengl.Display.create(Display.java:848)
   at org.lwjgl.opengl.Display.create(Display.java:757)
   at org.lwjgl.opengl.Display.create(Display.java:739)
   at Core.Main.run(Main.java:34)
   at java.lang.Thread.run(Thread.java:724)


org.lwjgl.LWJGLException: X Error - disp: 0x7fc54c38cac0 serial: 8409 error: BadDrawable (invalid Pixmap or Window parameter) request_code: 153 minor_code: 8
   at org.lwjgl.opengl.LinuxDisplay.globalErrorHandler(LinuxDisplay.java:318)
   at org.lwjgl.opengl.LinuxContextImplementation.nSwapBuffers(Native Method)
   at org.lwjgl.opengl.LinuxContextImplementation.swapBuffers(LinuxContextImplementation.java:79)
   at org.lwjgl.opengl.ContextGL.swapBuffers(ContextGL.java:175)
   at org.lwjgl.opengl.DrawableGL.swapBuffers(DrawableGL.java:90)
   at org.lwjgl.opengl.Display.swapBuffers(Display.java:618)
   at org.lwjgl.opengl.Display.update(Display.java:646)
Caused: java.lang.RuntimeException
   at org.lwjgl.opengl.Display.update(Display.java:648)
   at org.lwjgl.opengl.Display.update(Display.java:628)
   at Core.Main.run(Main.java:93)
[catch] at java.lang.Thread.run(Thread.java:724)


Sometimes when I start it even without changing any code this error appears:
Display could not be created //The exception is in the code above
org.lwjgl.LWJGLException: X Error - disp: 0x7f66282de270 serial: 33 error: BadValue (integer parameter out of range for operation) request_code: 1 minor_code: 0
	at org.lwjgl.opengl.LinuxDisplay.globalErrorHandler(LinuxDisplay.java:318)
	at org.lwjgl.opengl.LinuxDisplay.nCreateWindow(Native Method)
	at org.lwjgl.opengl.LinuxDisplay.createWindow(LinuxDisplay.java:480)
	at org.lwjgl.opengl.Display.createWindow(Display.java:306)
	at org.lwjgl.opengl.Display.create(Display.java:848)
	at org.lwjgl.opengl.Display.create(Display.java:757)
	at org.lwjgl.opengl.Display.create(Display.java:739)
	at Core.Main.run(Main.java:34)
	at java.lang.Thread.run(Thread.java:724)


I can try this on windows later, but I think this problem is out of my control.
I spent the last two weeks fighting with AWTGLCanvas before I tried Display.setParent and that worked.
I know AWT is a weakpoint of LWJGL but it doesn't have to be. ;)