Thursday 15 July 2010

java - LWJGL Window Closes Even When In update Loop -


My window closes, whenever I said in the loop to Display.Update, it is currently closed My code: / P>

  package com.kgt.platform.name; Import org.lwjgl.opengl.Display; Import org.lwjgl.opengl.DisplayMode; Public square game {Public static zero main throws (string [] args) Exception {display.setDisplayMode (New Exposure Medium (640, 480)) throws; Display.create (); While (Display.isCloseRequested ()) {Display.update (); Display.sync (60); } Display.destroy (); }}   

It's really weird for a sec after Windows shutdown,

The answer is in your loop position, it should be:

  while (! Display.isCloseRequested ()) {...}   

requires a display / window to turn off not while you perform it while reading "Loop" in the instructions given below. "

Hope it helps. / P>

No comments:

Post a Comment