public void initManagers() { assetManager = new AssetManager(new LocalFileHandleResolver(), true); imagePacks = new ObjectMap<String, Array<String>>(); for (String name : new String[] {"characters", "obstacles", "grounds", "clouds", "bushes", "buildings"}) { imagePacks.put(DATA_PATH + "/" + name, new Array<String>()); } stateManager = new StateManager(this); stateManager.addState("loading", new LoadingState("menu", this)); stateManager.addState("menu", new MenuState(this)); stateManager.addState("game", new GameState(this)); stateManager.addState("credits", new CreditsState(this)); spriteBatch = new SpriteBatch(); pixmapPacker = new PixmapPacker(1024, 1024, Pixmap.Format.RGBA8888, 5, true, new PixmapPacker.GuillotineStrategy()); }
@Override public FileHandleResolver newResolver (FileType fileType) { switch (fileType) { case Absolute: return new AbsoluteFileHandleResolver(); case Classpath: return new ClasspathFileHandleResolver(); case External: return new ExternalFileHandleResolver(); case Internal: return new InternalFileHandleResolver(); case Local: return new LocalFileHandleResolver(); } return null; // Should never happen }
@Test public void testShaderLoading() { final LocalFileHandleResolver localFileHandleResolver = new LocalFileHandleResolver(); final AssetManager assetManager = new AssetManager(localFileHandleResolver); assetManager.setLoader(ShaderProgram.class, new ShaderLoader(localFileHandleResolver)); assetManager.load("default.vert+default.frag", ShaderProgram.class); assetManager.finishLoading(); final ShaderProgram program = assetManager.get("default.vert+default.frag", ShaderProgram.class); Assert.assertNotNull(program); assetManager.unload("default.vert+default.frag"); }
public ShaderManager(AssetManager assetManager) { this(assetManager, new ShaderLoader(new LocalFileHandleResolver())); }