Skip to content

Commit 6bf58da

Browse files
author
Robot
committed
Generate sources (3ee94f7)
1 parent 8bbcfa7 commit 6bf58da

35 files changed

+2185
-366
lines changed

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The API of *CrSFML* (a library for Crystal) attempts to be similar to SFML (a C+
3636
- `x.getSomeProperty()` becomes `x.some_property`.
3737
- `x.isSomeProperty()`, `x.hasSomeProperty()` become `x.some_property?`.
3838
- `x.setSomeProperty(v)` becomes `x.some_property = v`.
39-
- 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).
4040
- 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.
4141
- SFML sometimes uses *enum* values as bitmasks. You can combine them using the `|` operator.
4242
- *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*.
5353

5454
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)
5555

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
5757
- Advantages:
58-
- The bindings can be fine-tuned to your system.
58+
- This is the right setup if you wish to:
59+
- Distribute your application with the libraries
60+
- Contribute to *CrSFML*
5961
- Supports multiple recent [SFML versions](#install-sfml).
60-
- This is the right setup if you wish to contribute to *CrSFML*.
6162
- Disadvantages:
6263
- Need to always provide full path to *VoidCSFML* libraries when running a program using *CrSFML*.
63-
- Can't install *CrSFML* directly though [shards][].
64+
- Can't install *CrSFML* directly through [shards][].
6465
- [Approach 2](#approach-2): Use pre-compiled sources; build *VoidCSFML* and install it globally; install a release of *CrSFML* through [shards][]
6566
- Advantages:
6667
- Convenient installation.
6768
- 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.
7071

7172
### Install SFML
7273

7374
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.
7475

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*.
7677

7778
#### Linux
7879

@@ -117,7 +118,7 @@ cd crsfml
117118
cmake . && make
118119
```
119120

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.
121122
122123
If ran successfully, this generates all the source files for *VoidCSFML* and *CrSFML*, and also compiles *VoidCSFML*.
123124

examples/README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Examples
2121
- React to close and keyboard events
2222
- Use a `Texture` and a `Sprite`
2323
- Move, scale, rotate, draw
24+
- Elapsed time for physics, using `Clock`
2425

2526
### [snakes](snakes.cr)
2627

@@ -33,14 +34,20 @@ Examples
3334
### [transformable](transformable.cr)
3435

3536
- Custom transformable drawable
36-
- `Clock`
37+
- Absolute time measurement with `Clock`
38+
39+
### [text_input](text_input.cr)
40+
- Unicode keyboard input
41+
- Text metric measurements
42+
- Periodic events with `Clock`
43+
- `BlendMode` (draw with inverted color)
44+
- Detecting features by SFML version
3745

3846
### [diagnostics](diagnostics.cr)
3947

4048
- Listing controllers, screen modes, audio devices
4149
- Mouse state and events
42-
- Keyboard state and events, `TextEntered`
43-
- Unicode
50+
- Keyboard state and events
4451
- Controller state and events
4552
- Drawing with shapes
4653
- Simple GUI (just buttons)

0 commit comments

Comments
 (0)