boolean killswitch;
public DisplayParentTest() throws LWJGLException {
setTitle("LWJGL Display Parent Test");
setSize(640, 320);
setLayout(new GridLayout(1, 2));
final Canvas display_parent = new Canvas();
display_parent.setFocusable(true);
display_parent.setIgnoreRepaint(true);
add(display_parent);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
killswitch = true;
}
});
setResizable(true);
setVisible(true);
Display.setParent(display_parent);
Display.setVSyncEnabled(true);
Display.create();
float angle = 0f;
while (isVisible() && !killswitch) {
angle += 1.0f;
int width;
int height;
if (!Display.isFullscreen()) {
width = display_parent.getWidth();
height = display_parent.getHeight();
} else {
width = Display.getDisplayMode().getWidth();
height = Display.getDisplayMode().getHeight();
}