本文整理汇总了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();
}
示例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);
}
示例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;
}
示例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));
}
示例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);
}
示例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();
}
示例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());
}
示例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);
}
示例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));
}
示例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);
}
示例11: load
import com.badlogic.gdx.utils.GdxNativesLoader; //导入依赖的package包/类
public static void load() {
GdxNativesLoader.load();
}
示例12: setUpBeforeClass
import com.badlogic.gdx.utils.GdxNativesLoader; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
GdxNativesLoader.load();
}