Skip to content

IbrahimHindawi/Knim

Repository files navigation

Knim

Kinc in Nim

Build Status

Knim are the Nim bindings of the Kinc low level ultra-portable graphics library.

⚠️This repository is still a work in progress⚠️

Tested on:

  • Windows: Direct3D11 and OpenGL (Direct3D12 & Vulkan soon)
  • Linux: OpenGL (Vulkan soon)
  • MacOSX: OpenGL (Metal soon)
  • Android: OpenGL (Vulkan soon)

  • Not tested on:

  • IOS: Metal
  • PS4/PS5: LibGNM
  • XBOX: Direct3D12
  • WEB
  • ...
  • Dependencies

    • You need node installed on your system PATH. (You can download the binary).

    Features

    How to get

    • git clone --recursive https://github.com/IbrahimHindawi/Knim

    How to run

    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 or node Kinc/make --dynlib -g direct3d11.
      • Open the solution in the build directory and build to get Kinc.dll.
      • Rename to KincDirect3D11.dll or KincOpenGL.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 the gradle.build
      • nim -d:codegen -d:opengl Sources/build.nims Sources/prog.nim

    Tutorials

    Documentation

    • Unfortunately there are no docs for Kinc yet.
    • Minimal Kha docs here: Kha.

    To do:

    • 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.

    About

    No description, website, or topics provided.

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published