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(); }
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); }
/** 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; }
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)); }
@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); }
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(); }
@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()); }
@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); }
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)); }
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); }
public static void load() { GdxNativesLoader.load(); }
@BeforeClass public static void setUpBeforeClass() throws Exception { GdxNativesLoader.load(); }