Package com.ardor3d.util

Examples of com.ardor3d.util.TextureKey


        try {
            ret = (TextureState) readSavableFromCurrentElem(null);
            final Savable[] savs = readSavableArray("texture", new Texture[0]);
            for (int i = 0; i < savs.length; i++) {
                Texture t = (Texture) savs[i];
                final TextureKey tKey = t.getTextureKey();
                t = TextureManager.loadFromKey(tKey, null, t);
                ret.setTexture(t, i);
            }
        } catch (final Exception e) {
            Logger.getLogger(DOMInputCapsule.class.getName()).log(Level.SEVERE, null, e);
View Full Code Here


        _minificationFilter = capsule.readEnum("minificationFilter", MinificationFilter.class,
                MinificationFilter.NearestNeighborNoMipMaps);
        _image = (Image) capsule.readSavable("image", null);

        // pull our key, if exists
        final TextureKey key = (TextureKey) capsule.readSavable("textureKey", null);
        if (key != null) {
            _key = TextureKey.getKey(key.getSource(), key.isFlipped(), key.getFormat(), key.getId(),
                    key.getMinificationFilter());
        } else {
            // none set, so pop in a generated key
            _key = TextureKey.getRTTKey(_minificationFilter);
        }
View Full Code Here

            magFilter = Texture.MagnificationFilter.Bilinear;
            minFilter = Texture.MinificationFilter.BilinearNoMipMaps;
            if (_useMipMaps) {
                minFilter = Texture.MinificationFilter.Trilinear;
            }
            final TextureKey tkey = TextureKey.getKey(texSrc, false, TextureStoreFormat.GuessNoCompressedFormat,
                    minFilter);
            _pageTexture = TextureManager.loadFromKey(tkey, null, null);
            _pageTexture.setMagnificationFilter(magFilter);

            // Add a touch higher mipmap selection.
View Full Code Here

                return 1;
            }

            for (int x = 0, maxIndex = Math.min(ts1.getMaxTextureIndexUsed(), ts2.getMaxTextureIndexUsed()); x <= maxIndex; x++) {

                final TextureKey key1 = ts1.getTextureKey(x);
                final TextureKey key2 = ts2.getTextureKey(x);

                if (key1 == null) {
                    if (key2 == null) {
                        continue;
                    } else {
                        return -1;
                    }
                } else if (key2 == null) {
                    return 1;
                }

                final int tid1 = key1.hashCode();
                final int tid2 = key2.hashCode();

                if (tid1 == tid2) {
                    continue;
                } else if (tid1 < tid2) {
                    return -1;
View Full Code Here

        // Create the texture...
        if (texture.getTextureKey() != null) {

            // Look for a texture in the cache just like ours
            final TextureKey texKey = texture.getTextureKey();
            final Texture cached = TextureManager.findCachedTexture(texKey);

            if (cached == null) {
                TextureManager.addToCache(texture);
            } else {
View Full Code Here

     */
    public static final Texture loadTexture(final BufferedImage image, final Texture.MinificationFilter minFilter,
            final TextureStoreFormat storeFormat, final boolean flipVertically) {
        final Image imageData = AWTImageLoader.makeArdor3dImage(image, flipVertically);
        final String fileType = (image != null) ? "" + image.hashCode() : null;
        final TextureKey tkey = TextureKey.getKey(null, flipVertically, storeFormat, fileType, minFilter);
        return TextureManager.loadFromKey(tkey, imageData, null);
    }
View Full Code Here

TOP

Related Classes of com.ardor3d.util.TextureKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.