Esempio n. 1
0
        /// <summary>
        /// Creates a new instance of this material. Material instances should be freed using
        /// <see cref="Engine.Destroy(MaterialInstance)"/>.
        /// </summary>
        /// <returns>The newly created instance.</returns>
        public MaterialInstance CreateInstance()
        {
            ThrowExceptionIfDisposed();

            return(MaterialInstance.GetOrCreateCache(
                       Native.Material.CreateInstance(NativePtr)
                       ));
        }
        /// <summary>
        /// Retrieves the material instance that is bound to the given primitive.
        /// </summary>
        public MaterialInstance GetMaterialInstanceAt(int instance, int primitiveIndex)
        {
            ThrowExceptionIfDisposed();

            return(MaterialInstance.GetOrCreateCache(
                       Native.RenderableManager.GetMaterialInstanceAt(NativePtr, instance, primitiveIndex)
                       ));
        }