{"id":15604532,"url":"https://github.com/oprypin/nim-csfml","last_synced_at":"2025-04-09T16:18:01.974Z","repository":{"id":25271687,"uuid":"28697153","full_name":"oprypin/nim-csfml","owner":"oprypin","description":"Nim bindings to SFML multimedia/game library ","archived":false,"fork":false,"pushed_at":"2022-10-16T14:19:31.000Z","size":635,"stargazers_count":86,"open_issues_count":0,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-09T16:17:53.215Z","etag":null,"topics":["bindings","csfml","game-framework","nim","sfml"],"latest_commit_sha":null,"homepage":"","language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oprypin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-01T22:21:56.000Z","updated_at":"2025-04-02T16:52:18.000Z","dependencies_parsed_at":"2023-01-14T02:26:37.790Z","dependency_job_id":null,"html_url":"https://github.com/oprypin/nim-csfml","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oprypin%2Fnim-csfml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oprypin%2Fnim-csfml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oprypin%2Fnim-csfml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oprypin%2Fnim-csfml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oprypin","download_url":"https://codeload.github.com/oprypin/nim-csfml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065281,"owners_count":21041872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bindings","csfml","game-framework","nim","sfml"],"created_at":"2024-10-03T03:41:54.174Z","updated_at":"2025-04-09T16:18:01.929Z","avatar_url":"https://github.com/oprypin.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"nim-csfml\n=========\n#### [Nim][] Bindings to [Simple and Fast Multimedia Library][sfml] (through [CSFML][]).\n\n**See [introduction](#introduction), [examples](examples), [documentation][], [wiki][].**\n\nWarning\n-------\n\nThis library consists of class wrappers implemented as `ptr object`. Because Nim does not allow attaching pointers to the garbage collector, disposal of objects is not implemented and needs to be manual, by calling the `destroy` methods. Standard memory management caveats apply: destroying objects that are still used will break things, forgetting to destroy is a memory leak.\n\n[More details](https://github.com/BlaXpirit/nim-csfml/issues/6)\n\nThis library is not under active development, but detailed bug reports will be given proper attention.\n\n\nIntroduction\n------------\n\n*nim-csfml* allows you to use [SFML][], which is a library made in C++. So most information and [tutorials][sfml-tutorials] for SFML revolve around C++. It is a good idea to get familiar with SFML itself first.\n\nThe API attempts to be very similar to SFML's, but some general changes are present:\n\n- To construct an object (`sf::SomeType x(param)`), use a corresponding procedure (there are 2 variations):\n    - `var x = newSomeType(param)`, which means it is a `ptr object`.\n        - Such objects need to have `destroy` called to properly dispose of them.\n        - Never create them using `new`.\n    - `var x = someType(param)`, which means it is an `object` (in CSFML it corresponds to a simple `struct`).\n        - `Vector2(i|f)`, `Vector3f` and `(Int|Float)Rect` should be created using special `vec2`, `vec3` and `rect` procs.\n    - Member functions, such as `loadFromFile`, that are used for initialization, are also represented as constructor procs described above.\n- Getter, setter functions are changed:\n    - `x.getSomeProperty()` and `x.isSomeProperty()` both become `x.someProperty`.\n    - `x.setSomeProperty(v)` becomes `x.someProperty = v`.\n- Some renames of members were necessary because of reserved words:\n    - `type`: `kind`, `object`: `obj`, `string`: `str`, `bind`: `bindGL`.\n- `enum` names were taken from CSFML, but changed to remove their common prefix to resemble SFML's values.\n    - Expect surprises in their naming. Use the [documentation][].\n    - `enum`s are all `pure`: use `EnumType.Value`.\n    - A few `enum`s are just represented as a list of constants, because they are not really enumerations.\n    - SFML sometimes uses `enum` values as bitmasks. You can combine them using the `|` (not `or`) operator defined for `BitMaskU32` in the *util* module.\n- Unicode is supported and easy to use (no need for `sf::String` or strange conversions):\n    - CSFML's functions can deal with locale-dependent C strings (which should not be used)...\n    - and UTF-32 sequences, which have been wrapped for convenient use with Nim's normal UTF-8 strings.\n- Type differences:\n    - Sadly, `cint` and `cfloat` will be present everywhere, so explicit conversions to/from Nim's normal types may be required.\n    - `unsigned int` is mapped as `cint`, etc., so you don't have to bother with unsigned conversions. This shouldn't cause problems, but it might.\n    - The *util* module contains some types that provide implicit conversions.\n        - For example `sfBool` which is defined as `int`, is mapped to the `IntBool` type with conversions to Nim's `bool`.\n- If you want to use some particular CSFML function but don't know what it maps to in *nim-csfml*, you can just search for its name in the [documentation][].\n- Most of the [documentation][] is taken directly from CSFML, so don't be surprised if it talks in C/C++ terms.\n\nSee [examples](examples) to learn more.\n\n### Implementation\n\nThe files \u003cem\u003e[private](src/csfml/private)/\\*\\_gen.nim\u003c/em\u003e are [automatically generated](generate) from CSFML's header files. They provide the base CSFML API. The files \u003cem\u003ecsfml_\\*.nim\u003c/em\u003e build upon them, adding compatibility with SFML API.  \n*csfml.nim* automatically imports *system*, *window* and *graphics*; *audio* should be imported separately; *network* is not implemented.\n\n*nim-csfml*'s version number (`x.y.z`): `x.y` corresponds to the supported CSFML version; `z` is for the project's own point releases.\n\n\nInstallation\n------------\n\n*nim-csfml* supports CSFML 2.5; there are older releases, down to CSFML 2.1. It has been tested on Linux 64-bit.\n\nThis library can be installed using \u003ccode\u003e[nimble][] install csfml\u003c/code\u003e.\n\n[CSFML][] 2.5, which requires [SFML][] 2.5, must be installed to use it.\nOn Windows you can just [download CSFML][csfml] and put the DLLs (which seem to be statically linked with SFML) in your project folder instead.\n\n### [Troubleshooting][]\n\n\n[Contributing][]\n----------------\n\n\nAcknowledgements\n----------------\n\n[License](LICENSE): zlib/libpng\n\nThis library uses and is based on [SFML][] and [CSFML][].\n\n[nimrod-sfml][] was a great source of knowledge.\n\n[Nim][] and [Python][] programming languages are used.\n\n\n[documentation]: http://blaxpirit.github.io/nim-csfml/\n[wiki]: https://github.com/BlaXpirit/nim-csfml/wiki\n[contributing]: https://github.com/BlaXpirit/nim-csfml/wiki/Contributing\n[troubleshooting]: https://github.com/BlaXpirit/nim-csfml/wiki/Troubleshooting\n[sfml]: http://www.sfml-dev.org/ \"Simple and Fast Multimedia Library\"\n[csfml]: http://www.sfml-dev.org/download/csfml/\n[sfml-tutorials]: http://www.sfml-dev.org/tutorials/\n[nim]: http://nim-lang.org/\n[python]: http://python.org/\n[nimble]: https://github.com/nim-lang/nimble\n[nimrod-sfml]: https://github.com/fowlmouth/nimrod-sfml\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foprypin%2Fnim-csfml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foprypin%2Fnim-csfml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foprypin%2Fnim-csfml/lists"}