Knim are the Nim bindings of the Kinc low level ultra-portable graphics library.
Tested on:
Not tested on:
- You need node installed on your system PATH. (You can download the binary).
- Check out https://github.com/Kode/Kinc or https://github.com/Kode/Kha for features
git clone --recursive https://github.com/IbrahimHindawi/Knim
This library can be ran in two modes:
dynamic: link against a dynamic library and debug Nim directly in VS Code using LLDB.
codegen: inject the C generated from Nim into the target IDE and build/debug from IDE.
invoke build.nims
NimScript: nim -d:[mode] -d:[backend] Sources/build.nims [programfile]
-
dynamic library mode:
- You must first generate the dll for your chosen backend.
- From the Knim root directory, run:
node Kinc/make --dynlib -g opengl
ornode Kinc/make --dynlib -g direct3d11
. - Open the solution in the
build
directory and build to getKinc.dll
. - Rename to
KincDirect3D11.dll
orKincOpenGL.dll
. - Place dll in a folder called
Deployment
in the root (Windows). nim -d:dynamic -d:direct3d11 Sources/build.nims Sources/prog.nim
-
codegen inject mode:
- Edit kincfile.js to point to your local nim/lib directory.
- Customize
build.nims
Nimscript file for target compiler/cpu/os. - for Android, add
ndk {abiFilters "arm64-v8a"}
to thegradle.build
nim -d:codegen -d:opengl Sources/build.nims Sources/prog.nim
- Lewis Lepton - Kha Tutorial
- Lubos Lenco - Kha 3D Tutorial
- Knim Samples - Translated some existing tutorials to Nim
- Automate the project ( there are already .vscode build tasks in the standalone subdirectory).
- Make Nimble Package(s).
- get rid of prog.nims
- I will attempt to write docs as I work more on binding this library.