Openal fixes
parent
601f8fdd29
commit
ea903a67ba
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2007 Chris Double.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.c-types kernel alien alien.syntax shuffle
|
||||
combinators.lib openal.backend namespaces system ;
|
||||
openal.backend namespaces system generalizations ;
|
||||
IN: openal.macosx
|
||||
|
||||
LIBRARY: alut
|
||||
|
@ -10,5 +10,5 @@ FUNCTION: void alutLoadWAVFile ( ALbyte* fileName, ALenum* format, void** data,
|
|||
|
||||
M: macosx load-wav-file ( path -- format data size frequency )
|
||||
0 <int> f <void*> 0 <int> 0 <int>
|
||||
[ alutLoadWAVFile ] 4keep
|
||||
[ alutLoadWAVFile ] 4 nkeep
|
||||
[ [ [ *int ] dip *void* ] dip *int ] dip *int ;
|
|
@ -1,8 +1,8 @@
|
|||
! Copyright (C) 2007 Chris Double.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: kernel arrays alien system combinators alien.syntax namespaces
|
||||
USING: kernel accessors arrays alien system combinators alien.syntax namespaces
|
||||
alien.c-types sequences vocabs.loader shuffle
|
||||
openal.backend specialized-arrays.uint ;
|
||||
openal.backend specialized-arrays.uint alien.libraries generalizations ;
|
||||
IN: openal
|
||||
|
||||
<< "alut" {
|
||||
|
@ -245,13 +245,11 @@ SYMBOL: init
|
|||
f init set-global
|
||||
] unless ;
|
||||
|
||||
: <uint-array> ( n -- byte-array ) "ALuint" <c-array> ;
|
||||
|
||||
: gen-sources ( size -- seq )
|
||||
dup <uint-array> 2dup underlying>> alGenSources swap ;
|
||||
dup <uint-array> [ alGenSources ] keep ;
|
||||
|
||||
: gen-buffers ( size -- seq )
|
||||
dup <uint-array> 2dup underlying>> alGenBuffers swap ;
|
||||
dup <uint-array> [ alGenBuffers ] keep ;
|
||||
|
||||
: gen-buffer ( -- buffer ) 1 gen-buffers first ;
|
||||
|
||||
|
@ -264,10 +262,10 @@ os macosx? "openal.macosx" "openal.other" ? require
|
|||
|
||||
: create-buffer-from-wav ( filename -- buffer )
|
||||
gen-buffer dup rot load-wav-file
|
||||
[ alBufferData ] 4keep alutUnloadWAV ;
|
||||
[ alBufferData ] 4 nkeep alutUnloadWAV ;
|
||||
|
||||
: queue-buffers ( source buffers -- )
|
||||
[ length ] [ >uint-array underlying>> ] bi alSourceQueueBuffers ;
|
||||
[ length ] [ >uint-array ] bi alSourceQueueBuffers ;
|
||||
|
||||
: queue-buffer ( source buffer -- )
|
||||
1array queue-buffers ;
|
Loading…
Reference in New Issue