Esempio n. 1
0
        /// <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));
        }
Esempio n. 2
0
        /// <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));
        }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
 /// <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));
 }