mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[libgdx] Remove dependency on gdx-lwjgl3-glfw-awt-macos in SkeletonViewer, use LWJGL glfw_async instead
Same deficiency: when resizing, it will eventually crash with ``` UNSUPPORTED (log once): setPrimitiveRestartEnabled:index: unsupported! -[AGXG13XFamilyCommandBuffer renderCommandEncoderWithDescriptor:]:888: failed assertion `A command encoder is already encoding to this command buffer' ``` Not sure how to work around this. JGLFW does not have this issue.
This commit is contained in:
parent
d0e94ba3fb
commit
6fa31a2903
@ -13,7 +13,6 @@ allprojects {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set Java 8 compatibility using JDK 17
|
|
||||||
tasks.withType(JavaCompile).configureEach {
|
tasks.withType(JavaCompile).configureEach {
|
||||||
sourceCompatibility = '1.7'
|
sourceCompatibility = '1.7'
|
||||||
targetCompatibility = '1.7'
|
targetCompatibility = '1.7'
|
||||||
@ -43,10 +42,18 @@ project("spine-skeletonviewer") {
|
|||||||
from {
|
from {
|
||||||
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
|
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dependsOn(project(":spine-libgdx").tasks.named('jar'))
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.named('jar').configure {
|
tasks.named('build').configure {
|
||||||
dependsOn(project(":spine-libgdx").tasks.named('jar'))
|
dependsOn(tasks.named('jar'))
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaCompile).configureEach {
|
||||||
|
sourceCompatibility = '1.8'
|
||||||
|
targetCompatibility = '1.8'
|
||||||
|
options.release.set(8) // Ensures Java 8 bytecode is produced
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,7 +65,6 @@ configure(subprojects - project("spine-libgdx")) {
|
|||||||
implementation "com.badlogicgames.gdx:gdx:$libgdxVersion"
|
implementation "com.badlogicgames.gdx:gdx:$libgdxVersion"
|
||||||
implementation "com.badlogicgames.gdx:gdx-platform:$libgdxVersion:natives-desktop"
|
implementation "com.badlogicgames.gdx:gdx-platform:$libgdxVersion:natives-desktop"
|
||||||
implementation "com.badlogicgames.gdx:gdx-backend-lwjgl3:$libgdxVersion"
|
implementation "com.badlogicgames.gdx:gdx-backend-lwjgl3:$libgdxVersion"
|
||||||
implementation "com.badlogicgames.gdx:gdx-lwjgl3-glfw-awt-macos:$libgdxVersion"
|
|
||||||
implementation "com.badlogicgames.gdx:gdx-box2d:$libgdxVersion"
|
implementation "com.badlogicgames.gdx:gdx-box2d:$libgdxVersion"
|
||||||
implementation "com.badlogicgames.gdx:gdx-box2d-platform:$libgdxVersion:natives-desktop"
|
implementation "com.badlogicgames.gdx:gdx-box2d-platform:$libgdxVersion:natives-desktop"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,6 +54,7 @@ import com.esotericsoftware.spine.AnimationState.AnimationStateAdapter;
|
|||||||
import com.esotericsoftware.spine.AnimationState.TrackEntry;
|
import com.esotericsoftware.spine.AnimationState.TrackEntry;
|
||||||
import com.esotericsoftware.spine.Skeleton.Physics;
|
import com.esotericsoftware.spine.Skeleton.Physics;
|
||||||
import com.esotericsoftware.spine.utils.TwoColorPolygonBatch;
|
import com.esotericsoftware.spine.utils.TwoColorPolygonBatch;
|
||||||
|
import org.lwjgl.system.Configuration;
|
||||||
|
|
||||||
import java.awt.Toolkit;
|
import java.awt.Toolkit;
|
||||||
|
|
||||||
@ -377,6 +378,8 @@ public class SkeletonViewer extends ApplicationAdapter {
|
|||||||
float dpiScale = 1;
|
float dpiScale = 1;
|
||||||
if (os.contains("Windows")) dpiScale = Toolkit.getDefaultToolkit().getScreenResolution() / 96f;
|
if (os.contains("Windows")) dpiScale = Toolkit.getDefaultToolkit().getScreenResolution() / 96f;
|
||||||
if (os.contains("OS X")) {
|
if (os.contains("OS X")) {
|
||||||
|
Configuration.GLFW_CHECK_THREAD0.set(false);
|
||||||
|
Configuration.GLFW_LIBRARY_NAME.set("glfw_async");
|
||||||
Object object = Toolkit.getDefaultToolkit().getDesktopProperty("apple.awt.contentScaleFactor");
|
Object object = Toolkit.getDefaultToolkit().getDesktopProperty("apple.awt.contentScaleFactor");
|
||||||
if (object instanceof Float && ((Float)object).intValue() >= 2) dpiScale = 2;
|
if (object instanceof Float && ((Float)object).intValue() >= 2) dpiScale = 2;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user