Skip to content

Commit 8bbcfa7

Browse files
author
Robot
committed
Generate sources (4c31ffd)
1 parent 27db34d commit 8bbcfa7

File tree

26 files changed

+1309
-482
lines changed

26 files changed

+1309
-482
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ Documentation
1717
Introduction
1818
------------
1919

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. See the [release notes][releases] for information.
21-
2220
*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*.
2321

2422
To quote the official site of SFML,
@@ -68,7 +66,7 @@ This section defines two sets of step-by-step instructions to install *CrSFML* b
6866
- Convenient installation.
6967
- Disadvantages:
7068
- Tied to a particular version of SFML (only SFML 2.4 right now).
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.
69+
- Less performant, because memory layout optimizations can't be cross-platform.
7270

7371
### Install SFML
7472

examples/transformable.cr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class Logo < SF::Transformable
77
include SF::Drawable
88

99
def initialize(message = "CrSFML")
10+
super()
1011
@text = SF::Text.new(message, FONT, 200)
1112
bounds = @text.local_bounds
1213
@shape = SF::RectangleShape.new(SF.vector2(bounds.width*1.2, bounds.height*2))

shard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: crsfml
2-
version: 2.4.5
2+
version: 2.4.10
33

44
authors:
55
- Oleh Prypin <[email protected]>
@@ -9,7 +9,7 @@ description: |
99
1010
license: zlib
1111

12-
crystal: 0.22.0
12+
crystal: 0.23.1
1313

1414
libraries:
1515
SFML: 2.4.2

src/audio/lib.cr

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ require "../config"
22
require "../system/lib"
33
@[Link("voidcsfml-audio")]
44
lib VoidCSFML
5+
fun sfml_listener_allocate(result : Void**)
6+
fun sfml_listener_free(self : Void*)
57
fun sfml_listener_setglobalvolume_Bw9(volume : LibC::Float)
68
fun sfml_listener_getglobalvolume(result : LibC::Float*)
79
fun sfml_listener_setposition_Bw9Bw9Bw9(x : LibC::Float, y : LibC::Float, z : LibC::Float)
@@ -13,6 +15,10 @@ lib VoidCSFML
1315
fun sfml_listener_setupvector_Bw9Bw9Bw9(x : LibC::Float, y : LibC::Float, z : LibC::Float)
1416
fun sfml_listener_setupvector_NzM(up_vector : Void*)
1517
fun sfml_listener_getupvector(result : Void*)
18+
fun sfml_alresource_allocate(result : Void**)
19+
fun sfml_alresource_free(self : Void*)
20+
fun sfml_soundsource_allocate(result : Void**)
21+
fun sfml_soundsource_free(self : Void*)
1622
fun sfml_soundsource_finalize(self : Void*)
1723
fun sfml_soundsource_setpitch_Bw9(self : Void*, pitch : LibC::Float)
1824
fun sfml_soundsource_setvolume_Bw9(self : Void*, volume : LibC::Float)
@@ -29,6 +35,9 @@ lib VoidCSFML
2935
fun sfml_soundsource_getattenuation(self : Void*, result : LibC::Float*)
3036
fun sfml_soundstream_ongetdata_callback(callback : (Void*, Int16**, LibC::SizeT*, Bool* ->))
3137
fun sfml_soundstream_onseek_callback(callback : (Void*, Void* ->))
38+
fun sfml_soundstream_parent(self : Void*, parent : Void*)
39+
fun sfml_soundstream_allocate(result : Void**)
40+
fun sfml_soundstream_free(self : Void*)
3241
fun sfml_soundstream_finalize(self : Void*)
3342
fun sfml_soundstream_play(self : Void*)
3443
fun sfml_soundstream_pause(self : Void*)
@@ -55,6 +64,8 @@ lib VoidCSFML
5564
fun sfml_soundstream_isrelativetolistener(self : Void*, result : Bool*)
5665
fun sfml_soundstream_getmindistance(self : Void*, result : LibC::Float*)
5766
fun sfml_soundstream_getattenuation(self : Void*, result : LibC::Float*)
67+
fun sfml_music_allocate(result : Void**)
68+
fun sfml_music_free(self : Void*)
5869
fun sfml_music_initialize(self : Void*)
5970
fun sfml_music_finalize(self : Void*)
6071
fun sfml_music_openfromfile_zkC(self : Void*, filename_size : LibC::SizeT, filename : LibC::Char*, result : Bool*)
@@ -84,6 +95,8 @@ lib VoidCSFML
8495
fun sfml_music_isrelativetolistener(self : Void*, result : Bool*)
8596
fun sfml_music_getmindistance(self : Void*, result : LibC::Float*)
8697
fun sfml_music_getattenuation(self : Void*, result : LibC::Float*)
98+
fun sfml_sound_allocate(result : Void**)
99+
fun sfml_sound_free(self : Void*)
87100
fun sfml_sound_initialize(self : Void*)
88101
fun sfml_sound_initialize_mWu(self : Void*, buffer : Void*)
89102
fun sfml_sound_finalize(self : Void*)
@@ -111,6 +124,8 @@ lib VoidCSFML
111124
fun sfml_sound_isrelativetolistener(self : Void*, result : Bool*)
112125
fun sfml_sound_getmindistance(self : Void*, result : LibC::Float*)
113126
fun sfml_sound_getattenuation(self : Void*, result : LibC::Float*)
127+
fun sfml_soundbuffer_allocate(result : Void**)
128+
fun sfml_soundbuffer_free(self : Void*)
114129
fun sfml_soundbuffer_initialize(self : Void*)
115130
fun sfml_soundbuffer_finalize(self : Void*)
116131
fun sfml_soundbuffer_loadfromfile_zkC(self : Void*, filename_size : LibC::SizeT, filename : LibC::Char*, result : Bool*)
@@ -126,6 +141,9 @@ lib VoidCSFML
126141
fun sfml_soundrecorder_onstart_callback(callback : (Void*, Bool* ->))
127142
fun sfml_soundrecorder_onprocesssamples_callback(callback : (Void*, Int16*, LibC::SizeT, Bool* ->))
128143
fun sfml_soundrecorder_onstop_callback(callback : (Void* ->))
144+
fun sfml_soundrecorder_parent(self : Void*, parent : Void*)
145+
fun sfml_soundrecorder_allocate(result : Void**)
146+
fun sfml_soundrecorder_free(self : Void*)
129147
fun sfml_soundrecorder_finalize(self : Void*)
130148
fun sfml_soundrecorder_start_emS(self : Void*, sample_rate : LibC::UInt, result : Bool*)
131149
fun sfml_soundrecorder_stop(self : Void*)
@@ -141,7 +159,9 @@ lib VoidCSFML
141159
fun sfml_soundrecorder_setprocessinginterval_f4T(self : Void*, interval : Void*)
142160
fun sfml_soundrecorder_onstart(self : Void*, result : Bool*)
143161
fun sfml_soundrecorder_onstop(self : Void*)
162+
fun sfml_soundbufferrecorder_allocate(result : Void**)
144163
fun sfml_soundbufferrecorder_initialize(self : Void*)
164+
fun sfml_soundbufferrecorder_free(self : Void*)
145165
fun sfml_soundbufferrecorder_finalize(self : Void*)
146166
fun sfml_soundbufferrecorder_getbuffer(self : Void*, result : Void**)
147167
fun sfml_soundbufferrecorder_start_emS(self : Void*, sample_rate : LibC::UInt, result : Bool*)

0 commit comments

Comments
 (0)