Beispiel #1
0
        public Surface(XElement node)
        {
            TextureScale = node.Element(XmlTag.TextureScale).As <int>();
            var sz   = node.Element(XmlTag.Size).As <v2>();
            var sx   = (int)Math.Max(1.0, sz.x + 0.5);
            var sy   = (int)Math.Max(1.0, sz.y + 0.5);
            var opts = new View3d.TextureOptions
            {
                GdiCompatible = true,
            };

            Surf = new View3d.Texture(sx, sy, opts);            // D3D11_FILTER_ANISOTROPIC});
        }
Beispiel #2
0
        // Notes:
        //  - A wrapper around a view3d texture
        public Surface(int sx, int sy, double texture_scale = 2, string?dbg_name = null)
        {
            Debug.Assert(texture_scale > 0);
            TextureScale = texture_scale;

            sx = (int)Math.Max(1.0, sx * TextureScale + 0.5);
            sy = (int)Math.Max(1.0, sy * TextureScale + 0.5);
            var opts = new View3d.TextureOptions
            {
                GdiCompatible = true,
                DbgName       = dbg_name ?? string.Empty
            };

            Surf = new View3d.Texture(sx, sy, opts);            // D3D11_FILTER_ANISOTROPIC});
        }