## A fatal error has been detected by the Java Runtime Environment:## SIGSEGV (0xb) at pc=0x00007fd3173bfc08, pid=2661, tid=140544831526688## JRE version: 7.0_147-b147# Java VM: OpenJDK 64-Bit Server VM (21.0-b17 mixed mode linux-amd64 compressed oops)# Derivative: IcedTea7 2.0# Distribution: Ubuntu 11.10, package 7~b147-2.0-0ubuntu0.11.10.1# Problematic frame:# C [libX11.so.6+0x35c08] XQueryExtension+0x28## Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again## An error report file with more information is saved as:# /home/hannes/git/LWJGLTest/LWJGL/hs_err_pid2661.log## If you would like to submit a bug report, please include# instructions on how to reproduce the bug and visit:# https://bugs.launchpad.net/ubuntu/+source/openjdk-7/#
import java.util.Scanner;import org.lwjgl.LWJGLException;import org.lwjgl.input.Keyboard;import org.lwjgl.opengl.ContextAttribs;import org.lwjgl.opengl.Display;import org.lwjgl.opengl.DisplayMode;import org.lwjgl.opengl.GL11;import org.lwjgl.opengl.PixelFormat;public class LWJGLTest { public static void main(String[] args) { try { Scanner scanner = new Scanner(System.in); for (DisplayMode mode : Display.getAvailableDisplayModes()) { System.out.println(mode + " Do you want this mode?[y/n]"); String line; do { line = scanner.nextLine(); }while(!line.matches("([yn])|(yes)|(no)")); if(line.startsWith("y")) { Display.setDisplayModeAndFullscreen(mode); break; } } if(!Display.isFullscreen()) { throw new RuntimeException("No display mode selected!"); } Display.create(new PixelFormat(), new ContextAttribs(3,3) .withProfileCore(true) .withForwardCompatible(true)); Display.sync(60); GL11.glClearColor(1.0f, 0.6f, 0.0f, 1.0f); boolean running = true; while(running && !Display.isCloseRequested()) { while(Keyboard.next()) { if(Keyboard.getEventKeyState()) { if(Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) { running = false; } } } GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); Display.update(); } } catch (LWJGLException e) { e.printStackTrace(); } catch (RuntimeException e) { e.printStackTrace(); } }}