static internal IntPtr FromGlyphToUnManagedMemory(Glyph [] glyphs) { IntPtr dest = Marshal.AllocHGlobal(native_glyph_size * glyphs.Length); long pos = dest.ToInt64(); if (c_compiler_long_size == 8) { foreach (Glyph g in glyphs) { Marshal.StructureToPtr(g, (IntPtr)pos, false); pos += native_glyph_size; } } else { foreach (Glyph g in glyphs) { NativeGlyph_4byte_longs n = new NativeGlyph_4byte_longs(g); Marshal.StructureToPtr(n, (IntPtr)pos, false); pos += native_glyph_size; } } return(dest); }
internal static IntPtr FromGlyphToUnManagedMemory(Glyph [] glyphs) { IntPtr dest = Marshal.AllocHGlobal (native_glyph_size * glyphs.Length); long pos = dest.ToInt64(); if (c_compiler_long_size == 8){ foreach (Glyph g in glyphs){ Marshal.StructureToPtr (g, (IntPtr)pos, false); pos += native_glyph_size; } } else { foreach (Glyph g in glyphs){ NativeGlyph_4byte_longs n = new NativeGlyph_4byte_longs (g); Marshal.StructureToPtr (n, (IntPtr)pos, false); pos += native_glyph_size; } } return dest; }