DeafMan1983 / Dotnet.Native.Access

Native.Access for DotNet 3.1 , It is successor of Java.Native.Access ( JNA ) for C#

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dotnet.Native.Access

Native.Access for DotNet 3.1 , It is successor of Java.Native.Access ( JNA ) for C#. But Any classes and implements are still working in process...

You just create simple test for C# Show your code

Result: NativeLong is 8. Pointer is 8, PointerType is 4.

Note for Windows Users:

If all are "4" then it means "hWnd" is 4 size of int.

Note for structure of "typedef struct" or "typedef uint32_t" from C/C++ should be NativeLong

Example with SDL2-CS ( @flibitijibibo )

public class SDL_Window : NativeLong
{
    public SDL_Window(long value) : base(value)
    {
    }

    // ... stuff for SDL_Window for width, height, x, y, id or etc..
}

class SDL_Program
{
    private SDL_Window window;

    // ...

    public void Run()
    {
        // ...

        window = SDL_CreateWindow("Hello Window", 100, 100, 200, 200, 0);

        // ...
    }
}

Pointer / PointerType are from "typedef struct*" like Display* from X11 or SDL_Window* but whatever you want decide 3 different type of alternative to IntPtr.

Enjoy and happy coding!

Donate? No problem you can spend me Why I am DeafMan because I am deaf since my birth. Thanks for spending! I hope you understand my reason.

About

Native.Access for DotNet 3.1 , It is successor of Java.Native.Access ( JNA ) for C#


Languages

Language:C# 100.0%