/[gr2lib]/trunk/gr2lib/core/coreapi/coreapi.cs
ViewVC logotype

Contents of /trunk/gr2lib/core/coreapi/coreapi.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 145 - (show annotations) (download)
Mon Jul 19 09:39:21 2010 UTC (10 years ago) by william
File size: 3261 byte(s)
coreapi.GrannyCopyTextureImage -> Finially got a return value of true from the copy function.
Will have to check and see what exactly was copied

1 using System;
2 using System.Runtime.InteropServices;
3
4 using gr2lib.core.typedefs;
5 using gr2lib.core.coretypes;
6 using gr2lib.core.coretypes.native;
7 //using gr2lib.core.coretypes;
8
9 namespace gr2lib.core
10 {
11 public class coreapi
12 {
13 #region INTEROP SUPPORT
14 [DllImport("kernel32", CharSet = CharSet.Ansi, ExactSpelling = true, SetLastError = true)]
15 public static extern IntPtr GetProcAddress(IntPtr hModule, string procName);
16 [DllImport("kernel32", SetLastError = true)]
17 public static extern IntPtr LoadLibrary(string lpFileName);
18 #endregion
19
20 #region Granny2 API Version Support
21 [DllImport("granny2.dll", EntryPoint = "GrannyVersionsMatch_", CallingConvention = CallingConvention.StdCall)]
22 internal static extern bool GrannyVersionsMatch(granny_int32x MajorVersion, granny_int32x MinorVersion, granny_int32x Customization, granny_int32x BuildNumber);
23 [DllImport("granny2.dll", EntryPoint = "GrannyGetVersion", CallingConvention = CallingConvention.StdCall)]
24 internal static extern void GrannyGetVersion(ref granny_int32x MajorVersion, ref granny_int32x MinorVersion, ref granny_int32x Customization, ref granny_int32x BuildNumber);
25 [DllImport("granny2.dll", EntryPoint = "GrannyGetVersionString", CallingConvention = CallingConvention.StdCall)]
26 internal static extern string GrannyGetVersionString();
27 #endregion
28
29 #region Granny2 API File Loading Support
30 [DllImport("granny2.dll", EntryPoint = "GrannyReadEntireFile", CallingConvention = CallingConvention.StdCall)]
31 public static extern IntPtr GrannyReadEntireFile(string fileName);
32 [DllImport("granny2.dll", EntryPoint = "GrannyGetFileInfo", CallingConvention = CallingConvention.StdCall)]
33 public static extern IntPtr GetFileInfo(IntPtr file);
34 [DllImport("granny2.dll", EntryPoint = "GrannyFreeFile", CallingConvention = CallingConvention.StdCall)]
35 public static extern void FreeFile(IntPtr pointer);
36 #endregion
37
38 #region Granny2 API Header Support
39 [DllImport("granny2.dll", EntryPoint = "GrannyGetFileTypeTag", CallingConvention = CallingConvention.StdCall)]
40 public static extern int GrannyGetFileTypeTag(IntPtr File);
41 #endregion
42
43 #region Granny2 API Granny Texture Format Support
44
45 //extern GRANNY_DYNLINKDATA(granny_data_type_definition *) GrannyPixelLayoutType;
46 //[Obsolete("GrannyCopyTextureImage() -- currently does not work [need to research this more]", true)]
47 [DllImport("granny2.dll", EntryPoint = "_GrannyCopyTextureImage@32", CallingConvention = CallingConvention.StdCall)]
48 public static extern bool GrannyCopyTextureImage(IntPtr Texture,
49 int ImageIndex,
50 int MIPIndex,
51 IntPtr Layout,
52 int DestWidth,
53 int DestHeight,
54 int DestStride,
55 IntPtr Pixels);
56 #endregion
57 }
58 }

  ViewVC Help
Powered by ViewVC 1.1.22