I'm still getting this error sometimes
this is my code, the vm crashes when i don't select any display mode in my selector, say, when the display is not set nor created.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| public class Tutorial_1 implements Runnable{ public boolean running = true, presionando_f1; private DisplayMode displayMode;
public static void main(String[] args) { new Tutorial_1(); System.err.println("exiting..."); } public Tutorial_1(){ createWindow(false); run(); } private void createWindow(boolean fullscreen){ try{ Display.setFullscreen(fullscreen); DisplayMode[] modes = Display.getAvailableDisplayModes(); int opcion = JOptionPane.showOptionDialog(null, "Select a display mode", "!", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, modes, 0); if(opcion != JOptionPane.CLOSED_OPTION) { displayMode = modes[opcion]; Display.setDisplayMode(displayMode); Display.setTitle("Tutorial 1 de Opengl con LWGL"); Display.create(); } else { running = false; } }catch(LWJGLException e){ e.printStackTrace(); System.exit(1); } } public void run(){ while(running){ if(Display.isCloseRequested()){ running = false; } } } } |
thanks for the help, i'm off to a good start and i want to know where do this errors come to avoid them in further projects
