You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 15, 2023. It is now read-only.
Hello. I was trying the hot code reload feature of Nim following the official docs (https://nim-lang.org/docs/hcr.html). Sincec I got that SDL2 example running I wanted to try that feature with NimraylibNow. I slightly modified the crown.nim example adding a main.nim file that calls some procs on the crown.nim file.
crown.nim
import math
import nimraylib_now
import std/hotcodereloading
var runGame*: bool = true
const
nimFg: Color = (0xff, 0xc2, 0x00) # Use this shortcut with alpha = 255!
nimBg: Color = (0x17, 0x18, 0x1f)
...
proc init* () =
for i in 0..<crownSides:
let multiplier = i.float
# Formulas are for 2D space, good enough for 3D since height is always same
lowerPoints[i] = (
x: lowerRadius * cos(centerAngle * multiplier),
y: lowerRadius * sin(centerAngle * multiplier),
)
...
proc update*() =
while not windowShouldClose():
if isKeyPressed(KeyboardKey.F9): # Trigger the reload
performCodeReload()
if not pause:
camera.addr.updateCamera # Rotate camera
...
proc destroy*() =
closeWindow()
Hello. I was trying the hot code reload feature of Nim following the official docs (https://nim-lang.org/docs/hcr.html). Sincec I got that SDL2 example running I wanted to try that feature with NimraylibNow. I slightly modified the crown.nim example adding a main.nim file that calls some procs on the crown.nim file.
crown.nim
main.nim
The code compiles just fine but when I run it I have this error:
I don't know how to debug the nimhcr library file to check which library returns nil in loadLib.