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
- Structs in Crystal are are always passed by copy, so modifying them can be problematic. For example, `my_struct.x = 7` is fine but `array_of_structs[2].x = 5` will not work. To work around this, copy the whole struct, modify it, then write it back. Better yet, avoid the need to modify structs (work with them like with immutable objects).
39
+
- Structs in Crystal are always passed by copy, so modifying them can be problematic. For example, `my_struct.x = 7` is fine but `array_of_structs[2].x = 5` will not work. To work around this, copy the whole struct, modify it, then write it back. Better yet, avoid the need to modify structs (work with them like with immutable objects).
40
40
- Member functions, such as `loadFromFile`, that are used for initialization, each have a corresponding shorthand class method (`from_file`) that raises `SF::InitError` on failure.
41
41
- SFML sometimes uses *enum* values as bitmasks. You can combine them using the `|` operator.
42
42
-*enum* members are exposed at class level, so instead of `SF::Keyboard::Code::Slash` you can use `SF::Keyboard::Slash`.
@@ -53,26 +53,27 @@ Note that using [Shards][] is not enough to install *CrSFML*.
53
53
54
54
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)
55
55
56
-
-[Approach 1](#approach-1): Generate latest *CrSFML* and *VoidCSFML* source code; build and use them from a local directory
56
+
-[Approach 1](#approach-1)**(recommended)**: Generate latest *CrSFML* and *VoidCSFML* source code; build and use them from a local directory
-[Approach 2](#approach-2): Use pre-compiled sources; build *VoidCSFML* and install it globally; install a release of *CrSFML* through [shards][]
65
66
- Advantages:
66
67
- Convenient installation.
67
68
- Disadvantages:
68
-
-Tied to a particular version of SFML (only SFML 2.4 right now).
69
-
-Less performant, because memory layout optimizations can't be cross-platform.
69
+
-Global installation litters your system.
70
+
-Tied to a particular version of SFML.
70
71
71
72
### Install SFML
72
73
73
74
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.
74
75
75
-
SFML versions 2.4.x and 2.3.x are supported by *CrSFML*.
76
+
SFML versions 2.3.x through 2.5.x are supported by *CrSFML*.
76
77
77
78
#### Linux
78
79
@@ -117,7 +118,7 @@ cd crsfml
117
118
cmake .&& make
118
119
```
119
120
120
-
> **Optional:**[out-of-source builds][] are also supported, but note that even the sources go to the build directory, so you would need perform all the following steps inside the build directory and not the root *crsfml* directory.
121
+
> **Optional:**[out-of-source builds][] are also supported, but note that even the sources go to the build directory, so you would need to perform all the following steps inside the build directory and not the root *crsfml* directory.
121
122
122
123
If ran successfully, this generates all the source files for *VoidCSFML* and *CrSFML*, and also compiles *VoidCSFML*.
0 commit comments