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 has been 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()
Hi, unfortunately I don't know how HCR currently works. Previously it was an implementation people didn't like with little documentation, now at least the documentation page is a lot more clear. So if we assume that this is going to be possible with Raylib at all, which may not be true, then I would just put a couple of debug statements in the file .choosenim/toolchains/nim-1.6.10/lib/nimhcr.nim to get to the bottom of the problem.
So in short this could be impossible with the current state of HCR but it is still worth trying. The Raylib library itself is pretty complicated because it tries to be compatible across many platforms, which could also contribute to the complexity of the problem. I will leave this issue open for tracking it. If you would like to take a stab at it, feel free to do so. This could be easily resolvable too.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The text was updated successfully, but these errors were encountered: