DeafMan1983.Conversion
4.0.0
Old version of package won't use now. Please use DeafMan1983.Utilities Thanks!
dotnet add package DeafMan1983.Conversion --version 4.0.0
NuGet\Install-Package DeafMan1983.Conversion -Version 4.0.0
<PackageReference Include="DeafMan1983.Conversion" Version="4.0.0" />
paket add DeafMan1983.Conversion --version 4.0.0
#r "nuget: DeafMan1983.Conversion, 4.0.0"
// Install DeafMan1983.Conversion as a Cake Addin #addin nuget:?package=DeafMan1983.Conversion&version=4.0.0 // Install DeafMan1983.Conversion as a Cake Tool #tool nuget:?package=DeafMan1983.Conversion&version=4.0.0
ConversionFunctions
sbyte *, sbyte **, byte *, byte ** void *, string and string[]
Changvs and fixes:<br /> Fixed: <br />
- Since NullReferenceExeepction cause some can't new instance
- some functions
Replaced:<br />
- StringSize to LengthSize
- StringwithSBytePointer to StringFromSBytePointer
- StringArrayWithSByteDoublePointers to StringArrayFromByteDoublePointers
- SBytePointerWithString to SBytePointerFromString
- SByteDoublePointerWithStringArrays to SByteDoublePointersFromStringArray
Added;<br />
- byte * and byte ** for StringFromBytePointer, StringArrayFromByteDoublePointers,
- BytePointerFromString, ByteDoublePointersFromStringArray
- void * for Alloc, Free and Delete <br /> pdated to 4.0.0
How does it work?
If you use sbyte*
for string
like example in X11's XOpenDisplay()
or SDL_SetWindowTitle()
For X11 from TerraFX.Interop.Xlib
....
Display *display = XOpenDisplay(SBytePointerFromString(string.Empty));
....
Or for SDL3 from DeafMan1983.Interop.SDL3
....
SDL_SetWindows(window, SBytePointerWithString("Hello SDL3 Window"));
....
For string
for sbyte *
like example X11's XDisplayString()
or SDL3's SDL_GetWindowTitle()
....
string d_str = StringFromSBytePointer(XDisplayString(display));
....
or SDL3
....
string title_str = StringFromSBytePointer(SDL_GetWindowTitle(window));
....
And new more functions:
For string[]
for sbyte **
like you use delegate *unmanaged[Cdecl]<sbyte **, int, void>
or delegate *unmanaged[Cdecl]<sbyte **, int, int>
and It works for Game, Application they can load external native library but I have tested with Console.WriteLine()
It is successfully. But I never did other like Winfows.Forms or Xlib, SDL3 I will see how does it work for external native libraries.
....
string[] args = StringArrayFromSByteDoublePointers(sArrays, array_length);
....
Warning It is important for [UnmanagedCallerOnly]
and it uses sbyte **
and int
for array_length
If you pass string[] args
from Program.cs then you need add SByteDoublePointersFromStringArray
Example:
sbyte **sArrays = SByteDoublePointersFromStringArray(args);
pfnMainFunc(sArrays, args.length);
....
New feature for Alloc, Free and Delete like C/C++
SDL_Renderer *renderer = SDL_CreateRenderer(window, null, SDL_RENDER_ACCELERATOR);
Alloc(renderer);
....
SDL_DestroyRenderer(display);
Delete(renderer);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.