use of com.badlogic.gdx.utils.SharedLibraryLoader in project libgdx by libgdx.
the class FreeType method initFreeType.
public static Library initFreeType() {
new SharedLibraryLoader().load("gdx-freetype");
long address = initFreeTypeJni();
if (address == 0)
throw new GdxRuntimeException("Couldn't initialize FreeType library, FreeType error code: " + getLastErrorCode());
else
return new Library(address);
}
use of com.badlogic.gdx.utils.SharedLibraryLoader in project libgdx by libgdx.
the class JglfwDebugStarter method main.
public static void main(String[] argv) {
// this is only here for me to debug native code faster
new SharedLibraryLoader("../../extensions/gdx-audio/libs/gdx-audio-natives.jar").load("gdx-audio");
new SharedLibraryLoader("../../extensions/gdx-image/libs/gdx-image-natives.jar").load("gdx-image");
new SharedLibraryLoader("../../extensions/gdx-freetype/libs/gdx-freetype-natives.jar").load("gdx-freetype");
new SharedLibraryLoader("../../extensions/gdx-controllers/gdx-controllers-desktop/libs/gdx-controllers-desktop-natives.jar").load("gdx-controllers-desktop");
new SharedLibraryLoader("../../gdx/libs/gdx-natives.jar").load("gdx");
GdxTest test = new SuperKoalio();
JglfwApplicationConfiguration config = new JglfwApplicationConfiguration();
config.vSync = true;
new JglfwApplication(test, config);
}
use of com.badlogic.gdx.utils.SharedLibraryLoader in project libgdx by libgdx.
the class OisTest method main.
public static void main(String[] args) throws Exception {
DesktopControllersBuild.main(null);
new SharedLibraryLoader("libs/gdx-controllers-desktop-natives.jar").load("gdx-controllers-desktop");
ApplicationAdapter app = new ApplicationAdapter() {
Ois ois;
public void create() {
ois = new Ois(OisControllers.getWindowHandle());
if (ois.getJoysticks().size() > 0) {
ois.getJoysticks().get(0).setListener(new OisListener() {
@Override
public void xSliderMoved(OisJoystick joystick, int slider, boolean value) {
System.out.println("xSliderMoved: " + slider + ", " + value);
}
@Override
public void ySliderMoved(OisJoystick joystick, int slider, boolean value) {
System.out.println("ySliderMoved: " + slider + ", " + value);
}
@Override
public void povMoved(OisJoystick joystick, int pov, OisPov value) {
System.out.println("povMoved: " + pov + ", " + value);
}
@Override
public void buttonReleased(OisJoystick joystick, int button) {
System.out.println("buttonReleased: " + button);
}
@Override
public void buttonPressed(OisJoystick joystick, int button) {
System.out.println("buttonPressed: " + button);
}
@Override
public void axisMoved(OisJoystick joystick, int axis, float value) {
System.out.println("axisMoved: " + axis + ", " + value);
}
});
}
}
public void render() {
ois.update();
}
};
// new LwjglApplication(app);
// new LwjglFrame(app, "Controllers", 200, 200, false);
}
use of com.badlogic.gdx.utils.SharedLibraryLoader in project libgdx by libgdx.
the class Bullet method init.
/** Loads the native Bullet native library and initializes the gdx-bullet extension. Must be called before any of the bullet
* classes/methods can be used.
* @param useRefCounting Whether to use reference counting, causing object to be destroyed when no longer referenced. You must
* use {@link BulletBase#obtain()} and {@link BulletBase#release()} when using reference counting.
* @param logging Whether to log an error on potential errors in the application. */
public static void init(boolean useRefCounting, boolean logging) {
Bullet.useRefCounting = useRefCounting;
Bullet.enableLogging = logging;
new SharedLibraryLoader().load("gdx-bullet");
final int version = LinearMath.btGetVersion();
if (version != VERSION)
throw new GdxRuntimeException("Bullet binaries version (" + version + ") does not match source version (" + VERSION + ")");
}
use of com.badlogic.gdx.utils.SharedLibraryLoader in project libgdx by libgdx.
the class LwjglNativesLoader method load.
/** Extracts the LWJGL native libraries from the classpath and sets the "org.lwjgl.librarypath" system property. */
public static void load() {
GdxNativesLoader.load();
if (GdxNativesLoader.disableNativesLoading)
return;
if (!load)
return;
SharedLibraryLoader loader = new SharedLibraryLoader();
File nativesDir = null;
try {
if (isWindows) {
nativesDir = loader.extractFile(is64Bit ? "lwjgl64.dll" : "lwjgl.dll", null).getParentFile();
if (!LwjglApplicationConfiguration.disableAudio)
loader.extractFileTo(is64Bit ? "OpenAL64.dll" : "OpenAL32.dll", nativesDir);
} else if (isMac) {
nativesDir = loader.extractFile("liblwjgl.dylib", null).getParentFile();
if (!LwjglApplicationConfiguration.disableAudio)
loader.extractFileTo("openal.dylib", nativesDir);
} else if (isLinux) {
nativesDir = loader.extractFile(is64Bit ? "liblwjgl64.so" : "liblwjgl.so", null).getParentFile();
if (!LwjglApplicationConfiguration.disableAudio)
loader.extractFileTo(is64Bit ? "libopenal64.so" : "libopenal.so", nativesDir);
}
} catch (Throwable ex) {
throw new GdxRuntimeException("Unable to extract LWJGL natives.", ex);
}
System.setProperty("org.lwjgl.librarypath", nativesDir.getAbsolutePath());
load = false;
}
Aggregations