Beispiel #1
0
        public SSTexture(SSAssetManager.Context ctx, string filename)
            : this()
        {
            Bitmap textureBitmap = new Bitmap(ctx.Open(filename));

            loadFromBitmap(textureBitmap, name: filename);
        }
        public SSTextureWithAlpha(SSAssetManager.Context ctx, string filename)
            : base()
        {
            Bitmap textureBitmap = new Bitmap(ctx.Open(filename));

            loadFromBitmap(textureBitmap, name: filename, hasAlpha: true);
        }
Beispiel #3
0
 public static FontFamily[] loadFontFamilies(SSAssetManager.Context ctx, string filename)
 {
 var stream = ctx.Open(filename);
 var binReader = new BinaryReader (stream);
 byte[] bytes = binReader.ReadBytes(int.MaxValue);
 var fontCollection = new PrivateFontCollection ();
 unsafe {
 fixed (byte* ptr = bytes) {
 fontCollection.AddMemoryFont(new IntPtr (ptr), bytes.Length);
 }
 }
 return fontCollection.Families;
 }
Beispiel #4
0
        public SSMesh_wfOBJ(SSAssetManager.Context ctx, string filename)
        {
            this.srcFilename = filename;
            this.ctx         = ctx;


            Console.WriteLine("SSMesh_wfOBJ: loading wff {0}", filename);
            WavefrontObjLoader wff_data = new WavefrontObjLoader(filename,
                                                                 delegate(string resourceName) { return(ctx.Open(resourceName)); });

            Console.WriteLine("wff vertex count = {0}", wff_data.positions.Count);
            Console.WriteLine("wff face count = {0}", wff_data.numFaces);

            _loadData(ctx, wff_data);
        }
Beispiel #5
0
 public SSVertexShader(SSAssetManager.Context context, string filename)
     : base(ShaderType.VertexShader,
            filename,
            context.Open(filename).AsString())
 {
 }