update game.worlds and gpu.demo.raytrace for audio.engine changes
parent
92409fd3b6
commit
87c09af8f3
|
@ -11,8 +11,6 @@ HELP: game-attributes
|
|||
{ { $snippet "use-audio-engine?" } " specifies whether the game world should manage an " { $link audio-engine } " instance. False by default." }
|
||||
{ { $snippet "audio-engine-device" } " specifies the string name of the OpenAL device the audio engine, if any, should try to open. The default value of " { $link POSTPONE: f } " attempts to open the default OpenAL device." }
|
||||
{ { $snippet "audio-engine-voice-count" } " determines the number of independent voices the audio engine will make available. This determines how many individual audio clips can play simultaneously. This cannot exceed the OpenAL implementation's limit on supported voices." }
|
||||
{ { $snippet "audio-engine-buffer-size" } " determines the size in bytes of the audio buffers the audio engine will stream to the sound card." }
|
||||
{ { $snippet "audio-engine-buffer-count" } " determines the number of buffers the audio engine will allocate per audio clip played." }
|
||||
} ;
|
||||
|
||||
HELP: game-world
|
||||
|
|
|
@ -12,8 +12,6 @@ TUPLE: game-world < world
|
|||
{ use-audio-engine? boolean }
|
||||
{ audio-engine-device initial: f }
|
||||
{ audio-engine-voice-count initial: 16 }
|
||||
{ audio-engine-buffer-size initial: 8192 }
|
||||
{ audio-engine-buffer-count initial: 2 }
|
||||
{ tick-slice float initial: 0.0 } ;
|
||||
|
||||
GENERIC: begin-game-world ( world -- )
|
||||
|
@ -38,8 +36,6 @@ M: game-world draw*
|
|||
{
|
||||
[ audio-engine-device>> ]
|
||||
[ audio-engine-voice-count>> ]
|
||||
[ audio-engine-buffer-size>> ]
|
||||
[ audio-engine-buffer-count>> ]
|
||||
} cleave <audio-engine>
|
||||
[ start-audio* ] keep ; inline
|
||||
|
||||
|
@ -63,9 +59,7 @@ TUPLE: game-attributes < world-attributes
|
|||
{ use-game-input? boolean initial: f }
|
||||
{ use-audio-engine? boolean initial: f }
|
||||
{ audio-engine-device initial: f }
|
||||
{ audio-engine-voice-count initial: 16 }
|
||||
{ audio-engine-buffer-size initial: 8192 }
|
||||
{ audio-engine-buffer-count initial: 2 } ;
|
||||
{ audio-engine-voice-count initial: 16 } ;
|
||||
|
||||
M: game-world apply-world-attributes
|
||||
{
|
||||
|
@ -74,8 +68,6 @@ M: game-world apply-world-attributes
|
|||
[ use-audio-engine?>> >>use-audio-engine? ]
|
||||
[ audio-engine-device>> >>audio-engine-device ]
|
||||
[ audio-engine-voice-count>> >>audio-engine-voice-count ]
|
||||
[ audio-engine-buffer-size>> >>audio-engine-buffer-size ]
|
||||
[ audio-engine-buffer-count>> >>audio-engine-buffer-count ]
|
||||
[ call-next-method ]
|
||||
} cleave ;
|
||||
|
||||
|
|
|
@ -79,13 +79,13 @@ CONSTANT: initial-spheres {
|
|||
audio-engine world >>listener update-audio
|
||||
|
||||
audio-engine "vocab:gpu/demos/raytrace/mirror-ball.aiff" read-audio
|
||||
spheres first t (audio-clip)
|
||||
spheres first t <static-audio-clip>
|
||||
audio-engine "vocab:gpu/demos/raytrace/red-ball.aiff" read-audio
|
||||
spheres second t (audio-clip)
|
||||
spheres second t <static-audio-clip>
|
||||
audio-engine "vocab:gpu/demos/raytrace/green-ball.aiff" read-audio
|
||||
spheres third t (audio-clip)
|
||||
spheres third t <static-audio-clip>
|
||||
audio-engine "vocab:gpu/demos/raytrace/yellow-ball.aiff" read-audio
|
||||
spheres fourth t (audio-clip)
|
||||
spheres fourth t <static-audio-clip>
|
||||
|
||||
4array play-clips ;
|
||||
|
||||
|
@ -124,7 +124,6 @@ GAME: raytrace-game {
|
|||
{ grab-input? t }
|
||||
{ use-game-input? t }
|
||||
{ use-audio-engine? t }
|
||||
{ audio-engine-buffer-count 4 }
|
||||
{ pref-dim { 1024 768 } }
|
||||
{ tick-interval-micros $[ 60 fps ] }
|
||||
} ;
|
||||
|
|
Loading…
Reference in New Issue