Skip to content

Commit

Permalink
Generate sources (4c31ffd)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robot committed Aug 6, 2017
1 parent 27db34d commit 8bbcfa7
Show file tree
Hide file tree
Showing 26 changed files with 1,309 additions and 482 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ Documentation
Introduction
------------

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

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

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

### Install SFML

Expand Down
1 change: 1 addition & 0 deletions examples/transformable.cr
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Logo < SF::Transformable
include SF::Drawable

def initialize(message = "CrSFML")
super()
@text = SF::Text.new(message, FONT, 200)
bounds = @text.local_bounds
@shape = SF::RectangleShape.new(SF.vector2(bounds.width*1.2, bounds.height*2))
Expand Down
4 changes: 2 additions & 2 deletions shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: crsfml
version: 2.4.5
version: 2.4.10

authors:
- Oleh Prypin <oleh@pryp.in>
Expand All @@ -9,7 +9,7 @@ description: |
license: zlib

crystal: 0.22.0
crystal: 0.23.1

libraries:
SFML: 2.4.2
20 changes: 20 additions & 0 deletions src/audio/lib.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ require "../config"
require "../system/lib"
@[Link("voidcsfml-audio")]
lib VoidCSFML
fun sfml_listener_allocate(result : Void**)
fun sfml_listener_free(self : Void*)
fun sfml_listener_setglobalvolume_Bw9(volume : LibC::Float)
fun sfml_listener_getglobalvolume(result : LibC::Float*)
fun sfml_listener_setposition_Bw9Bw9Bw9(x : LibC::Float, y : LibC::Float, z : LibC::Float)
Expand All @@ -13,6 +15,10 @@ lib VoidCSFML
fun sfml_listener_setupvector_Bw9Bw9Bw9(x : LibC::Float, y : LibC::Float, z : LibC::Float)
fun sfml_listener_setupvector_NzM(up_vector : Void*)
fun sfml_listener_getupvector(result : Void*)
fun sfml_alresource_allocate(result : Void**)
fun sfml_alresource_free(self : Void*)
fun sfml_soundsource_allocate(result : Void**)
fun sfml_soundsource_free(self : Void*)
fun sfml_soundsource_finalize(self : Void*)
fun sfml_soundsource_setpitch_Bw9(self : Void*, pitch : LibC::Float)
fun sfml_soundsource_setvolume_Bw9(self : Void*, volume : LibC::Float)
Expand All @@ -29,6 +35,9 @@ lib VoidCSFML
fun sfml_soundsource_getattenuation(self : Void*, result : LibC::Float*)
fun sfml_soundstream_ongetdata_callback(callback : (Void*, Int16**, LibC::SizeT*, Bool* ->))
fun sfml_soundstream_onseek_callback(callback : (Void*, Void* ->))
fun sfml_soundstream_parent(self : Void*, parent : Void*)
fun sfml_soundstream_allocate(result : Void**)
fun sfml_soundstream_free(self : Void*)
fun sfml_soundstream_finalize(self : Void*)
fun sfml_soundstream_play(self : Void*)
fun sfml_soundstream_pause(self : Void*)
Expand All @@ -55,6 +64,8 @@ lib VoidCSFML
fun sfml_soundstream_isrelativetolistener(self : Void*, result : Bool*)
fun sfml_soundstream_getmindistance(self : Void*, result : LibC::Float*)
fun sfml_soundstream_getattenuation(self : Void*, result : LibC::Float*)
fun sfml_music_allocate(result : Void**)
fun sfml_music_free(self : Void*)
fun sfml_music_initialize(self : Void*)
fun sfml_music_finalize(self : Void*)
fun sfml_music_openfromfile_zkC(self : Void*, filename_size : LibC::SizeT, filename : LibC::Char*, result : Bool*)
Expand Down Expand Up @@ -84,6 +95,8 @@ lib VoidCSFML
fun sfml_music_isrelativetolistener(self : Void*, result : Bool*)
fun sfml_music_getmindistance(self : Void*, result : LibC::Float*)
fun sfml_music_getattenuation(self : Void*, result : LibC::Float*)
fun sfml_sound_allocate(result : Void**)
fun sfml_sound_free(self : Void*)
fun sfml_sound_initialize(self : Void*)
fun sfml_sound_initialize_mWu(self : Void*, buffer : Void*)
fun sfml_sound_finalize(self : Void*)
Expand Down Expand Up @@ -111,6 +124,8 @@ lib VoidCSFML
fun sfml_sound_isrelativetolistener(self : Void*, result : Bool*)
fun sfml_sound_getmindistance(self : Void*, result : LibC::Float*)
fun sfml_sound_getattenuation(self : Void*, result : LibC::Float*)
fun sfml_soundbuffer_allocate(result : Void**)
fun sfml_soundbuffer_free(self : Void*)
fun sfml_soundbuffer_initialize(self : Void*)
fun sfml_soundbuffer_finalize(self : Void*)
fun sfml_soundbuffer_loadfromfile_zkC(self : Void*, filename_size : LibC::SizeT, filename : LibC::Char*, result : Bool*)
Expand All @@ -126,6 +141,9 @@ lib VoidCSFML
fun sfml_soundrecorder_onstart_callback(callback : (Void*, Bool* ->))
fun sfml_soundrecorder_onprocesssamples_callback(callback : (Void*, Int16*, LibC::SizeT, Bool* ->))
fun sfml_soundrecorder_onstop_callback(callback : (Void* ->))
fun sfml_soundrecorder_parent(self : Void*, parent : Void*)
fun sfml_soundrecorder_allocate(result : Void**)
fun sfml_soundrecorder_free(self : Void*)
fun sfml_soundrecorder_finalize(self : Void*)
fun sfml_soundrecorder_start_emS(self : Void*, sample_rate : LibC::UInt, result : Bool*)
fun sfml_soundrecorder_stop(self : Void*)
Expand All @@ -141,7 +159,9 @@ lib VoidCSFML
fun sfml_soundrecorder_setprocessinginterval_f4T(self : Void*, interval : Void*)
fun sfml_soundrecorder_onstart(self : Void*, result : Bool*)
fun sfml_soundrecorder_onstop(self : Void*)
fun sfml_soundbufferrecorder_allocate(result : Void**)
fun sfml_soundbufferrecorder_initialize(self : Void*)
fun sfml_soundbufferrecorder_free(self : Void*)
fun sfml_soundbufferrecorder_finalize(self : Void*)
fun sfml_soundbufferrecorder_getbuffer(self : Void*, result : Void**)
fun sfml_soundbufferrecorder_start_emS(self : Void*, sample_rate : LibC::UInt, result : Bool*)
Expand Down

0 comments on commit 8bbcfa7

Please sign in to comment.