package main; import org.lwjgl.LWJGLException; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.*; import java.io.File; //import toolbox.FPS; //import toolbox.Loader; //import toolbox.VersionManager; /** * @Author Ezz | (Tay << 1) */ public class MainClass { public static final int WIDTH = 800; public static final int HEIGHT = 600; public static final int FPS_CAP = 60; public static boolean isRunning; public void init() { initDisplay(); isRunning = true; } public void run() { String line = "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; String[] list = {}; for (int i = 0; i < 1000000; i++) { list = line.split(" "); } for (int i = 0; i < list.length; i++) { System.out.println("|" + list[i] + "|"); } while (isRunning) { update(); } } public void cleanUp() { // Loader.cleanUp(); Display.destroy(); } private void update() { if (Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) || Display.isCloseRequested()) isRunning = false; // Display.setTitle("FPS: " + FPS.get()); Display.sync(FPS_CAP); Display.update(); } private void initDisplay() { ContextAttribs attribs = new ContextAttribs(3, 2) .withForwardCompatible(true) .withProfileCore(true); try { Display.setDisplayMode(new DisplayMode(WIDTH, HEIGHT)); // Display.setTitle("E3D " + VersionManager.get()); Display.create(new PixelFormat(), attribs); } catch (LWJGLException e) { System.err.println("Ошибка при создании дисплея"); e.printStackTrace(); } GL11.glViewport(0, 0, WIDTH, HEIGHT); GL11.glEnable(GL11.GL_DEPTH_TEST); } public static void main(String[] args) { // VersionManager.connect(); loadNatives(); MainClass mainClass = new MainClass(); mainClass.init(); mainClass.run(); mainClass.cleanUp(); } private static void loadNatives() { String rootDir = new File(".").getAbsoluteFile().getParentFile().getAbsolutePath(); String osName = System.getProperty("os.name").toLowerCase().substring(0, System.getProperty("os.name").indexOf(' ')); System.setProperty("org.lwjgl.librarypath", new File(rootDir.concat("/lib/natives/").concat(osName)).getAbsolutePath()); } }