protected void updateTextureCapabilities(final Texture _t) { _t.setCapability(Texture.ALLOW_ENABLE_READ); _t.setCapability(Texture.ALLOW_ENABLE_WRITE); _t.setCapability(Texture.ALLOW_FORMAT_READ); _t.setCapability(Texture.ALLOW_IMAGE_WRITE); _t.setCapability(Texture.ALLOW_IMAGE_READ); }
/** * affiche ou non le texture. */ public void setTextureEnable(final boolean _activee) { try { shape_.getAppearance().getTexture().setEnable(_activee); } catch (final Exception e) {} }
/** * Creates a texture from the given filename. * * @param imageURL Image file for creating texture. * @return The created Texture. * @throws RuntimeException if the file could not be read. */ private static Texture createTexture (String imageURL) { TextureLoader loader; try { loader = new TextureLoader(imageURL, "RGBA", TextureLoader.Y_UP, new Container()); } catch (Exception e) { throw new RuntimeException ("Could not read from the file '" + imageURL + "'"); } Texture texture = loader.getTexture(); texture.setBoundaryModeS(Texture.WRAP); texture.setBoundaryModeT(Texture.WRAP); texture.setBoundaryColor( new Color4f( 0.0f, 1.0f, 0.0f, 0.0f ) ); return texture; }
private Texture updateTexture(final File _f) { src_.setTextureImgUrl(_f); setIcon(_f); final Texture t = new TextureLoader(_f.getAbsolutePath(), pn_).getTexture(); t.setCapability(Texture.ALLOW_ENABLE_WRITE); t.setCapability(Texture.ALLOW_ENABLE_READ); t.setEnable(chbEnable_.isSelected()); src_.setTexture(t); src_.setTextureAttributesMode(getMode()); return t; }
public boolean isTextureEnable() { try { if (shape_.getAppearance().getTexture() != null) { return shape_.getAppearance().getTexture().getEnable(); } } catch (final RuntimeException _evt) { FuLog.error(_evt); } return false; }
Texture tex = appearance.getTexture(); if ( tex != null ) { ImageComponent ic = tex.getImage( 0 ); if ( ic != null ) { if ( ic instanceof ImageComponent2D ) {
/** * Creates a texture from the given filename. * * @param imageURL Image file for creating texture. * @return The created Texture. * @throws RuntimeException if the file could not be read. */ private static Texture createTexture (String imageURL) { TextureLoader loader; try { loader = new TextureLoader(imageURL, "RGBA", TextureLoader.Y_UP, new Container()); } catch (Exception e) { throw new RuntimeException ("Could not read from the file '" + imageURL + "'"); } Texture texture = loader.getTexture(); texture.setBoundaryModeS(Texture.WRAP); texture.setBoundaryModeT(Texture.WRAP); texture.setBoundaryColor( new Color4f( 0.0f, 1.0f, 0.0f, 0.0f ) ); return texture; }
fichier_.setText(shortname); final Texture t = new TextureLoader(filename, parent_).getTexture(); t.setCapability(Texture.ALLOW_ENABLE_WRITE); t.setEnable(activee_.isSelected()); this.firePropertyChange("texture", null, t); prevue_ = imageCompo_.getToolkit().createImage(filename);