Initial repo commit
This commit is contained in:
50
lwjgl2/build.gradle
Normal file
50
lwjgl2/build.gradle
Normal file
@@ -0,0 +1,50 @@
|
||||
apply plugin: 'application'
|
||||
|
||||
|
||||
sourceSets.main.resources.srcDirs += [ rootProject.file('assets').path ]
|
||||
application.mainClass = 'com.mygdx.game.lwjgl2.Lwjgl2Launcher'
|
||||
eclipse.project.name = appName + '-lwjgl2'
|
||||
java.sourceCompatibility = 8
|
||||
java.targetCompatibility = 8
|
||||
if (JavaVersion.current().isJava9Compatible()) {
|
||||
compileJava.options.release.set(8)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
|
||||
implementation "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
|
||||
implementation "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-desktop"
|
||||
implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
||||
implementation project(':core')
|
||||
}
|
||||
|
||||
jar {
|
||||
archiveBaseName.set(appName)
|
||||
// the duplicatesStrategy matters starting in Gradle 7.0; this setting works.
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
dependsOn configurations.runtimeClasspath
|
||||
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
|
||||
// these "exclude" lines remove some unnecessary duplicate files in the output JAR.
|
||||
exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA')
|
||||
dependencies {
|
||||
exclude('META-INF/INDEX.LIST', 'META-INF/maven/**')
|
||||
}
|
||||
// setting the manifest makes the JAR runnable.
|
||||
// enabling native access helps avoid a warning when Java 24 or later runs the JAR.
|
||||
manifest {
|
||||
attributes 'Main-Class': application.mainClass, 'Enable-Native-Access': 'ALL-UNNAMED'
|
||||
}
|
||||
// this last step may help on some OSes that need extra instruction to make runnable JARs.
|
||||
doLast {
|
||||
file(archiveFile).setExecutable(true, false)
|
||||
}
|
||||
}
|
||||
|
||||
// Equivalent to the jar task; here for compatibility with gdx-setup.
|
||||
tasks.register('dist') {
|
||||
dependsOn 'jar'
|
||||
}
|
||||
|
||||
run {
|
||||
ignoreExitValue = true
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.mygdx.game.lwjgl2;
|
||||
|
||||
import com.badlogic.gdx.Files.FileType;
|
||||
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
|
||||
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
|
||||
|
||||
/** Launches the desktop (LWJGL2) application. */
|
||||
public class Lwjgl2Launcher {
|
||||
public static void main(String[] args) {
|
||||
createApplication();
|
||||
}
|
||||
|
||||
private static LwjglApplication createApplication() {
|
||||
return new LwjglApplication(new AbsurdCityBuilder1(), getDefaultConfiguration());
|
||||
}
|
||||
|
||||
private static LwjglApplicationConfiguration getDefaultConfiguration() {
|
||||
LwjglApplicationConfiguration configuration = new LwjglApplicationConfiguration();
|
||||
configuration.title = "AbsurdCityBuilder1";
|
||||
configuration.width = 640;
|
||||
configuration.height = 480;
|
||||
//// This prevents a confusing error that would appear after exiting normally.
|
||||
configuration.forceExit = false;
|
||||
|
||||
for (int size : new int[] { 128, 64, 32, 16 }) {
|
||||
configuration.addIcon("libgdx" + size + ".png", FileType.Internal);
|
||||
}
|
||||
return configuration;
|
||||
}
|
||||
}
|
||||
BIN
lwjgl2/src/main/resources/libgdx128.png
Normal file
BIN
lwjgl2/src/main/resources/libgdx128.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.3 KiB |
BIN
lwjgl2/src/main/resources/libgdx16.png
Normal file
BIN
lwjgl2/src/main/resources/libgdx16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 806 B |
BIN
lwjgl2/src/main/resources/libgdx32.png
Normal file
BIN
lwjgl2/src/main/resources/libgdx32.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
BIN
lwjgl2/src/main/resources/libgdx64.png
Normal file
BIN
lwjgl2/src/main/resources/libgdx64.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.8 KiB |
Reference in New Issue
Block a user