planetis-m / naylib

Yet another raylib Nim wrapper
MIT License
209 stars 11 forks source link

using int instead of int32 when calling Raylib functions? #102

Closed X-Ninja-dev closed 2 months ago

X-Ninja-dev commented 7 months ago

This is a general Nim question and not specific to Naylib so feel free to delete and send me to the forums instead

Using a tuple in the code I have to declare the values as int32, why is that? And is there a way to tell the compiler to use int32?

import raylib
const
  screenW = 800
  screenH = 600
  screenSize = (x: 800, y: 600)

proc main(): void =
  # works
  initWindow(screenW, screenH, "testing")

  # does not work. Error: type mismatch
  initWindow(screenSize.x, screenSize.y, "testing")

main()
Angluca commented 6 months ago

screenSize.x.int32

planetis-m commented 2 months ago

No idea really, const implicit types buffle me as well.