当前位置: 首页>>代码示例>>Java>>正文


Java GdxNativesLoader类代码示例

本文整理汇总了Java中com.badlogic.gdx.utils.GdxNativesLoader的典型用法代码示例。如果您正苦于以下问题:Java GdxNativesLoader类的具体用法?Java GdxNativesLoader怎么用?Java GdxNativesLoader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GdxNativesLoader类属于com.badlogic.gdx.utils包,在下文中一共展示了GdxNativesLoader类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: MockApplication

import com.badlogic.gdx.utils.GdxNativesLoader; //导入依赖的package包/类
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();
}
 
开发者ID:e-ucm,项目名称:ead,代码行数:33,代码来源:MockApplication.java

示例2: main

import com.badlogic.gdx.utils.GdxNativesLoader; //导入依赖的package包/类
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);
}
 
开发者ID:Murii,项目名称:Tilo-game-framework,代码行数:10,代码来源:Main.java

示例3: load

import com.badlogic.gdx.utils.GdxNativesLoader; //导入依赖的package包/类
/** 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;
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:30,代码来源:LwjglNativesLoader.java

示例4: process

import com.badlogic.gdx.utils.GdxNativesLoader; //导入依赖的package包/类
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));
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:9,代码来源:ETC1Compressor.java

示例5: create

import com.badlogic.gdx.utils.GdxNativesLoader; //导入依赖的package包/类
@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);
}
 
开发者ID:sterwill,项目名称:gdx-bullet-demos,代码行数:10,代码来源:BulletDemoDesktopApplication.java

示例6: BaseTest

import com.badlogic.gdx.utils.GdxNativesLoader; //导入依赖的package包/类
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();

}
 
开发者ID:Rubentxu,项目名称:GDX-Logic-Bricks,代码行数:28,代码来源:BaseTest.java

示例7: testSetup

import com.badlogic.gdx.utils.GdxNativesLoader; //导入依赖的package包/类
@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());
}
 
开发者ID:Rubentxu,项目名称:DreamsLibGdx,代码行数:13,代码来源:HeroManagerTest.java

示例8: testSetup

import com.badlogic.gdx.utils.GdxNativesLoader; //导入依赖的package包/类
@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);
}
 
开发者ID:Rubentxu,项目名称:DreamsLibGdx,代码行数:8,代码来源:HeroTest.java

示例9: process

import com.badlogic.gdx.utils.GdxNativesLoader; //导入依赖的package包/类
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));
}
 
开发者ID:simonracz,项目名称:isometric-libgdx-game-template,代码行数:10,代码来源:ETC1Compressor.java

示例10: main

import com.badlogic.gdx.utils.GdxNativesLoader; //导入依赖的package包/类
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);
}
 
开发者ID:matheus23,项目名称:RuinsOfRevenge,代码行数:11,代码来源:TmxObjectsLoader.java

示例11: load

import com.badlogic.gdx.utils.GdxNativesLoader; //导入依赖的package包/类
public static void load() {
	GdxNativesLoader.load();
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:4,代码来源:HeadlessNativesLoader.java

示例12: setUpBeforeClass

import com.badlogic.gdx.utils.GdxNativesLoader; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
    GdxNativesLoader.load();
}
 
开发者ID:OlliV,项目名称:angr,代码行数:5,代码来源:ExplosionTest.java


注:本文中的com.badlogic.gdx.utils.GdxNativesLoader类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。