Java 类com.badlogic.gdx.utils.GdxNativesLoader 实例源码

项目:ead    文件:MockApplication.java   
public MockApplication(ApplicationListener listener, int width, int height) {
    this.listener = listener;
    // Create stub objects
    files = new MockFiles();
    audio = new MockAudio();
    input = new MockInput();
    graphics = new MockGraphics(width, height);

    Gdx.app = this;
    Gdx.graphics = graphics;
    Gdx.files = files;
    Gdx.audio = audio;
    Gdx.input = input;
    Gdx.gl = graphics.getGL20();
    Gdx.gl20 = graphics.getGL20();
    GdxNativesLoader.load();
    clipboard = new Clipboard() {

        private String contents;

        @Override
        public String getContents() {
            return contents;
        }

        @Override
        public void setContents(String content) {
            this.contents = content;
        }
    };
    start();
}
项目:Tilo-game-framework    文件:Main.java   
public static void main(String[] args) {
    LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
    cfg.title = "Tilo version 0.1";
    cfg.width = 800;
    cfg.height = 600;

       GdxNativesLoader.load();
    new LwjglApplication(new Tilo(), cfg);
}
项目:libgdxcn    文件:LwjglNativesLoader.java   
/** Extracts the LWJGL native libraries from the classpath and sets the "org.lwjgl.librarypath" system property. */
static public 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.extractFile(is64Bit ? "OpenAL64.dll" : "OpenAL32.dll", nativesDir.getName());
        } else if (isMac) {
            File extractedFile = loader.extractFile("liblwjgl.jnilib", null);
            nativesDir = extractedFile.getParentFile();
            new FileHandle(extractedFile).copyTo(new FileHandle(new File(nativesDir, "liblwjgl.dylib")));
            if (!LwjglApplicationConfiguration.disableAudio) loader.extractFile("openal.dylib", nativesDir.getName());
        } else if (isLinux) {
            nativesDir = loader.extractFile(is64Bit ? "liblwjgl64.so" : "liblwjgl.so", null).getParentFile();
            if (!LwjglApplicationConfiguration.disableAudio)
                loader.extractFile(is64Bit ? "libopenal64.so" : "libopenal.so", nativesDir.getName());
        }
    } catch (Throwable ex) {
        throw new GdxRuntimeException("Unable to extract LWJGL natives.", ex);
    }
    System.setProperty("org.lwjgl.librarypath", nativesDir.getAbsolutePath());
    load = false;
}
项目:libgdxcn    文件:ETC1Compressor.java   
public static void process (String inputDirectory, String outputDirectory, boolean recursive, boolean flatten)
    throws Exception {
    GdxNativesLoader.load();
    ETC1FileProcessor processor = new ETC1FileProcessor();
    processor.setRecursive(recursive);
    processor.setFlattenOutput(flatten);
    processor.process(new File(inputDirectory), new File(outputDirectory));
}
项目:gdx-bullet-demos    文件:BulletDemoDesktopApplication.java   
@Override
public void create()
{
    // Preload the natives so we can use them in static class initialization
    GdxNativesLoader.load();

    final Screen playScreen = new DemoScreen(this);
    setScreen(playScreen);
}
项目:GDX-Logic-Bricks    文件:BaseTest.java   
public BaseTest() {
    GdxNativesLoader.load();
    SpriteBatch batch = Mockito.mock(SpriteBatch.class);
    when(batch.getColor()).thenReturn(new Color());

    Gdx.input = Mockito.mock(Input.class);
    Gdx.app = Mockito.mock(Application.class);

    Gdx.graphics = Mockito.mock(Graphics.class);
    when(Gdx.graphics.getWidth()).thenReturn((int) Settings.WIDTH);
    when(Gdx.graphics.getHeight()).thenReturn((int) Settings.HEIGHT);

    Settings.DEBUG_LEVEL = Logger.DEBUG;
    Settings.TESTING = true;
    Settings.MAX_STEPS = 60;

    GameContext context = new ContextTest();
    context.load();

    this.game = context.get(Game.class);

    engine = context.get(LogicBricksEngine.class);
    builders = context.get(LBBuilders.class);
    entityBuilder = builders.getEntityBuilder();
    bodyBuilder = builders.getBodyBuilder();

}
项目:DreamsLibGdx    文件:HeroManagerTest.java   
@BeforeClass
public static void testSetup() {
    GdxNativesLoader.load();
    physic= new com.badlogic.gdx.physics.box2d.World(new Vector2(0, -9.81f), true);
    r = new Hero(physic);
    r.createHero(0, 0, 0.7f, 1.8f);

    r.getRubenPhysicsFixture().setFriction(0);
    r.getRubenSensorFixture().setFriction(0);
    heroManager = new HeroManager(r);
    controller=new WorldController(game, new com.rubentxu.juegos.core.modelo.World());
}
项目:DreamsLibGdx    文件:HeroTest.java   
@BeforeClass
public static void testSetup() {
    GdxNativesLoader.load();
    com.badlogic.gdx.physics.box2d.World physic = new com.badlogic.gdx.physics.box2d.World(new Vector2(0, -9.81f), true);
    r = new Hero(physic);
    r.createHero(0, 0, 0.7f, 1.8f);
}
项目:isometric-libgdx-game-template    文件:ETC1Compressor.java   
public static void process(String inputDirectory, String outputDirectory, boolean recursive,
        boolean flatten)
        throws Exception {
    GdxNativesLoader.load();
    ETC1FileProcessor processor = new ETC1FileProcessor();
    processor.setRecursive(recursive);
    processor.setFlattenOutput(flatten);
    processor.process(new File(inputDirectory), new File(outputDirectory));
}
项目:touhou-java    文件:ETC1Compressor.java   
public static void process (String inputDirectory, String outputDirectory, boolean recursive, boolean flatten)
    throws Exception {
    GdxNativesLoader.load();
    ETC1FileProcessor processor = new ETC1FileProcessor();
    processor.setRecursive(recursive);
    processor.setFlattenOutput(flatten);
    processor.process(new File(inputDirectory), new File(outputDirectory));
}
项目:RuinsOfRevenge    文件:TmxObjectsLoader.java   
public static void main(String... args) throws IOException {
    GdxNativesLoader.load();
    Physics physics = new Physics(Vector2.Zero, true);
    File mapfile = new File("data/maps/newmap/map005.tmx");
    Element mapXML = new XmlReader().parse(new FileInputStream(mapfile));
    System.out.println(mapXML);

    new TmxObjectsLoader(mapXML)
        .loadToPhysics(physics, 32, 32, 50, 50);
}
项目:libgdxcn    文件:HeadlessNativesLoader.java   
public static void load() {
    GdxNativesLoader.load();
}
项目:angr    文件:ExplosionTest.java   
@BeforeClass
public static void setUpBeforeClass() throws Exception {
    GdxNativesLoader.load();
}
项目:angr    文件:ModelContactListenerTest.java   
@BeforeClass
public static void setUpBeforeClass() throws Exception {
    GdxNativesLoader.load();
}