Vladar4 / sdl2_nim

Wrapper of the SDL 2 library for the Nim language.
Other
147 stars 24 forks source link

Can't find "sdl2_nim" #27

Closed theAkito closed 5 years ago

theAkito commented 5 years ago

I don't know what the hell I am doing wrong, but after installing this package 3 times, it still says when importing the module like this:

from sdl2_nim import setClipboardText, hasClipboardText

Or like this:

import sdl2_nim

The following:

Error: cannot open file: sdl2_nim

Info:

$ nim --version
Nim Compiler Version 0.20.2 [Linux: amd64]
Compiled at 2019-07-17
Copyright (c) 2006-2019 by Andreas Rumpf

git hash: 88a0edba4b1a3d535b54336fd589746add54e937
active boot switches: -d:release

$ nimble list | grep sdl2
sdl2_nim:
  url:         https://github.com/Vladar4/sdl2_nim (git)
  tags:        library, wrapper, sdl2, game, video, image, audio, network, ttf
  website:     https://github.com/Vladar4/sdl2_nim

What am I missing?

krux02 commented 5 years ago

did you try running the examples like https://github.com/Vladar4/sdl2_nim/blob/master/examples/ex101_init.nim?

theAkito commented 5 years ago

did you try running the examples like https://github.com/Vladar4/sdl2_nim/blob/master/examples/ex101_init.nim?

Just ran this example and it works fine.

krux02 commented 5 years ago

Then this can be closed?

theAkito commented 5 years ago

Then this can be closed?

I can import sdl2/sdl but it is missing the procs I need, as described in the OP.

Actually, I didn't notice, that it actually is within sdl2/sdl so it seems to work now. Still, it is confusing to import it with a different name, especially a name that conflicts with the official sdl2 package name. Very confusing.

krux02 commented 5 years ago

I did not write this wrapper, but this is probably by design, so that fully qualified identifier have the prefix sdl, not sdl2 or sdl2_nim or something like that, similar to how the proces in C all have the prefixe SDL_ and not SDL2_.

theAkito commented 5 years ago

I did not write this wrapper, but this is probably by design, so that fully qualified identifier have the prefix sdl, not sdl2or`sdl2nimor something like that, similar to how the proces in C all have the prefixeSDLand notSDL2_``.

Oh well, didn't expect that taking over design aspects from one of the worst designed programming languages in existence would be something to consider. 😁

krux02 commented 5 years ago

it is something to consider when you want to port SDL programs written in C easily.

Vladar4 commented 5 years ago

Still, it is confusing to import it with a different name, especially a name that conflicts with the official sdl2 package name. Very confusing.

Well, the conflict with th official package isn'n the issue since you won't use two of them together anyway (also, who knows what obscure bugs might creep out if you tried such thing).

I did not write this wrapper, but this is probably by design, so that fully qualified identifier have the prefix sdl, not sdl2 or sdl2_nim or something like that, similar to how the proces in C all have the prefixe SDL_ and not SDL2_.

Correct.


Regarding the name/import discrepancy, I was thinking about renaming the module to sdl2 to get rid of this nimble warning: https://github.com/Vladar4/sdl2_nim/issues/26 but it will surely interfere with the official sdl2 package.

If you have a better idea, please, let me know.

theAkito commented 4 years ago

Vladar4 Thanks for your comment.

The name choice depends on your personal preference, I think. I could imagine calling it something like sdl2v (Vladar) or sdl2se (Special Edition 😁 )

because it would be absolutely clear that it is sdl2 but it would be also absolutely clear that it is not the official one but (perhaps a better) alternative to the original module. Of course there could be a name like sdl2_nim chosen or sdl2_ng though in my opinion this would be generic. I personally prefer something like the first examples like just, as mentioned, sdl2v because it is a very simple and tiny distinction but it is clear and that is what we need. What's your preference? 😃

Vladar4 commented 4 years ago

Thanks, I'll keep this idea in mind.