An alternative of dllimport with calli
Allows you to import native methods where you should normally use GetProcAddress, using syntax like dllimport
- Declare your import (declare your args in <>)
[CalliImport( "opengl32.dll", EntryPoint = "glClear")] public static CalliMethode<int> Clear;
- Load native methodes
CalliImport.LoadMethods();
-
Declare your import with a return (first args is the return type)
[CalliImport( "opengl32.dll", EntryPoint = "glClear")] public static CalliMethodeType<int, int> Clear;
-
Preload library (not methods)
CalliImport.LoadLibrary("opengl32.dll");
-
Load library specific imports
CalliImport.LoadMethods("opengl32.dll");
-
For a faster execute don't forget
[SuppressUnmanagedCodeSecurity]
- Trystan Delhaye - GaraQuor
This project is licensed under the GNU General Public License v3.0 License - see the LICENSE.md file for details
- Thanks to Весьмой Шум (wholemy.ru)