Пример #1
0
 public override void Release(MetaT metaResource, ContentPool content, Model10 resource)
 {
     if (resource.Mesh != null)
     {
         content.Release(resource.Mesh);
     }
     if (!resource.TextureShaderView.Disposed)
     {
         content.Release(resource.TextureShaderView.Resource);
         content.Release(resource.TextureShaderView);
     }
 }
Пример #2
0
            public override Model10 Construct(MetaT metaResource, ContentPool content)
            {
                var     glyphs = metaResource.BuildGlyphs();
                Model10 m      = new Model10
                {
                    TextureShaderView = content.Acquire <SlimDX.Direct3D10.ShaderResourceView>(new TextureShaderView
                    {
                        Texture =
                            content.Acquire <SlimDX.Direct3D10.Texture2D>(metaResource.Texture)
                    }),
                    Mesh = content.Acquire <Mesh10>(new MeshConcretize {
                        MetaMesh = glyphs, Layout = Software.Vertex.PositionTexcoord.Instance
                    }),
                    World = Matrix.Translation(metaResource.Position)
                };

                return(m);
            }