Example #1
0
 public static Model Load(GraphicsDevice graphicsDevice, Stream stream, ModelMaterialTextureLoaderDelegate textureLoader)
 {
     using (var serializer = new ModelReader(graphicsDevice, stream, textureLoader))
     {
         return(serializer.ReadModel());
     }
 }
Example #2
0
        public ModelReader(GraphicsDevice graphicsDevice, Stream stream, ModelMaterialTextureLoaderDelegate textureLoader) : base(stream, SerializerMode.Read, ASCIIEncoding.ASCII)
        {
            if (graphicsDevice == null)
            {
                throw new ArgumentNullException("graphicsDevice");
            }

            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }

            if (textureLoader == null)
            {
                throw new ArgumentNullException("textureLoader");
            }

            GraphicsDevice        = graphicsDevice;
            TextureLoaderDelegate = textureLoader;
            ArrayLengthType       = ArrayLengthType.Int;
        }
Example #3
0
 public static Model Load(GraphicsDevice graphicsDevice, Stream stream, ModelMaterialTextureLoaderDelegate textureLoader)
 {
     using (var serializer = new ModelReader(graphicsDevice, stream, textureLoader))
     {
         return serializer.ReadModel();
     }
 }