/** Creates a new AssetManager with all default loaders. */ public AssetManager (FileHandleResolver resolver) { setLoader(BitmapFont.class, new BitmapFontLoader(resolver)); setLoader(Music.class, new MusicLoader(resolver)); setLoader(Pixmap.class, new PixmapLoader(resolver)); setLoader(Sound.class, new SoundLoader(resolver)); setLoader(TextureAtlas.class, new TextureAtlasLoader(resolver)); setLoader(Texture.class, new TextureLoader(resolver)); setLoader(Skin.class, new SkinLoader(resolver)); setLoader(ParticleEffect.class, new ParticleEffectLoader(resolver)); setLoader(PolygonRegion.class, new PolygonRegionLoader(resolver)); setLoader(I18NBundle.class, new I18NBundleLoader(resolver)); setLoader(Model.class, ".g3dj", new G3dModelLoader(new JsonReader(), resolver)); setLoader(Model.class, ".g3db", new G3dModelLoader(new UBJsonReader(), resolver)); setLoader(Model.class, ".obj", new ObjLoader(resolver)); executor = new AsyncExecutor(1); }
public void report() { try { AsyncExecutor asyncExecutor = new AsyncExecutor(1); asyncExecutor.submit(this); asyncExecutor.dispose(); asyncExecutor.dispose(); } catch (Exception e) { e.printStackTrace(); } }
public AssetLoadingTask (AssetManager manager, AssetDescriptor assetDesc, AssetLoader loader, AsyncExecutor threadPool) { this.manager = manager; this.assetDesc = assetDesc; this.loader = loader; this.executor = threadPool; startTime = manager.log.getLevel() == Logger.DEBUG ? TimeUtils.nanoTime() : 0; }
@Override public void create() { super.create(); executor = new AsyncExecutor(1); // prepare rendering aids shapeRenderer = new ShapeRenderer(); Gdx.input.setInputProcessor(this); }
public JavityNetJavaImpl () { asyncExecutor = new AsyncExecutor(10); connections = new ObjectMap<HttpRequest, HttpURLConnection>(); listeners = new ObjectMap<HttpRequest, HttpResponseListener>(); }
@Override public void create() { super.create(); executor = new AsyncExecutor(1); // create a string of generally-overlapping polygons, will draw in // blue GeoTester.randomPolys(3, 40, 80, new Vector2(100, 300), blue); float s = 10; Polygon p0 = new Polygon(new float[] { // north-west, low, north-east 0, 3 * s, 0, 2 * s, 2 * s, 0, 3 * s, 0, 4.5f * s, 2 * s, 6 * s, 0, 7 * s, 0, 9 * s, 2 * s, 9 * s, 3 * s, // north-east, high, north-west 8 * s, 3 * s, 6.5f * s, 1 * s, 5 * s, 3 * s, 4 * s, 3 * s, 2.5f * s, s, 1 * s, 3 * s }); blue.add(p0); // merge them into a single polygon, will draw in red for (Polygon bp : blue) { GeometryUtils.merge(geo, bp); } Geometry collapsed = GeometryUtils.collapse(geo); Polygon p = GeometryUtils.jtsCoordsToGdx(collapsed.getCoordinates()); red.add(p); triangles = GeometryUtils.triangulate(collapsed); Gdx.app.error("GeoTester", "ready to display triangles worth " + triangles.length + " vertices"); // use the polygon to clip a randomly-generated texture textureSolid = new Texture(GeoTester.randomPixmap(100, 100, null), false); PolygonRegion polyReg = new PolygonRegion(new TextureRegion( textureSolid), p.getVertices(), triangles); poly = new PolygonSprite(polyReg); poly.setOrigin(p.getVertices()[0], p.getVertices()[1]); polyBatch = new PolygonSpriteBatch(); // prepare rendering aids shapeRenderer = new ShapeRenderer(); Gdx.input.setInputProcessor(this); }
public BackgroundExecutor() { tasks = new Array<Execution>(); this.asyncExecutor = new AsyncExecutor(Math.max(1, Runtime.getRuntime() .availableProcessors() - 1)); }