Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

C backend

Ethosa edited this page Mar 15, 2023 · 1 revision

Let's start to write your program ...
main.nim

import hapticx

var
  app = newApp("My own app")
  scene = newHScene()
  canvas = newHCanvas()

scene.addChild(canvas)
canvas.drawRect(0, 0, 50, 50, WhiteClr)
canvas.drawRect(48, 48, 64, 64, RedClr)

app.main = scene
app.run()

Then, let's compile it!

Vulkan

nim c -r -d:vulkan main.nim

OpenGL

Win

nim c -r -d:useGlew --passC:"-I.\path\to\glew\inlcude"  --passL:"-L.\path\to\glew\lib\Release\x64"

Unix

nim c -r -d:useGlew --passC:"-I/path/to/glew/inlcude"  --passL:"-L/path/to/glew/lib/Release/x64"
Clone this wiki locally