Hey there,
I'm somewhat new to Nim. As a project, I would like to write a small game in Nim. But I've been kind of stuck on how to manage 2D graphics. There is an official graphics package, but due to missing documentation I have problems using it. I can't even run the example code from the source. Since I mostly want text, I also tried wrapping ncurses, but I decided I would rather have something stand-alone that doesn't need a terminal. I did learn how easy it is to import external library functions, but ran into other problems, such as importing macros. SDL2 is also a possibility, but where the documentation on graphics was lacking, SDL2 has none at all. My actual question is this: Since I am a somewhat inexperienced programmer, should I leave Nim for when it is finished and has better documentation, and just write my project in something else? Would it make sense to follow the wealth of C documentation out there, and just 'wrap' as I go? Or is there a better way for me develop an understanding of the Nim libraries?
PS: I don't know if this is the right place to ask advice like this.
on how to manage 2D graphics.
For nice, but slow 2D graphics you may also consider Cairo, maybe together with GTK3, I did my schematics editor with it, still in Ruby. But I think that is not a good choice if you want to sell your games :-). And when you intend to make fast games later, Cairo is not the right choice of course. OpenGl -- well I heard recently that it will be replaced with GLnext /Vulkan soon. Generally as a beginner I would search for a good Tutorial or Book and start in the language which is used there.
I think it's very bad advice to ignore OpenGL on account of a nonexistent GLNext/Vulkan. Despite any deficiencies in OpenGL, you'll have more experience if/when OpenGL is 'replaced'. I'm pretty sure that Nim will have a Vulkan package shortly after the C API is released.
There's a lot of available SDL2 info in C or C++, and a working example to get started on (I had to use brew on OS X to get sdl2, and then nimble install opengl and sdl2, and then the sdl2 examples worked) so I'd go with that. Oh yeah, if you're using OS X you'll want to download X11 from http://xquartz.macosforge.org/landing/
I'm not a game programmer, but that's how I'd start.
I think it's very bad advice to ignore OpenGL on account of a nonexistent GLNext/Vulkan.
But I myself will not spent time to learn OpenGL any more I think. Some years ago I considered OpenGL instead of Cairo for my schematics editor, but I hesitated to buy and read a thick book about it, and I was not very happy with the online tutorials I found. And I heard that OpenGL was inferior to the Windows libs, DirectX or whatever they are called. And of course Cairo has some advantages for 2D when performance requirement is not high -- easy API, good quality with gradieants, Bezier-Curves and much more, and various backends like SVG, PDF. Not useful for games, but for other graphics tools.
I'm pretty sure that Nim will have a Vulkan package shortly after the C API is released.
That would be nice. I think the C API will appear in 2015.