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}); }
// 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}); }