I made quite a lot of progress today, but now I have reached a roadblock. I am probably too thick and newb, but how do I use queryTexture from the SDL2 Wrapper:
proc queryTexture*(texture: TexturePtr; format: ptr uint32; access, w, h: ptr cint): SDL_Return {.discardable, importc: "SDL_QueryTexture".}
How do I pass NULL? The compiler won't allow anything. I tried: sdl2.queryTexture(pTexture, NULL ,NULL, castcint, castcint)
PS. I also tried {.extern: NULL} and I casting unit32 to pointer and some even more stupid stuff, but nothing works. Yeah and I read the tutorials and the manual and Nim for C programmers, but I did not find an answer.
import sdl2
var
texture: TexturePtr
width: cint = 10
height: cint = 20
queryTexture(texture, nil, nil, addr width, addr height)
Note the cint and addr.
I didn't know about addr! So that was the problem. Thanks! (Maybe the pointer/memory handling should get its own doc article)
Thanks again.