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
| if (!windowed) { try { DisplayMode[] dm = Display.getAvailableDisplayModes(640, 480, -1, -1, -1, -1, 60, 85); Display.setDisplayMode(dm, new String[] { "width="+WIDTH, "height="+HEIGHT, "freq="+((int)FRAMERATE), "bpp="+org.lwjgl.Display.getDepth() }); } catch (Exception e) { e.printStackTrace(System.err); windowed = true; } } try { int width, height; if (windowed) { width = java.lang.Math.min(org.lwjgl.Display.getWidth(), WIDTH); height = java.lang.Math.min(org.lwjgl.Display.getHeight(), HEIGHT); Window.create(GAME_TITLE, 0, 0, width, height, 16, 0, 0, 0, 0); } else { width = org.lwjgl.Display.getWidth(); height = org.lwjgl.Display.getHeight(); try { Window.create(GAME_TITLE, 16, 0, 0, 0, 0); } catch (Exception e) { width = java.lang.Math.min(org.lwjgl.Display.getWidth(), WIDTH); height = java.lang.Math.min(org.lwjgl.Display.getHeight(), HEIGHT); Window.create(GAME_TITLE, 0, 0, width, height, 16, 0, 0, 0, 0); } } NvidiaInitializer.initialize(2048 * 2048, 0); } catch (Exception e) { e.printStackTrace(); cleanup(); Sys.alert( GAME_TITLE, "You need an OpenGL compatible graphics card to run " + GAME_TITLE + ". You may have a suitable graphics card but not have OpenGL drivers. Please contact " + EMAIL_ADDRESS + " for assistance or visit our website if you need help finding OpenGL drivers for your graphics card."); Support.doSupport("opengl"); exit(); } |