Check out my new lib Spacy: Spatial data structures for Nim.

2021-02-19 Thread treeform
# Spatial data structures for Nim. `nimble install spacy` Spatial algorithms are used to find the "closest" things faster than simple brute force iteration would. They make your code run faster using smarter data structures. This library has different "Space

nim.cfg - pragma

2021-02-19 Thread Hlaaftana
I don't remember a common way of doing this other than erroring if `threads` isn't on. You can do it like so: when not compileOption("threads"): {.error: "use --threads:on to compile this library".} Run If there's a situation where you don't want to error, you co

How to declare function pointer type ?

2021-02-19 Thread kcvinu
Hi shirleyquirk Thanks for the answer. :)

windows - msys2 - rdynamic

2021-02-19 Thread mantielero
Thanks a lot. That solves the issue. I will update the code.

How to declare function pointer type ?

2021-02-19 Thread shirleyquirk
`var fnPtr1: proc(a: int, b: int) #or import sugar var fnPtr2: (int,int) -> void ` Run

How to declare function pointer type ?

2021-02-19 Thread kcvinu
@SolitudeSF Yes, that's what i wanted. type fnPtr = (int, int) Run I want something like this. A function with 2 int params and no return value.

How to declare function pointer type ?

2021-02-19 Thread kcvinu
@Clonk, Thanks.

How to declare function pointer type ?

2021-02-19 Thread Clonk
Hi, proc are already pointer in Nim so it's as easy as a cast : var fPtr : pointer = getFunctionPointer() # How you get your function pointer may vary var myproc : (proc(arg: int) {.cdecl, gcsafe.}) = cast[(proc(arg: int) {.cdecl, gcsafe.})](fPtr) myproc(3) Ru

How to declare function pointer type ?

2021-02-19 Thread SolitudeSF
arrow syntax is just a sugar. type P = proc(a: int): int Run

Building games for the web with Emscripten

2021-02-19 Thread enthus1ast
I've no real experience, (besides exporting godot) with wasm compared to js games. Do they perform better than js? When do you think would it make sense to use wasm instead of js for web games?

Building games for the web with Emscripten

2021-02-19 Thread sekao
The main thing is that your native OpenGL + GLFW game can compile for the web with no code changes. The example project i linked to is an example of that. Emscripten just translates all the GLFW events to the equivalent browser events, and all the OpenGL calls to WebGL. I am pretty sure wasm wi

How to declare function pointer type ?

2021-02-19 Thread kcvinu
Hi all, I saw this code in SO to declare a function pointer. (int -> int) Run But how do i declare a function pointer of a function with no return type and more than one parameter ? Thanks in advance.

Building games for the web with Emscripten

2021-02-19 Thread sekao
This is partially just an announcement that [NimGL](https://github.com/nimgl/nimgl/) now supports building projects with emscripten. You can try it by building [my example game](https://github.com/paranim/parakeet) with the instructions in the readme. If all goes well you should see mr. jumpy p

windows - msys2 - rdynamic

2021-02-19 Thread guibar
Hello, In `src/wrapper/VSScript_Wrapper.nim` there is this horrible POSIX-specific code: {. passL:"-rdynamic -Wl,-wrap,dlopen".} {.emit: """ #include #include void *__real_dlopen(const char *filename, int flags); void *__wrap_dlopen(const char *f

Nim 1.2.10 RC and 1.4.4 RC

2021-02-19 Thread gemath
There are branches named version-1-4 and version-1-2 IIRC, they may be the closest thing. `choosenim #version-1-` should work.

How to allow out of bounds access on sized arrays?

2021-02-19 Thread Araq
Model it as type Charblock* = array[512*8, uint32] Run and then have accessors that support a 3D view into the array.

Patching existing libraries with "include"

2021-02-19 Thread benob
I will do that. Actually, the net/asyncnet api is out of sync in many places. I might extend that to a few more commits.

Nim 1.2.10 RC and 1.4.4 RC

2021-02-19 Thread benob
Is there a way to test them with choosenim?