diff options
Diffstat (limited to 'Занимательное программирование/2/2_vertical_scroll/desktop')
2 files changed, 65 insertions, 0 deletions
diff --git a/Занимательное программирование/2/2_vertical_scroll/desktop/build.gradle b/Занимательное программирование/2/2_vertical_scroll/desktop/build.gradle new file mode 100644 index 0000000..89712af --- /dev/null +++ b/Занимательное программирование/2/2_vertical_scroll/desktop/build.gradle @@ -0,0 +1,46 @@ +sourceSets.main.java.srcDirs = [ "src/" ] +sourceSets.main.resources.srcDirs = ["../assets"] + +project.ext.mainClassName = "net.caraus.modelling.DesktopLauncher" +project.ext.assetsDir = new File("../assets") + +import org.gradle.internal.os.OperatingSystem + +task run(dependsOn: classes, type: JavaExec) { + mainClass = project.mainClassName + classpath = sourceSets.main.runtimeClasspath + standardInput = System.in + workingDir = project.assetsDir + ignoreExitValue = true + + if (OperatingSystem.current() == OperatingSystem.MAC_OS) { + // Required to run on macOS + jvmArgs += "-XstartOnFirstThread" + } +} + +task debug(dependsOn: classes, type: JavaExec) { + mainClass = project.mainClassName + classpath = sourceSets.main.runtimeClasspath + standardInput = System.in + workingDir = project.assetsDir + ignoreExitValue = true + debug = true +} + +task dist(type: Jar) { + duplicatesStrategy(DuplicatesStrategy.EXCLUDE) + manifest { + attributes 'Main-Class': project.mainClassName + } + dependsOn configurations.runtimeClasspath + from { + configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } + } + with jar +} + + +dist.dependsOn classes + +eclipse.project.name = appName + "-desktop" diff --git a/Занимательное программирование/2/2_vertical_scroll/desktop/src/net/caraus/modelling/DesktopLauncher.java b/Занимательное программирование/2/2_vertical_scroll/desktop/src/net/caraus/modelling/DesktopLauncher.java new file mode 100644 index 0000000..757aed8 --- /dev/null +++ b/Занимательное программирование/2/2_vertical_scroll/desktop/src/net/caraus/modelling/DesktopLauncher.java @@ -0,0 +1,19 @@ +package net.caraus.modelling; + +import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application; +import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration; +import net.caraus.modelling.Modelling; + +// Please note that on macOS your application needs to be started with the -XstartOnFirstThread JVM argument +public class DesktopLauncher { + public static void main (String[] arg) { + Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration(); + + config.setTitle("Drop"); + config.setWindowedMode(800, 480); + config.useVsync(true); + config.setForegroundFPS(60); + + new Lwjgl3Application(new Modelling(), config); + } +} |
