Java Code Examples for com.badlogic.gdx.graphics.Texture.TextureFilter#MipMapLinearLinear
The following examples show how to use
com.badlogic.gdx.graphics.Texture.TextureFilter#MipMapLinearLinear .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GLTFTypes.java From gdx-gltf with Apache License 2.0 | 5 votes |
public static TextureFilter mapTextureMinFilter(Integer filter) { if(filter == null) return TextureFilter.Linear; switch(filter){ case 9728: return TextureFilter.Nearest; case 9729: return TextureFilter.Linear; case 9984: return TextureFilter.MipMapNearestNearest; case 9985: return TextureFilter.MipMapLinearNearest; case 9986: return TextureFilter.MipMapNearestLinear; case 9987: return TextureFilter.MipMapLinearLinear; } throw new GdxRuntimeException("unexpected texture mag filter " + filter); }
Example 2
Source File: CreateAtlasDialog.java From bladecoder-adventure-engine with Apache License 2.0 | 4 votes |
private void genAtlas() { String outdir = Ctx.project.getAssetPath() + Project.ATLASES_PATH; List<String> res = Ctx.project.getResolutions(); String name = this.name.getText(); String fMin = filterMin.getText(); String fMag = filterMag.getText(); TextureFilter filterMin = null, filterMag = null; if (fMin.equals("Linear")) filterMin = TextureFilter.Linear; else if (fMin.equals("Nearest")) filterMin = TextureFilter.Nearest; else if (fMin.equals("MipMap")) filterMin = TextureFilter.MipMap; else if (fMin.equals("MipMapLinearLinear")) filterMin = TextureFilter.MipMapLinearLinear; else if (fMin.equals("MipMapLinearNearest")) filterMin = TextureFilter.MipMapLinearNearest; else if (fMin.equals("MipMapNearestLinear")) filterMin = TextureFilter.MipMapNearestLinear; else if (fMin.equals("MipMapNearestNearest")) filterMin = TextureFilter.MipMapNearestNearest; if (fMag.equals("Linear")) filterMag = TextureFilter.Linear; else if (fMag.equals("Nearest")) filterMag = TextureFilter.Nearest; else if (fMag.equals("MipMap")) filterMag = TextureFilter.MipMap; else if (fMag.equals("MipMapLinearLinear")) filterMag = TextureFilter.MipMapLinearLinear; else if (fMag.equals("MipMapLinearNearest")) filterMag = TextureFilter.MipMapLinearNearest; else if (fMag.equals("MipMapNearestLinear")) filterMag = TextureFilter.MipMapNearestLinear; else if (fMag.equals("MipMapNearestNearest")) filterMag = TextureFilter.MipMapNearestNearest; int maxW = Integer.parseInt(maxWidth.getText()); int maxH = Integer.parseInt(maxHeight.getText()); for (String r : res) { float scale = Float.parseFloat(r); try { ImageUtils.createAtlas(dir.getText(), outdir + "/" + r, name + ".atlas", scale, (int) (maxW * scale), (int) (maxH * scale), filterMin, filterMag, outputFormat.getText(), true); } catch (IOException e) { EditorLogger.error(e.getMessage()); Message.showMsgDialog(getStage(), "Error creating atlas", e.getMessage()); return; } } Message.hideMsg(); }