C# bindings for Sokol using Sokol's binding generator

Overview

Sokol_csharp

NuGet: https://www.nuget.org/packages/sokol_csharp.unofficial/

C# bindings for Sokol generated from https://github.com/MichalStrehovsky/sokol/tree/gen_csharp.

They follow the same model as the "official" bindings for Zig and Nim in the official Sokol repo at https://github.com/floooh/sokol.

The C# generator is not upstreamed to Sokol yet which is why I point to my private fork. I want to get some mileage on it before I try to contribute it.

To build a shared library with Sokol binaries that the C# source p/invokes into, cd into src/sokol/c and build the sokol.c file.

I'm building this without annoying CRT dependencies (#define NO_CRT), but you don't have to. This is my build workflow:

On Windows, to build a shared library you can run:

$ cl /DNO_CRT /EHs-c- /GR- /LD /Zi /Zl /GS- /O1 /Gs8192 sokol.c /link path_to_your\msvcrt.lib /noentry /opt:ref,icf

You can grab a msvcrt.lib from e.g. https://github.com/neosmart/msvcrt.lib.

On Windows, to build a static library suitable to be used with bflat, run:

cl /DNO_CRT /DBFLAT_LIB /c /EHs-c- /GR- /Zi /Zl /GS- /O1 /Gs8192 sokol.c
lib sokol.obj
You might also like...
lua binding for Software implementation in C of the FIPS 198 Keyed-Hash Message Authentication Code HMAC

lua-hmac Compute the SHA-224, SHA-256, SHA-384, and SHA-512 message digests and the Hash-based Message Authentication Code (HMAC). this module is Lua

Shellcode generator using C++ with uninitialized/initialized data possible.

Introduction There's currently not a lot of ways to make easily shellcodes, you either write in assembly or extract from PE/ELF the things you need, b

LLVM bindings for Node.js/JavaScript/TypeScript

llvm-bindings LLVM bindings for Node.js/JavaScript/TypeScript Supported OS macOS Ubuntu Windows Supported LLVM methods listed in the TypeScript defini

Android Bindings for QuickJS, A fine little javascript engine.

quickjs-android quickjs-android 是 QuickJS JavaScript 引擎的 Android 接口框架,整体基于面向对象设计,提供了自动GC功能,使用简单。armeabi-v7a 的大小仅 350KB,是 Google V8 不错的替代品,启动速度比 V8 快,内

Zig bindings for the excellent CRoaring library

Zig-Roaring This library implements Zig bindings for the CRoaring library. Naming Any C function that begins with roaring_bitmap_ is a method of the B

Python bindings of silk codec.

Python silk module. --- pysilk --- APIs See test\test.py. import pysilk as m m.silkEncode(buf , 24000) m.silkDecode(buf , 24000) #the first param is b

rlua -- High level bindings between Rust and Lua

rlua -- High level bindings between Rust and Lua

Ziggified GLFW bindings with 100% API coverage, zero-fuss installation, cross compilation, and more.

mach/glfw - Ziggified GLFW bindings Ziggified GLFW bindings that Mach engine uses, with 100% API coverage, zero-fuss installation, cross compilation,

Bindings, from the comfort and speed of C++ and without Qt.

KDBindings Bindings, from the comfort and speed of C++ and without Qt. From plain C++ you get: Signals + Slots. Properties templated on the contained

Comments
  • alternative bindings

    alternative bindings

    heya, just FYI

    I have progress on generating bindings for sokol automatically for C# using an alternative method: https://github.com/lithiumtoast/sokol-cs You can find my break down here: https://github.com/floooh/sokol/issues/448#issuecomment-753645295

    I'm currently investigating nAOT using the above technique. Dynamic linking works, static linking does not work so far in my testing.

    I will try zerosharp and bflat next :)

    opened by lithiumtoast 4
Owner
Michal Strehovský
Michal Strehovský
A C++ binding for the OpenGL API, generated using the gl.xml specification.

glbinding is a cross-platform C++ binding for the OpenGL API. glbinding leverages C++11 features like enum classes, lambdas, and variadic templates, i

CG Internals 758 Dec 13, 2022
CRC32 slice-by-16 implementation in JS with an optional native binding to speed it up even futher

CRC32 slice-by-16 implementation in JS with an optional native binding to speed it up even futher. When used with Webpack/Browserify etc, it bundles the JS version.

Mathias Buus 8 Aug 4, 2021
C++ binding to Lua

bLua C++与Lua的胶水层,b代表着bridge 特性 依赖C++17 只有一个头文件 接口简单轻量 userdata的方式管理c++指针生命周期 用法 lua调用c++ 首先注册类及需要的成员函数 // 注册全局函数 bLua::reg_global_func(L, "newA", newA

null 3 Sep 30, 2022
Go binding to ImageMagick's MagickWand C API

Go Imagick Go Imagick is a Go bind to ImageMagick's MagickWand C API. We support two compatibility branches: master (tag v2.x.x): 6.9.1-7 <= ImageMagi

Go Graphics community 1.5k Dec 29, 2022
libmagic binding for lua.

lua-libmagic libmagic binding for lua. see man libmagic for more details. Dependencies libmagic: https://github.com/file/file Installation luarocks in

Masatoshi Fukunaga 2 Jan 14, 2022
A binding between C++11 and Lua language

lua-intf lua-intf is a binding between C++11 and Lua language, it provides three different set of API in one package: LuaBinding, Export C++ class or

Steve K. Chiu 406 Dec 5, 2022
Advanced version of lutok C++/Lua binding

Lutok2 C++/Lua binding helper for Lua 5.1 and LuaJIT 2.x+. Dependencies To use Lutok2 successfully you'll need: A standards-compliant C++11 complier L

Mário Kašuba 9 Jul 19, 2022
C++ binding to Lua

Kaguya C++ binding to Lua Licensed under Boost Software License Requirements Lua 5.1 to 5.3 (recommended: 5.3) C++03 compiler with boost library or C+

null 317 Jan 4, 2023
This is a simple version of Apex-Legends-SDK since so many people having struggles with python binding

This is a simple version of Apex-Legends-SDK since so many people having struggles with python binding

skidword64 43 Nov 30, 2022
A Sol-inspired minimalist Lua binding for Zig.

zoltan A Sol-inspired minimalist Lua binding for Zig. Features Supports Zig 0.9.0 Lua tables table creation from Zig get/set/create methods possible k

null 79 Dec 4, 2022