make openal.example load, it's still broken..
parent
c1d1fe9b20
commit
49365799d1
|
@ -1,34 +1,33 @@
|
||||||
! Copyright (C) 2007 Chris Double.
|
! Copyright (C) 2007 Chris Double.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
!
|
USING: calendar kernel openal sequences threads ;
|
||||||
IN: openal.example
|
IN: openal.example
|
||||||
USING: openal kernel alien threads sequences calendar ;
|
|
||||||
|
|
||||||
: play-hello ( -- )
|
: play-hello ( -- )
|
||||||
init-openal
|
init-openal
|
||||||
1 gen-sources
|
1 gen-sources
|
||||||
first dup AL_BUFFER alutCreateBufferHelloWorld set-source-param
|
first dup AL_BUFFER alutCreateBufferHelloWorld set-source-param
|
||||||
source-play
|
source-play
|
||||||
1000 milliseconds sleep ;
|
1000 milliseconds sleep ;
|
||||||
|
|
||||||
: (play-file) ( source -- )
|
: (play-file) ( source -- )
|
||||||
100 milliseconds sleep
|
100 milliseconds sleep
|
||||||
dup source-playing? [ (play-file) ] [ drop ] if ;
|
dup source-playing? [ (play-file) ] [ drop ] if ;
|
||||||
|
|
||||||
: play-file ( filename -- )
|
: play-file ( filename -- )
|
||||||
init-openal
|
init-openal
|
||||||
create-buffer-from-file
|
create-buffer-from-file
|
||||||
1 gen-sources
|
1 gen-sources
|
||||||
first dup >r AL_BUFFER rot set-source-param r>
|
first dup [ AL_BUFFER rot set-source-param ] dip
|
||||||
dup source-play
|
dup source-play
|
||||||
check-error
|
check-error
|
||||||
(play-file) ;
|
(play-file) ;
|
||||||
|
|
||||||
: play-wav ( filename -- )
|
: play-wav ( filename -- )
|
||||||
init-openal
|
init-openal
|
||||||
create-buffer-from-wav
|
create-buffer-from-wav
|
||||||
1 gen-sources
|
1 gen-sources
|
||||||
first dup >r AL_BUFFER rot set-source-param r>
|
first dup [ AL_BUFFER rot set-source-param ] dip
|
||||||
dup source-play
|
dup source-play
|
||||||
check-error
|
check-error
|
||||||
(play-file) ;
|
(play-file) ;
|
||||||
|
|
Loading…
Reference in New Issue