From 7c88b3614ae4a7f12e46d6499da60c085ec29335 Mon Sep 17 00:00:00 2001 From: yyc12345 Date: Sat, 21 Sep 2024 16:50:53 +0800 Subject: [PATCH] fix: update BMap bindings - send message in console if PyBMap fail to load native dynamic library. this is good for user experience. - remove snippet from BMap bindings generator. We now insert generated code manually. - fix C sharp code generation issue in BMap bidnings generator. - add some content for BMapSharp. --- BMapBindings/BMapSharp/BMap.cs | 1038 +++++++++++++++++++++++ BMapBindings/BMapSharp/BMapSharp.csproj | 12 +- BMapBindings/BMapSharp/BMapWrapper.cs | 2 +- BMapBindings/BMapSharp/VirtoolsTypes.cs | 98 ++- BMapBindings/PyBMap/PyBMap/bmap.py | 12 +- CodeGen/BMapBindings/CSharpWriter.java | 12 +- CodeGen/BMapBindings/CommonHelper.java | 26 +- CodeGen/BMapBindings/PythonWriter.java | 12 - CodeGen/BMapBindings/snippets/header.py | 106 --- 9 files changed, 1170 insertions(+), 148 deletions(-) delete mode 100644 CodeGen/BMapBindings/snippets/header.py diff --git a/BMapBindings/BMapSharp/BMap.cs b/BMapBindings/BMapSharp/BMap.cs index 48ed6c0..d253e40 100644 --- a/BMapBindings/BMapSharp/BMap.cs +++ b/BMapBindings/BMapSharp/BMap.cs @@ -1,8 +1,1046 @@ using System; using System.Runtime.InteropServices; +using System.Text; +using BMapSharp.VirtoolsTypes; namespace BMapSharp { + public static class BMap { + /// The callback function of BMap. + /// The message content need to be printed. + public delegate void OutputCallback([In, MarshalAs(UnmanagedType.LPUTF8Str)] string msg); + + /// The custom marshaler for BMap string array. + public class BMStringArrayMarshaler : ICustomMarshaler { + // References: + // https://stackoverflow.com/questions/18498452/how-do-i-write-a-custom-marshaler-which-allows-data-to-flow-from-native-to-manag + // https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-runtime-interopservices-icustommarshaler + // + // NOTE: I do not create a member to store the object we are marshaling. + // Because my binding do not have In, Out parameter. All parameters are In OR Out. + // So there is no reason to keep that member. + + private static BMStringArrayMarshaler g_Instance; + public static ICustomMarshaler GetInstance(string pstrCookie) { + if (g_Instance is null) g_Instance = new BMStringArrayMarshaler(); + return g_Instance; + } + + public IntPtr MarshalManagedToNative(object ManagedObj) { + if (ManagedObj is null) return IntPtr.Zero; + + string[] castManagedObj = ManagedObj as string[]; + if (castManagedObj is null) + throw new MarshalDirectiveException("BMStringArrayMashaler must be used on an string array."); + + // Allocate array pointer first. + // We need allocated memory with extra item and set it to zero later. + // Because we don't have any idea to check the length of this array when free it. + // Although native BMap library do not need this extra NULL terminal. + int szArrayItemSize = Marshal.SizeOf(); + IntPtr pArray = Marshal.AllocHGlobal(szArrayItemSize * (castManagedObj.Length + 1)); + + // The allocate string data one by one. + for (int i = 0; i < castManagedObj.Length; ++i) { + // Encode string first. + byte[] encString = Encoding.UTF8.GetBytes(castManagedObj[i]); + // Allocate string memory with extra NULL terminal. + int szStringItemSize = Marshal.SizeOf(); + IntPtr pString = Marshal.AllocHGlobal(szStringItemSize * (encString.Length + 1)); + // Copy data into it. + Marshal.Copy(encString, 0, pString, szStringItemSize * encString.Length); + // Set NULL terminal. + Marshal.WriteByte(pString, szStringItemSize * encString.Length, 0); + // Add into pointer array + Marshal.WriteIntPtr(pArray, szArrayItemSize * i, pString); + } + + // Write array NULL terminal + Marshal.WriteIntPtr(pArray, szArrayItemSize * castManagedObj.Length, IntPtr.Zero); + + // Return value + return pArray; + } + + public object MarshalNativeToManaged(IntPtr pNativeData) { + if (pNativeData == IntPtr.Zero) return null; + + // Iterate the array until we reach the NULL terminal. + // And save all we meet string. + int szArrayItemSize = Marshal.SizeOf(); + IntPtr pArray = pNativeData; + int index = 0; + while (true) { + // Get the pointer of this string. + IntPtr pString = Marshal.ReadIntPtr(pArray, szArrayItemSize * index); + // If it is NULL terminal, break the while. + if (pString == IntPtr.Zero) break; + + // Read string into buffer and + Marshal.FreeHGlobal(pString); + ++index; + } + } + + public void CleanUpNativeData(IntPtr pNativeData) { + if (pNativeData == IntPtr.Zero) return; + + // Iterate the array until we reach the NULL terminal. + // And free every string we meet. + int szArrayItemSize = Marshal.SizeOf(); + IntPtr pArray = pNativeData; + int index = 0; + while (true) { + // Get the pointer of this string. + IntPtr pString = Marshal.ReadIntPtr(pArray, szArrayItemSize * index); + // If it is NULL terminal, break the while. + if (pString == IntPtr.Zero) break; + // Free string and move index to next one. + Marshal.FreeHGlobal(pString); + ++index; + } + + // Now free the array self. + Marshal.FreeHGlobal(pArray); + } + + public void CleanUpManagedData(object ManagedObj) { + // Do nothing, because managed data do not need any clean up. + } + + public int GetNativeDataSize() { + return -1; + } + + } + + // Decide the file name of loaded DLL. + +#if BMAP_OS_WINDOWS + private const string g_DllName = "BMap.dll"; +#elif BMAP_OS_LINUX + private const string g_DllName = "BMap.so"; +#elif BMAP_OS_MACOS + private const string g_DllName = "BMap.dylib"; +#else + private const string g_DllName = "BMap.bin"; +#endif + + #region Function Defines + + // ##### GENERATED FUNCTIONS BEGIN ##### + + /// BMInit + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMInit", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMInit(); + /// BMDispose + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMDispose", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMDispose(); + /// BMFile_Load + /// Type: LibCmo::CKSTRING. + /// Type: LibCmo::CKSTRING. + /// Type: LibCmo::CKSTRING. + /// Type: BMap::NakedOutputCallback. + /// Type: LibCmo::CKDWORD. + /// Type: LibCmo::CKSTRING*. + /// Type: BMap::BMFile*. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMFile_Load", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMFile_Load([In, MarshalAs(UnmanagedType.LPUTF8Str)] string file_name, [In, MarshalAs(UnmanagedType.LPUTF8Str)] string temp_folder, [In, MarshalAs(UnmanagedType.LPUTF8Str)] string texture_folder, [In, MarshalAs(UnmanagedType.FunctionPtr)] OutputCallback raw_callback, [In, MarshalAs(UnmanagedType.U4)] uint encoding_count, [In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(BMStringArrayMarshaler))] string[] encodings, [Out, MarshalAs(UnmanagedType.SysInt)] out IntPtr out_file); + /// BMFile_Create + /// Type: LibCmo::CKSTRING. + /// Type: LibCmo::CKSTRING. + /// Type: BMap::NakedOutputCallback. + /// Type: LibCmo::CKDWORD. + /// Type: LibCmo::CKSTRING*. + /// Type: BMap::BMFile*. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMFile_Create", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMFile_Create([In, MarshalAs(UnmanagedType.LPUTF8Str)] string temp_folder, [In, MarshalAs(UnmanagedType.LPUTF8Str)] string texture_folder, [In, MarshalAs(UnmanagedType.FunctionPtr)] OutputCallback raw_callback, [In, MarshalAs(UnmanagedType.U4)] uint encoding_count, [In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(BMStringArrayMarshaler))] string[] encodings, [Out, MarshalAs(UnmanagedType.SysInt)] out IntPtr out_file); + /// BMFile_Save + /// Type: BMap::BMFile*. + /// Type: LibCmo::CKSTRING. + /// Type: LibCmo::CK2::CK_TEXTURE_SAVEOPTIONS. + /// Type: bool. + /// Type: LibCmo::CKINT. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMFile_Save", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMFile_Save([In, MarshalAs(UnmanagedType.SysInt)] IntPtr map_file, [In, MarshalAs(UnmanagedType.LPUTF8Str)] string file_name, [In, MarshalAs(UnmanagedType.U4)] uint texture_save_opt, [In, MarshalAs(UnmanagedType.U1)] bool use_compress, [In, MarshalAs(UnmanagedType.I4)] int compreess_level); + /// BMFile_Free + /// Type: BMap::BMFile*. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMFile_Free", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMFile_Free([In, MarshalAs(UnmanagedType.SysInt)] IntPtr map_file); + /// BMFile_GetGroupCount + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CKDWORD. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMFile_GetGroupCount", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMFile_GetGroupCount([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [Out, MarshalAs(UnmanagedType.U4)] out uint out_count); + /// BMFile_GetGroup + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CKDWORD. + /// Type: LibCmo::CK2::CK_ID. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMFile_GetGroup", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMFile_GetGroup([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint idx, [Out, MarshalAs(UnmanagedType.U4)] out uint out_id); + /// BMFile_CreateGroup + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMFile_CreateGroup", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMFile_CreateGroup([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [Out, MarshalAs(UnmanagedType.U4)] out uint out_id); + /// BMFile_Get3dObjectCount + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CKDWORD. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMFile_Get3dObjectCount", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMFile_Get3dObjectCount([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [Out, MarshalAs(UnmanagedType.U4)] out uint out_count); + /// BMFile_Get3dObject + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CKDWORD. + /// Type: LibCmo::CK2::CK_ID. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMFile_Get3dObject", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMFile_Get3dObject([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint idx, [Out, MarshalAs(UnmanagedType.U4)] out uint out_id); + /// BMFile_Create3dObject + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMFile_Create3dObject", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMFile_Create3dObject([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [Out, MarshalAs(UnmanagedType.U4)] out uint out_id); + /// BMFile_GetMeshCount + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CKDWORD. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMFile_GetMeshCount", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMFile_GetMeshCount([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [Out, MarshalAs(UnmanagedType.U4)] out uint out_count); + /// BMFile_GetMesh + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CKDWORD. + /// Type: LibCmo::CK2::CK_ID. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMFile_GetMesh", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMFile_GetMesh([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint idx, [Out, MarshalAs(UnmanagedType.U4)] out uint out_id); + /// BMFile_CreateMesh + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMFile_CreateMesh", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMFile_CreateMesh([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [Out, MarshalAs(UnmanagedType.U4)] out uint out_id); + /// BMFile_GetMaterialCount + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CKDWORD. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMFile_GetMaterialCount", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMFile_GetMaterialCount([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [Out, MarshalAs(UnmanagedType.U4)] out uint out_count); + /// BMFile_GetMaterial + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CKDWORD. + /// Type: LibCmo::CK2::CK_ID. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMFile_GetMaterial", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMFile_GetMaterial([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint idx, [Out, MarshalAs(UnmanagedType.U4)] out uint out_id); + /// BMFile_CreateMaterial + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMFile_CreateMaterial", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMFile_CreateMaterial([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [Out, MarshalAs(UnmanagedType.U4)] out uint out_id); + /// BMFile_GetTextureCount + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CKDWORD. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMFile_GetTextureCount", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMFile_GetTextureCount([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [Out, MarshalAs(UnmanagedType.U4)] out uint out_count); + /// BMFile_GetTexture + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CKDWORD. + /// Type: LibCmo::CK2::CK_ID. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMFile_GetTexture", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMFile_GetTexture([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint idx, [Out, MarshalAs(UnmanagedType.U4)] out uint out_id); + /// BMFile_CreateTexture + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMFile_CreateTexture", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMFile_CreateTexture([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [Out, MarshalAs(UnmanagedType.U4)] out uint out_id); + /// BMMeshTrans_New + /// Type: BMap::BMMeshTransition*. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMeshTrans_New", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMeshTrans_New([Out, MarshalAs(UnmanagedType.SysInt)] out IntPtr out_trans); + /// BMMeshTrans_Delete + /// Type: BMap::BMMeshTransition*. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMeshTrans_Delete", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMeshTrans_Delete([In, MarshalAs(UnmanagedType.SysInt)] IntPtr trans); + /// BMMeshTrans_PrepareVertexCount + /// Type: BMap::BMMeshTransition*. The pointer to corresponding BMMeshTransition. + /// Type: LibCmo::CKDWORD. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMeshTrans_PrepareVertexCount", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMeshTrans_PrepareVertexCount([In, MarshalAs(UnmanagedType.SysInt)] IntPtr trans, [In, MarshalAs(UnmanagedType.U4)] uint count); + /// BMMeshTrans_PrepareVertex + /// Type: BMap::BMMeshTransition*. The pointer to corresponding BMMeshTransition. + /// Type: LibCmo::VxMath::VxVector3*. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMeshTrans_PrepareVertex", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMeshTrans_PrepareVertex([In, MarshalAs(UnmanagedType.SysInt)] IntPtr trans, [Out, MarshalAs(UnmanagedType.SysInt)] out IntPtr out_mem); + /// BMMeshTrans_PrepareNormalCount + /// Type: BMap::BMMeshTransition*. The pointer to corresponding BMMeshTransition. + /// Type: LibCmo::CKDWORD. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMeshTrans_PrepareNormalCount", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMeshTrans_PrepareNormalCount([In, MarshalAs(UnmanagedType.SysInt)] IntPtr trans, [In, MarshalAs(UnmanagedType.U4)] uint count); + /// BMMeshTrans_PrepareNormal + /// Type: BMap::BMMeshTransition*. The pointer to corresponding BMMeshTransition. + /// Type: LibCmo::VxMath::VxVector3*. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMeshTrans_PrepareNormal", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMeshTrans_PrepareNormal([In, MarshalAs(UnmanagedType.SysInt)] IntPtr trans, [Out, MarshalAs(UnmanagedType.SysInt)] out IntPtr out_mem); + /// BMMeshTrans_PrepareUVCount + /// Type: BMap::BMMeshTransition*. The pointer to corresponding BMMeshTransition. + /// Type: LibCmo::CKDWORD. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMeshTrans_PrepareUVCount", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMeshTrans_PrepareUVCount([In, MarshalAs(UnmanagedType.SysInt)] IntPtr trans, [In, MarshalAs(UnmanagedType.U4)] uint count); + /// BMMeshTrans_PrepareUV + /// Type: BMap::BMMeshTransition*. The pointer to corresponding BMMeshTransition. + /// Type: LibCmo::VxMath::VxVector2*. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMeshTrans_PrepareUV", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMeshTrans_PrepareUV([In, MarshalAs(UnmanagedType.SysInt)] IntPtr trans, [Out, MarshalAs(UnmanagedType.SysInt)] out IntPtr out_mem); + /// BMMeshTrans_PrepareMtlSlotCount + /// Type: BMap::BMMeshTransition*. The pointer to corresponding BMMeshTransition. + /// Type: LibCmo::CKDWORD. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMeshTrans_PrepareMtlSlotCount", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMeshTrans_PrepareMtlSlotCount([In, MarshalAs(UnmanagedType.SysInt)] IntPtr trans, [In, MarshalAs(UnmanagedType.U4)] uint count); + /// BMMeshTrans_PrepareMtlSlot + /// Type: BMap::BMMeshTransition*. The pointer to corresponding BMMeshTransition. + /// Type: LibCmo::CK2::CK_ID*. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMeshTrans_PrepareMtlSlot", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMeshTrans_PrepareMtlSlot([In, MarshalAs(UnmanagedType.SysInt)] IntPtr trans, [Out, MarshalAs(UnmanagedType.SysInt)] out IntPtr out_mem); + /// BMMeshTrans_PrepareFaceCount + /// Type: BMap::BMMeshTransition*. The pointer to corresponding BMMeshTransition. + /// Type: LibCmo::CKDWORD. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMeshTrans_PrepareFaceCount", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMeshTrans_PrepareFaceCount([In, MarshalAs(UnmanagedType.SysInt)] IntPtr trans, [In, MarshalAs(UnmanagedType.U4)] uint count); + /// BMMeshTrans_PrepareFaceVertexIndices + /// Type: BMap::BMMeshTransition*. The pointer to corresponding BMMeshTransition. + /// Type: LibCmo::CKDWORD*. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMeshTrans_PrepareFaceVertexIndices", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMeshTrans_PrepareFaceVertexIndices([In, MarshalAs(UnmanagedType.SysInt)] IntPtr trans, [Out, MarshalAs(UnmanagedType.SysInt)] out IntPtr out_mem); + /// BMMeshTrans_PrepareFaceNormalIndices + /// Type: BMap::BMMeshTransition*. The pointer to corresponding BMMeshTransition. + /// Type: LibCmo::CKDWORD*. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMeshTrans_PrepareFaceNormalIndices", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMeshTrans_PrepareFaceNormalIndices([In, MarshalAs(UnmanagedType.SysInt)] IntPtr trans, [Out, MarshalAs(UnmanagedType.SysInt)] out IntPtr out_mem); + /// BMMeshTrans_PrepareFaceUVIndices + /// Type: BMap::BMMeshTransition*. The pointer to corresponding BMMeshTransition. + /// Type: LibCmo::CKDWORD*. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMeshTrans_PrepareFaceUVIndices", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMeshTrans_PrepareFaceUVIndices([In, MarshalAs(UnmanagedType.SysInt)] IntPtr trans, [Out, MarshalAs(UnmanagedType.SysInt)] out IntPtr out_mem); + /// BMMeshTrans_PrepareFaceMtlSlot + /// Type: BMap::BMMeshTransition*. The pointer to corresponding BMMeshTransition. + /// Type: LibCmo::CKDWORD*. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMeshTrans_PrepareFaceMtlSlot", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMeshTrans_PrepareFaceMtlSlot([In, MarshalAs(UnmanagedType.SysInt)] IntPtr trans, [Out, MarshalAs(UnmanagedType.SysInt)] out IntPtr out_mem); + /// BMMeshTrans_Parse + /// Type: BMap::BMMeshTransition*. The pointer to corresponding BMMeshTransition. + /// Type: BMap::BMFile*. + /// Type: LibCmo::CK2::CK_ID. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMeshTrans_Parse", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMeshTrans_Parse([In, MarshalAs(UnmanagedType.SysInt)] IntPtr trans, [In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid); + /// BMObject_GetName + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKSTRING. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMObject_GetName", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMObject_GetName([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.LPUTF8Str)] out string out_name); + /// BMObject_SetName + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKSTRING. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMObject_SetName", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMObject_SetName([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.LPUTF8Str)] string name); + /// BMGroup_AddObject + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CK2::CK_ID. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMGroup_AddObject", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMGroup_AddObject([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint memberid); + /// BMGroup_GetObjectCount + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKDWORD. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMGroup_GetObjectCount", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMGroup_GetObjectCount([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U4)] out uint out_count); + /// BMGroup_GetObject + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKDWORD. + /// Type: LibCmo::CK2::CK_ID. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMGroup_GetObject", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMGroup_GetObject([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint pos, [Out, MarshalAs(UnmanagedType.U4)] out uint out_objid); + /// BMTexture_GetFileName + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKSTRING. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMTexture_GetFileName", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMTexture_GetFileName([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.LPUTF8Str)] out string out_filename); + /// BMTexture_LoadImage + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKSTRING. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMTexture_LoadImage", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMTexture_LoadImage([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.LPUTF8Str)] string filename); + /// BMTexture_SaveImage + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKSTRING. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMTexture_SaveImage", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMTexture_SaveImage([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.LPUTF8Str)] string filename); + /// BMTexture_GetSaveOptions + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CK2::CK_TEXTURE_SAVEOPTIONS. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMTexture_GetSaveOptions", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMTexture_GetSaveOptions([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U4)] out uint out_saveopt); + /// BMTexture_SetSaveOptions + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CK2::CK_TEXTURE_SAVEOPTIONS. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMTexture_SetSaveOptions", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMTexture_SetSaveOptions([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint saveopt); + /// BMTexture_GetVideoFormat + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VX_PIXELFORMAT. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMTexture_GetVideoFormat", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMTexture_GetVideoFormat([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U4)] out uint out_vfmt); + /// BMTexture_SetVideoFormat + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VX_PIXELFORMAT. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMTexture_SetVideoFormat", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMTexture_SetVideoFormat([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint vfmt); + /// BMMaterial_GetDiffuse + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VxColor. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetDiffuse", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetDiffuse([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.Struct)] out VxColor out_val); + /// BMMaterial_SetDiffuse + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VxColor. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetDiffuse", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetDiffuse([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.Struct)] VxColor col); + /// BMMaterial_GetAmbient + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VxColor. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetAmbient", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetAmbient([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.Struct)] out VxColor out_val); + /// BMMaterial_SetAmbient + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VxColor. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetAmbient", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetAmbient([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.Struct)] VxColor col); + /// BMMaterial_GetSpecular + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VxColor. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetSpecular", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetSpecular([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.Struct)] out VxColor out_val); + /// BMMaterial_SetSpecular + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VxColor. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetSpecular", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetSpecular([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.Struct)] VxColor col); + /// BMMaterial_GetEmissive + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VxColor. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetEmissive", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetEmissive([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.Struct)] out VxColor out_val); + /// BMMaterial_SetEmissive + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VxColor. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetEmissive", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetEmissive([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.Struct)] VxColor col); + /// BMMaterial_GetSpecularPower + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKFLOAT. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetSpecularPower", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetSpecularPower([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.R4)] out float out_val); + /// BMMaterial_SetSpecularPower + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKFLOAT. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetSpecularPower", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetSpecularPower([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.R4)] float val); + /// BMMaterial_GetTexture + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CK2::CK_ID. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetTexture", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetTexture([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U4)] out uint out_texid); + /// BMMaterial_SetTexture + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CK2::CK_ID. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetTexture", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetTexture([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint texid); + /// BMMaterial_GetTextureBorderColor + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKDWORD. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetTextureBorderColor", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetTextureBorderColor([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U4)] out uint out_val); + /// BMMaterial_SetTextureBorderColor + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKDWORD. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetTextureBorderColor", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetTextureBorderColor([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint val); + /// BMMaterial_GetTextureBlendMode + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXTEXTURE_BLENDMODE. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetTextureBlendMode", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetTextureBlendMode([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U4)] out uint out_val); + /// BMMaterial_SetTextureBlendMode + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXTEXTURE_BLENDMODE. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetTextureBlendMode", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetTextureBlendMode([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint val); + /// BMMaterial_GetTextureMinMode + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXTEXTURE_FILTERMODE. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetTextureMinMode", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetTextureMinMode([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U4)] out uint out_val); + /// BMMaterial_SetTextureMinMode + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXTEXTURE_FILTERMODE. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetTextureMinMode", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetTextureMinMode([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint val); + /// BMMaterial_GetTextureMagMode + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXTEXTURE_FILTERMODE. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetTextureMagMode", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetTextureMagMode([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U4)] out uint out_val); + /// BMMaterial_SetTextureMagMode + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXTEXTURE_FILTERMODE. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetTextureMagMode", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetTextureMagMode([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint val); + /// BMMaterial_GetTextureAddressMode + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXTEXTURE_ADDRESSMODE. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetTextureAddressMode", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetTextureAddressMode([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U4)] out uint out_val); + /// BMMaterial_SetTextureAddressMode + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXTEXTURE_ADDRESSMODE. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetTextureAddressMode", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetTextureAddressMode([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint val); + /// BMMaterial_GetSourceBlend + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXBLEND_MODE. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetSourceBlend", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetSourceBlend([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U4)] out uint out_val); + /// BMMaterial_SetSourceBlend + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXBLEND_MODE. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetSourceBlend", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetSourceBlend([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint val); + /// BMMaterial_GetDestBlend + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXBLEND_MODE. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetDestBlend", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetDestBlend([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U4)] out uint out_val); + /// BMMaterial_SetDestBlend + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXBLEND_MODE. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetDestBlend", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetDestBlend([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint val); + /// BMMaterial_GetFillMode + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXFILL_MODE. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetFillMode", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetFillMode([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U4)] out uint out_val); + /// BMMaterial_SetFillMode + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXFILL_MODE. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetFillMode", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetFillMode([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint val); + /// BMMaterial_GetShadeMode + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXSHADE_MODE. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetShadeMode", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetShadeMode([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U4)] out uint out_val); + /// BMMaterial_SetShadeMode + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXSHADE_MODE. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetShadeMode", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetShadeMode([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint val); + /// BMMaterial_GetAlphaTestEnabled + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: bool. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetAlphaTestEnabled", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetAlphaTestEnabled([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U1)] out bool out_val); + /// BMMaterial_SetAlphaTestEnabled + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: bool. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetAlphaTestEnabled", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetAlphaTestEnabled([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U1)] bool enabled); + /// BMMaterial_GetAlphaBlendEnabled + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: bool. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetAlphaBlendEnabled", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetAlphaBlendEnabled([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U1)] out bool out_val); + /// BMMaterial_SetAlphaBlendEnabled + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: bool. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetAlphaBlendEnabled", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetAlphaBlendEnabled([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U1)] bool enabled); + /// BMMaterial_GetPerspectiveCorrectionEnabled + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: bool. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetPerspectiveCorrectionEnabled", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetPerspectiveCorrectionEnabled([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U1)] out bool out_val); + /// BMMaterial_SetPerspectiveCorrectionEnabled + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: bool. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetPerspectiveCorrectionEnabled", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetPerspectiveCorrectionEnabled([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U1)] bool enabled); + /// BMMaterial_GetZWriteEnabled + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: bool. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetZWriteEnabled", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetZWriteEnabled([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U1)] out bool out_val); + /// BMMaterial_SetZWriteEnabled + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: bool. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetZWriteEnabled", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetZWriteEnabled([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U1)] bool enabled); + /// BMMaterial_GetTwoSidedEnabled + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: bool. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetTwoSidedEnabled", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetTwoSidedEnabled([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U1)] out bool out_val); + /// BMMaterial_SetTwoSidedEnabled + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: bool. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetTwoSidedEnabled", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetTwoSidedEnabled([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U1)] bool enabled); + /// BMMaterial_GetAlphaRef + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKBYTE. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetAlphaRef", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetAlphaRef([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U4)] out uint out_val); + /// BMMaterial_SetAlphaRef + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKBYTE. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetAlphaRef", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetAlphaRef([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint val); + /// BMMaterial_GetAlphaFunc + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXCMPFUNC. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetAlphaFunc", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetAlphaFunc([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U4)] out uint out_val); + /// BMMaterial_SetAlphaFunc + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXCMPFUNC. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetAlphaFunc", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetAlphaFunc([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint val); + /// BMMaterial_GetZFunc + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXCMPFUNC. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_GetZFunc", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_GetZFunc([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U4)] out uint out_val); + /// BMMaterial_SetZFunc + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXCMPFUNC. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMaterial_SetZFunc", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMaterial_SetZFunc([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint val); + /// BMMesh_GetLitMode + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXMESH_LITMODE. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMesh_GetLitMode", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMesh_GetLitMode([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U4)] out uint out_mode); + /// BMMesh_SetLitMode + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VXMESH_LITMODE. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMesh_SetLitMode", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMesh_SetLitMode([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint mode); + /// BMMesh_GetVertexCount + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKDWORD. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMesh_GetVertexCount", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMesh_GetVertexCount([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U4)] out uint out_count); + /// BMMesh_SetVertexCount + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKDWORD. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMesh_SetVertexCount", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMesh_SetVertexCount([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint count); + /// BMMesh_GetVertexPositions + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VxVector3*. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMesh_GetVertexPositions", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMesh_GetVertexPositions([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.SysInt)] out IntPtr out_mem); + /// BMMesh_GetVertexNormals + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VxVector3*. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMesh_GetVertexNormals", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMesh_GetVertexNormals([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.SysInt)] out IntPtr out_mem); + /// BMMesh_GetVertexUVs + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VxVector2*. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMesh_GetVertexUVs", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMesh_GetVertexUVs([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.SysInt)] out IntPtr out_mem); + /// BMMesh_GetFaceCount + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKDWORD. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMesh_GetFaceCount", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMesh_GetFaceCount([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U4)] out uint out_count); + /// BMMesh_SetFaceCount + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKDWORD. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMesh_SetFaceCount", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMesh_SetFaceCount([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint count); + /// BMMesh_GetFaceIndices + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKWORD*. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMesh_GetFaceIndices", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMesh_GetFaceIndices([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.SysInt)] out IntPtr out_mem); + /// BMMesh_GetFaceMaterialSlotIndexs + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKWORD*. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMesh_GetFaceMaterialSlotIndexs", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMesh_GetFaceMaterialSlotIndexs([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.SysInt)] out IntPtr out_mem); + /// BMMesh_GetMaterialSlotCount + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKDWORD. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMesh_GetMaterialSlotCount", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMesh_GetMaterialSlotCount([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U4)] out uint out_count); + /// BMMesh_SetMaterialSlotCount + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKDWORD. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMesh_SetMaterialSlotCount", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMesh_SetMaterialSlotCount([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint count); + /// BMMesh_GetMaterialSlot + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKDWORD. + /// Type: LibCmo::CK2::CK_ID. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMesh_GetMaterialSlot", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMesh_GetMaterialSlot([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint index, [Out, MarshalAs(UnmanagedType.U4)] out uint out_mtlid); + /// BMMesh_SetMaterialSlot + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CKDWORD. + /// Type: LibCmo::CK2::CK_ID. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BMMesh_SetMaterialSlot", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BMMesh_SetMaterialSlot([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint index, [In, MarshalAs(UnmanagedType.U4)] uint mtlid); + /// BM3dObject_GetWorldMatrix + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VxMatrix. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BM3dObject_GetWorldMatrix", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BM3dObject_GetWorldMatrix([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.Struct)] out VxMatrix out_mat); + /// BM3dObject_SetWorldMatrix + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::VxMath::VxMatrix. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BM3dObject_SetWorldMatrix", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BM3dObject_SetWorldMatrix([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.Struct)] VxMatrix mat); + /// BM3dObject_GetCurrentMesh + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CK2::CK_ID. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BM3dObject_GetCurrentMesh", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BM3dObject_GetCurrentMesh([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U4)] out uint out_meshid); + /// BM3dObject_SetCurrentMesh + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: LibCmo::CK2::CK_ID. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BM3dObject_SetCurrentMesh", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BM3dObject_SetCurrentMesh([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U4)] uint meshid); + /// BM3dObject_GetVisibility + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: bool. This is OUT parameter. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BM3dObject_GetVisibility", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BM3dObject_GetVisibility([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [Out, MarshalAs(UnmanagedType.U1)] out bool out_isVisible); + /// BM3dObject_SetVisibility + /// Type: BMap::BMFile*. The pointer to corresponding BMFile. + /// Type: LibCmo::CK2::CK_ID. The CKID of object you accessing. + /// Type: bool. + /// True if no error, otherwise False. + [DllImport(g_DllName, EntryPoint = "BM3dObject_SetVisibility", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool BM3dObject_SetVisibility([In, MarshalAs(UnmanagedType.SysInt)] IntPtr bmfile, [In, MarshalAs(UnmanagedType.U4)] uint objid, [In, MarshalAs(UnmanagedType.U1)] bool is_visible); + + // ##### GENERATED FUNCTIONS END ##### + + #endregion + + } } diff --git a/BMapBindings/BMapSharp/BMapSharp.csproj b/BMapBindings/BMapSharp/BMapSharp.csproj index 0156dab..914d65b 100644 --- a/BMapBindings/BMapSharp/BMapSharp.csproj +++ b/BMapBindings/BMapSharp/BMapSharp.csproj @@ -3,11 +3,21 @@ net8.0 enable - + BMapSharp 1.0.0 yyc12345 BearKidsTeam + + BMAP_OS_WINDOWS + + + BMAP_OS_LINUX + + + BMAP_OS_MACOS + + diff --git a/BMapBindings/BMapSharp/BMapWrapper.cs b/BMapBindings/BMapSharp/BMapWrapper.cs index 85d05e0..3303be6 100644 --- a/BMapBindings/BMapSharp/BMapWrapper.cs +++ b/BMapBindings/BMapSharp/BMapWrapper.cs @@ -1,6 +1,6 @@ using System; -namespace BMapSharp { +namespace BMapSharp.BMapWrapper { diff --git a/BMapBindings/BMapSharp/VirtoolsTypes.cs b/BMapBindings/BMapSharp/VirtoolsTypes.cs index 4ea80ca..f4eb861 100644 --- a/BMapBindings/BMapSharp/VirtoolsTypes.cs +++ b/BMapBindings/BMapSharp/VirtoolsTypes.cs @@ -1,7 +1,103 @@ using System; +using System.Runtime.InteropServices; +using System.Numerics; -namespace BMapSharp { +namespace BMapSharp.VirtoolsTypes { + [StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Ansi)] + public struct VxVector2 { + [MarshalAs(UnmanagedType.R4)] + public float X; + [MarshalAs(UnmanagedType.R4)] + public float Y; + public VxVector2(float _x = 0.0f, float _y = 0.0f) { + this.X = _x; + this.Y = _y; + } + public VxVector2(Vector2 vec) { + this.FromManaged(vec); + } + public void FromManaged(Vector2 vec) { + this.X = vec.X; + this.Y = vec.Y; + } + public Vector2 ToManaged() { + return new Vector2(this.X, this.Y); + } + } + + [StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Ansi)] + public struct VxVector3 { + [MarshalAs(UnmanagedType.R4)] + public float X; + [MarshalAs(UnmanagedType.R4)] + public float Y; + [MarshalAs(UnmanagedType.R4)] + public float Z; + + public VxVector3(float _x = 0.0f, float _y = 0.0f, float _z = 0.0f) { + this.X = _x; + this.Y = _y; + this.Z = _z; + } + public VxVector3(Vector3 vec) { + this.FromManaged(vec); + } + public void FromManaged(Vector3 vec) { + this.X = vec.X; + this.Y = vec.Y; + this.Z = vec.Z; + } + public Vector3 ToManaged() { + return new Vector3(this.X, this.Y, this.Z); + } + } + + [StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Ansi)] + public struct VxColor { + [MarshalAs(UnmanagedType.R4)] + public float A; + [MarshalAs(UnmanagedType.R4)] + public float R; + [MarshalAs(UnmanagedType.R4)] + public float G; + [MarshalAs(UnmanagedType.R4)] + public float B; + } + + [StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Ansi)] + public struct VxVector4 { + [MarshalAs(UnmanagedType.R4)] + public float X; + [MarshalAs(UnmanagedType.R4)] + public float Y; + [MarshalAs(UnmanagedType.R4)] + public float Z; + [MarshalAs(UnmanagedType.R4)] + public float W; + } + [StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Ansi)] + public struct VxMatrix { + public VxVector4 x; + public VxVector4 y; + public VxVector4 z; + public VxVector4 w; + } + + public struct CKFaceIndices { + [MarshalAs(UnmanagedType.U4)] + public uint I1; + [MarshalAs(UnmanagedType.U4)] + public uint I2; + [MarshalAs(UnmanagedType.U4)] + public uint I3; + + public CKFaceIndices(uint i1 = 0u, uint i2 = 0u, uint i3 = 0u) { + this.I1 = i1; + this.I2 = i2; + this.I3 = i3; + } + } } diff --git a/BMapBindings/PyBMap/PyBMap/bmap.py b/BMapBindings/PyBMap/PyBMap/bmap.py index 5926c8b..8d79def 100644 --- a/BMapBindings/PyBMap/PyBMap/bmap.py +++ b/BMapBindings/PyBMap/PyBMap/bmap.py @@ -78,12 +78,13 @@ elif sys.platform.startswith('darwin'): else: _g_BMapLibName = "BMap.bin" +_g_BMapLibPath: str = os.path.join(os.path.dirname(__file__), _g_BMapLibName) + _g_BMapModule: ctypes.CDLL | None = None try: - _g_BMapModule = ctypes.cdll.LoadLibrary( - os.path.join(os.path.dirname(__file__), _g_BMapLibName) - ) + _g_BMapModule = ctypes.cdll.LoadLibrary(_g_BMapLibPath) except: + print(f'Fail to load native BMap dynamic library file "{_g_BMapLibPath}".') _g_BMapModule = None def is_bmap_available() -> bool: @@ -107,6 +108,8 @@ def _create_bmap_func(fct_name: str, fct_params: list[typing.Any]) -> typing.Cal #region Function Defines +##### GENERATED FUNCTIONS BEGIN ##### + ## BMInit # @return True if no error, otherwise False. BMInit = _create_bmap_func('BMInit', []) @@ -781,5 +784,6 @@ BM3dObject_GetVisibility = _create_bmap_func('BM3dObject_GetVisibility', [bm_voi # @return True if no error, otherwise False. BM3dObject_SetVisibility = _create_bmap_func('BM3dObject_SetVisibility', [bm_void_p, bm_CKID, bm_bool]) -#endregion +##### GENERATED FUNCTIONS END ##### +#endregion diff --git a/CodeGen/BMapBindings/CSharpWriter.java b/CodeGen/BMapBindings/CSharpWriter.java index f9cc116..bd1c3f8 100644 --- a/CodeGen/BMapBindings/CSharpWriter.java +++ b/CodeGen/BMapBindings/CSharpWriter.java @@ -52,7 +52,7 @@ public class CSharpWriter { ret.mCsType = "string"; break; case 1: - ret.mMarshalAs = "UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(BMStringArrayMashaler)"; + ret.mMarshalAs = "UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(BMStringArrayMarshaler)"; ret.mCsType = "string[]"; break; } @@ -212,10 +212,6 @@ public class CSharpWriter { IndentHelper helper = new IndentHelper(writer); // write function decls - helper.puts(""); - helper.puts("#region Function Defines"); - helper.puts(""); - for (ExpFctDecl fctdecl : data) { // write annotation // summary (just plain function name) @@ -253,7 +249,7 @@ public class CSharpWriter { // push MarshalAsAttribute sb.append("MarshalAs("); sb.append(interop_type.mMarshalAs); - sb.append(") "); + sb.append(")] "); // push out keyword if parameter is out parameter if (!paramdecl.mIsInput) { sb.append("out "); @@ -271,10 +267,6 @@ public class CSharpWriter { cs_param_list.stream().collect(Collectors.joining(", "))); } - helper.puts(""); - helper.puts("#endregion"); - helper.puts(""); - writer.close(); } diff --git a/CodeGen/BMapBindings/CommonHelper.java b/CodeGen/BMapBindings/CommonHelper.java index f7360b1..a8972a8 100644 --- a/CodeGen/BMapBindings/CommonHelper.java +++ b/CodeGen/BMapBindings/CommonHelper.java @@ -1,28 +1,28 @@ -import java.io.FileInputStream; +//import java.io.FileInputStream; import java.io.FileOutputStream; -import java.io.InputStreamReader; +//import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.nio.charset.StandardCharsets; public class CommonHelper { - public static InputStreamReader openReader(String filename) throws Exception { - FileInputStream fs = new FileInputStream(filename); - return new InputStreamReader(fs, StandardCharsets.UTF_8); - } +// public static InputStreamReader openReader(String filename) throws Exception { +// FileInputStream fs = new FileInputStream(filename); +// return new InputStreamReader(fs, StandardCharsets.UTF_8); +// } public static OutputStreamWriter openWriter(String filename) throws Exception { FileOutputStream fs = new FileOutputStream(filename); return new OutputStreamWriter(fs, StandardCharsets.UTF_8); } - public static void writeSnippet(OutputStreamWriter writer, String snippet_path) throws Exception { - // open snippet - InputStreamReader reader = openReader(snippet_path); - // write into writer - reader.transferTo(writer); - reader.close(); - } +// public static void writeSnippet(OutputStreamWriter writer, String snippet_path) throws Exception { +// // open snippet +// InputStreamReader reader = openReader(snippet_path); +// // write into writer +// reader.transferTo(writer); +// reader.close(); +// } public static String getDoxygenInOutStr(boolean isInput) { return isInput ? "in" : "out"; diff --git a/CodeGen/BMapBindings/PythonWriter.java b/CodeGen/BMapBindings/PythonWriter.java index 121e52c..2a8f782 100644 --- a/CodeGen/BMapBindings/PythonWriter.java +++ b/CodeGen/BMapBindings/PythonWriter.java @@ -69,15 +69,7 @@ public class PythonWriter { OutputStreamWriter writer = CommonHelper.openWriter("dest/BMExports.py"); IndentHelper helper = new IndentHelper(writer); - // write snippet - CommonHelper.writeSnippet(writer, "snippets/header.py"); - // write function decls - - helper.puts(""); - helper.puts("#region Function Defines"); - helper.puts(""); - for (ExpFctDecl fctdecl : data) { // write annotation // function name @@ -97,10 +89,6 @@ public class PythonWriter { .stream().map(value -> pythonTypeGetter(value)).collect(Collectors.joining(", "))); } - helper.puts(""); - helper.puts("#endregion"); - helper.puts(""); - writer.close(); } diff --git a/CodeGen/BMapBindings/snippets/header.py b/CodeGen/BMapBindings/snippets/header.py deleted file mode 100644 index b97f62f..0000000 --- a/CodeGen/BMapBindings/snippets/header.py +++ /dev/null @@ -1,106 +0,0 @@ -import ctypes, os, sys, typing - -#region Type Defines - -class BMapException(Exception): - """ - The exception thrown by BMap bindings. - """ - pass - -bm_CKSTRING = ctypes.c_char_p -bm_CKSTRING_p = ctypes.POINTER(bm_CKSTRING) -bm_CKDWORD = ctypes.c_uint32 -bm_CKDWORD_p = ctypes.POINTER(bm_CKDWORD) -bm_CKDWORD_pp = ctypes.POINTER(bm_CKDWORD_p) -bm_CKWORD = ctypes.c_uint16 -bm_CKWORD_p = ctypes.POINTER(bm_CKWORD) -bm_CKWORD_pp = ctypes.POINTER(bm_CKWORD_p) -bm_CKID = ctypes.c_uint32 -bm_CKID_p = ctypes.POINTER(bm_CKID) -bm_CKID_pp = ctypes.POINTER(bm_CKID_p) -bm_CKFLOAT = ctypes.c_float -bm_CKFLOAT_p = ctypes.POINTER(bm_CKFLOAT) -bm_CKINT = ctypes.c_int32 -bm_CKBYTE = ctypes.c_uint8 -bm_CKBYTE_p = ctypes.POINTER(bm_CKBYTE) - -bm_enum = bm_CKDWORD -bm_enum_p = ctypes.POINTER(bm_enum) -bm_bool = ctypes.c_bool -bm_bool_p = ctypes.POINTER(bm_bool) -bm_void_p = ctypes.c_void_p -bm_void_pp = ctypes.POINTER(ctypes.c_void_p) - -bm_callback = ctypes.CFUNCTYPE(None, bm_CKSTRING) - -class bm_VxVector2(ctypes.Structure): - _fields_ = [ - ('x', bm_CKFLOAT), - ('y', bm_CKFLOAT), - ] -bm_VxVector2_p = ctypes.POINTER(bm_VxVector2) -bm_VxVector2_pp = ctypes.POINTER(bm_VxVector2_p) -class bm_VxVector3(ctypes.Structure): - _fields_ = [ - ('x', bm_CKFLOAT), - ('y', bm_CKFLOAT), - ('z', bm_CKFLOAT), - ] -bm_VxVector3_p = ctypes.POINTER(bm_VxVector3) -bm_VxVector3_pp = ctypes.POINTER(bm_VxVector3_p) -class bm_VxColor(ctypes.Structure): - _fields_ = [ - ('r', bm_CKFLOAT), - ('g', bm_CKFLOAT), - ('b', bm_CKFLOAT), - ('a', bm_CKFLOAT), - ] -bm_VxColor_p = ctypes.POINTER(bm_VxColor) -class bm_VxMatrix(ctypes.Structure): - _fields_ = list( - (f'i{idx}', bm_CKFLOAT) for idx in range(16) - ) -bm_VxMatrix_p = ctypes.POINTER(bm_VxMatrix) - -#endregion - -#region BMap Loader - -_g_BMapLibName: str - -if sys.platform.startswith('win32') or sys.platform.startswith('cygwin'): - _g_BMapLibName = "BMap.dll" -elif sys.platform.startswith('linux') or sys.platform.startswith('freebsd'): - _g_BMapLibName = "BMap.so" -elif sys.platform.startswith('darwin'): - _g_BMapLibName = "BMap.dylib" -else: - _g_BMapLibName = "BMap.bin" - -_g_BMapModule: ctypes.CDLL | None = None -try: - _g_BMapModule = ctypes.cdll.LoadLibrary( - os.path.join(os.path.dirname(__file__), _g_BMapLibName) - ) -except: - _g_BMapModule = None - -def is_bmap_available() -> bool: - return _g_BMapModule is not None - -def _bmap_error_check(result: bool, func, args): - if not result: - raise BMapException("BMap operation failed.") - return result - -def _create_bmap_func(fct_name: str, fct_params: list[typing.Any]) -> typing.Callable[..., bm_bool]: - if _g_BMapModule is None: return None - - cache: typing.Callable[..., bm_bool] = getattr(_g_BMapModule, fct_name) - cache.argtypes = fct_params - cache.restype = bm_bool - cache.errcheck = _bmap_error_check - return cache - -#endregion