/// <summary> /// Creates a new FileData object. /// </summary> /// <param name="contents">The contents of the file.</param> /// <param name="filename">The name of the file.</param> /// <returns></returns> public static FileData NewFileData(byte[] contents, string filename) { IntPtr out_file; Love2dDll.wrap_love_dll_filesystem_newFileData_content(contents, contents.Length, DllTool.GetNullTailUTF8Bytes(filename), out out_file); return(LoveObject.NewObject <FileData>(out_file)); }
/// <summary> /// Creates a new FileData object. /// </summary> /// <param name="file">The file.</param> /// <returns></returns> public static FileData NewFileData(File file) { IntPtr out_file; Love2dDll.wrap_love_dll_filesystem_newFileData_file(file.p, out out_file); return(LoveObject.NewObject <FileData>(out_file)); }
public static Shader NewShader(string vertexCodeStr, string pixelCodeStr) { IntPtr out_shader = IntPtr.Zero; string vertexCode, pixelCode; Love2dGraphicsShaderBoot.shaderCodeToGLSL(vertexCodeStr, pixelCodeStr, out vertexCode, out pixelCode); Love2dDll.wrap_love_dll_graphics_newShader(DllTool.ToUTF8Bytes(vertexCode), DllTool.ToUTF8Bytes(pixelCode), out out_shader); return(LoveObject.NewObject <Shader>(out_shader)); }
/// <summary> /// File which is created when a user drags and drops an actual file onto the /// LOVE game. Uses C's stdio. Filenames are system-dependent full paths. /// </summary> /// <param name="filename">The filename of the file.</param> /// <param name="fmode_type">The mode to open the file in.</param> public static File NewDroppedFile(string filename, FileMode fmode_type = FileMode.Read) { Love2dDll.wrap_love_dll_filesystem_newDroppedFile(DllTool.GetNullTailUTF8Bytes(filename), (int)fmode_type, out IntPtr out_file); return(LoveObject.NewObject <File>(out_file)); }