/** * Force all of the textures to load. This prevents pauses later during the application as you pan around the world. */ public void preloadTextures(final Renderer r) { for (int x = 0; x < 6; x++) { final TextureState ts = (TextureState) _skyboxQuads[x].getLocalRenderState(RenderState.StateType.Texture); if (ts != null) { r.applyState(StateType.Texture, ts); } } }
/** * Force all of the textures to load. This prevents pauses later during the application as you pan around the world. */ public void preloadTextures(final Renderer r) { for (int x = 0; x < 6; x++) { final TextureState ts = (TextureState) _skyboxQuads[x].getLocalRenderState(RenderState.StateType.Texture); if (ts != null) { r.applyState(StateType.Texture, ts); } } }
public Texture getTexture(final Face face) { if (face == null) { throw new IllegalArgumentException("Face can not be null."); } return ((TextureState) _skyboxQuads[face.ordinal()].getLocalRenderState(RenderState.StateType.Texture)) .getTexture(); }
public Texture getTexture(final Face face) { if (face == null) { throw new IllegalArgumentException("Face can not be null."); } return ((TextureState) _skyboxQuads[face.ordinal()].getLocalRenderState(RenderState.StateType.Texture)) .getTexture(); }
public void preloadTexture(final Face face, final Renderer r) { final TextureState ts = (TextureState) _skyboxQuads[face.ordinal()] .getLocalRenderState(RenderState.StateType.Texture); if (ts != null) { r.applyState(StateType.Texture, ts); } }
public void preloadTexture(final Face face, final Renderer r) { final TextureState ts = (TextureState) _skyboxQuads[face.ordinal()] .getLocalRenderState(RenderState.StateType.Texture); if (ts != null) { r.applyState(StateType.Texture, ts); } }
/** * Set the texture to be displayed on the given side of the skybox. Only replaces the texture at the index specified * by textureUnit. * * @param face * the face to set * @param texture * The texture for that side to assume. * @param textureUnit * The texture unite of the given side's TextureState the texture will assume. */ public void setTexture(final Face face, final Texture texture, final int textureUnit) { // Validate if (face == null) { throw new IllegalArgumentException("Face can not be null."); } TextureState ts = (TextureState) _skyboxQuads[face.ordinal()] .getLocalRenderState(RenderState.StateType.Texture); if (ts == null) { ts = new TextureState(); } // Initialize the texture state ts.setTexture(texture, textureUnit); ts.setEnabled(true); texture.setWrap(WrapMode.EdgeClamp); // Set the texture to the quad _skyboxQuads[face.ordinal()].setRenderState(ts); return; }
/** * Set the texture to be displayed on the given side of the skybox. Only replaces the texture at the index specified * by textureUnit. * * @param face * the face to set * @param texture * The texture for that side to assume. * @param textureUnit * The texture unite of the given side's TextureState the texture will assume. */ public void setTexture(final Face face, final Texture texture, final int textureUnit) { // Validate if (face == null) { throw new IllegalArgumentException("Face can not be null."); } TextureState ts = (TextureState) _skyboxQuads[face.ordinal()] .getLocalRenderState(RenderState.StateType.Texture); if (ts == null) { ts = new TextureState(); } // Initialize the texture state ts.setTexture(texture, textureUnit); ts.setEnabled(true); texture.setWrap(WrapMode.EdgeClamp); // Set the texture to the quad _skyboxQuads[face.ordinal()].setRenderState(ts); return; }
double locationX = cam.getWidth(), locationY = cam.getHeight(); bQuad.resize(size, (cam.getHeight() / (double) cam.getWidth()) * size); if (bQuad.getLocalRenderState(RenderState.StateType.Texture) == null) { final TextureState ts = new TextureState(); bufTexture = new Texture2D();
double locationX = cam.getWidth(), locationY = cam.getHeight(); bQuad.resize(size, (cam.getHeight() / (double) cam.getWidth()) * size); if (bQuad.getLocalRenderState(RenderState.StateType.Texture) == null) { final TextureState ts = new TextureState(); bufTexture = new Texture2D();