You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-12Lines changed: 20 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,17 +5,19 @@
5
5
Documentation
6
6
-------------
7
7
8
-
#### [Introduction](#introduction)
9
-
#### [Installation](#installation)
10
-
#### [Tutorials][]
11
-
#### [API Documentation][]
12
-
#### [Examples](examples) / [Demos][]
8
+
-**[Installation](#installation)**
9
+
10
+
-**[Tutorials][]**
11
+
12
+
-**[API Documentation][]**
13
+
14
+
-**[Examples](examples)** / **[Demos][]**
13
15
14
16
15
17
Introduction
16
18
------------
17
19
18
-
**Note to existing users**: *CrSFML* has been recently rewritten from scratch. See the [release notes][releases] for information.
20
+
**Note to existing users**: *CrSFML* has been recently rewritten from scratch. *CrSFML* releases since 2.4 have an entirely different installation procedure, and multiple important API changes.
19
21
20
22
*CrSFML* is a library that allows SFML to be used with the Crystal programming language. [SFML][] is a library written in C++, so *CrSFML* also needs to ship C bindings to SFML, called *VoidCSFML*.
21
23
@@ -25,7 +27,7 @@ To quote the official site of SFML,
25
27
26
28
Indeed, SFML is most often used to make video games. It provides features such as hardware-accelerated 2D graphics, handling keyboard, mouse and gamepad input, vector and matrix manipulation, managing windows (can also be used as a base for OpenGL drawing), working with multiple image formats, audio playback and recording, basic networking... Check out some [demos][] of *CrSFML* to see what it can do.
27
29
28
-
*CrSFML* consists almost entirely of automatically generated code, based on SFML's header files. The *dev* git branch contains the [generator program](generate.cr) and the small manually written source files. The generated source code can be viewed at the [sources][] branch.
30
+
*CrSFML* consists almost entirely of automatically generated code, based on SFML's header files. The *master* git branch contains the [generator program](generate.cr) and the small manually written source files. The generated source code can be viewed at the [sources][] branch.
29
31
30
32
### Differences between SFML and CrSFML
31
33
@@ -49,12 +51,14 @@ The API of *CrSFML* (a library for Crystal) attempts to be similar to SFML (a C+
49
51
Installation
50
52
------------
51
53
54
+
Note that using [Shards][] is not enough to install *CrSFML*.
55
+
52
56
This section defines two sets of step-by-step instructions to install *CrSFML* but these are not the only ways to do it; they can even be mixed (see [VoidCSFML installation instructions](voidcsfml/README.md#installation) for an alternative look)
53
57
54
58
-[Approach 1](#approach-1): Generate latest *CrSFML* and *VoidCSFML* source code "from scratch"; build and use them from a local directory
55
59
- Advantages:
56
60
- The bindings can be fine-tuned to your system.
57
-
- Should support any SFML 2.3.x, maybe even other versions.
- This is the right setup if you wish to contribute to *CrSFML*.
59
63
- Disadvantages:
60
64
- Need to always provide full path to *VoidCSFML* libraries when running a program using *CrSFML*.
@@ -63,16 +67,20 @@ This section defines two sets of step-by-step instructions to install *CrSFML* b
63
67
- Advantages:
64
68
- Easier installation.
65
69
- Disadvantages:
66
-
- Tied to a particular version of SFML.
70
+
- Tied to a particular version of SFML (only SFML 2.4 right now).
67
71
- Although sizes of SFML objects seem to always be of equal or smaller sizes than on Linux 64-bit with latest GCC (where the sources are generated), this is not completely guaranteed. So, in case of a mismatch, data may be written outside of the memory region allocated for an object.
68
72
69
73
### Install SFML
70
74
71
75
The first step is to install the [SFML][] library itself. There are detailed [official instructions][sfml-install] on how to install it manually, however, on many systems there are easier ways.
72
76
77
+
SFML versions 2.4.x and 2.3.x are supported by *CrSFML*.
78
+
73
79
#### Linux
74
80
75
-
Linux-based systems known to provide SFML 2.3.2 through their package manager: Ubuntu 16.04, Arch Linux, Fedora. Note that if you're installing an older version of SFML, it is not guaranteed to work (in fact, installation with [Approach 2](#approach-2) is almost guaranteed **not** to work).
81
+
Many Linux-based systems provide SFML through their package manager. Make sure to install the *-dev* packages if there is such a separation in your Linux distribution of choice.
82
+
83
+
Note that most often the packages provided by Linux distributions are outdated. If you're installing an older version of SFML (not recommended), make sure that it's still [supported by *CrSFML*](#install-sfml). For installation with [Approach 2](#approach-2) getting the latest version is even more important.
76
84
77
85
For information on building SFML from source, check out [this article][sfml-install-linux] (but no need to install CSFML). It is as simple as downloading the source code and running:
78
86
@@ -101,7 +109,7 @@ Prerequisites: [Git][], [CMake][], [Crystal][], a C++ compiler
101
109
#### Download latest generator source code
102
110
103
111
```bash
104
-
git clone -b dev https://github.com/blaxpirit/crsfml
112
+
git clone https://github.com/blaxpirit/crsfml
105
113
cd crsfml
106
114
```
107
115
@@ -152,7 +160,7 @@ Prerequisites: [CMake][], [Crystal][], a C++ compiler
152
160
153
161
#### Download a release of CrSFML
154
162
155
-
Find the release of *CrSFML* that corresponds to your installed version of *SFML* (latest is strongly recommended) at the [releases][] page.
163
+
Find the release of *CrSFML* that corresponds to your installed version of *SFML* (latest is strongly recommended) at the [releases][] page. Note that only releases starting at 2.4 are applicable, and only SFML versions since 2.4 are supported in this approach. The older releases are legacy CSFML-based releases.
156
164
157
165
Download and extract it, and remember the version of the release (let's say v1.2.3) for later.
0 commit comments