[q-lang-cvs] q-openal/examples alexample.q, 1.4, 1.5 alstream.q, 1.4, 1.5
Brought to you by:
agraef
From: Albert G. <ag...@us...> - 2007-12-15 00:35:34
|
Update of /cvsroot/q-lang/q-openal/examples In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv13308 Modified Files: alexample.q alstream.q Log Message: OpenAL 1.1 compatibility fixes Index: alstream.q =================================================================== RCS file: /cvsroot/q-lang/q-openal/examples/alstream.q,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** alstream.q 3 Jun 2006 10:07:09 -0000 1.4 --- alstream.q 15 Dec 2007 00:35:31 -0000 1.5 *************** *** 33,37 **** latency. */ ! def FPS = 10, DT = round (1000/FPS), BUFSZ = round (RATE/FPS), NBUFS = 4; /* Material and light definitions. */ --- 33,37 ---- latency. */ ! def FPS = 2, DT = round (1000/FPS), BUFSZ = round (RATE/FPS), NBUFS = 4; /* Material and light definitions. */ Index: alexample.q =================================================================== RCS file: /cvsroot/q-lang/q-openal/examples/alexample.q,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** alexample.q 19 Jul 2005 06:53:52 -0000 1.4 --- alexample.q 15 Dec 2007 00:35:31 -0000 1.5 *************** *** 51,56 **** the corresponding buffers. */ ! def SOURCES = alUIntVector 2, ! BUFFERS = alUIntVector 2; /* The main function. */ --- 51,55 ---- the corresponding buffers. */ ! def SOURCES = alUIntVector 2; /* The main function. */ *************** *** 78,95 **** glLightfv GL_LIGHT0 GL_POSITION LIGHT_POS || ! /* Initialize the audio library utility toolkit (ALUT). */ ! alutInit ARGS || ! /* Create ids for the sound sources and their buffers. */ ! alGenSources 2 SOURCES || ! alGenBuffers 2 BUFFERS || ! /* Load the wave files into the buffers. */ ! alBufferData (alGetUIntVector BUFFERS 0) (alutLoadWAVFile "left.wav") || ! alBufferData (alGetUIntVector BUFFERS 1) (alutLoadWAVFile "right.wav") || ! /* Assign the buffers to the corresponding sources. */ ! alSourcei (alGetUIntVector SOURCES 0) AL_BUFFER (alGetUIntVector BUFFERS 0) || ! alSourcei (alGetUIntVector SOURCES 1) AL_BUFFER (alGetUIntVector BUFFERS 1) || /* Set the parameters of the first source. */ --- 77,101 ---- glLightfv GL_LIGHT0 GL_POSITION LIGHT_POS || ! /* Initialize audio. */ ! init_alut || ! /* Install the GLUT callbacks. */ ! glutDisplayFunc display || ! glutReshapeFunc reshape || ! glutKeyboardFunc input || ! glutSpecialFunc input || ! /* Run the main loop. */ ! glutMainLoop; ! /* Initialize the audio library utility toolkit (ALUT) and prepare the ! audio data. */ ! ! init_alut ! = /* Create the sound sources and assign the buffers to the ! corresponding sources. */ ! alGenSources 2 SOURCES || ! alSourcei (alGetUIntVector SOURCES 0) AL_BUFFER BUF0 || ! alSourcei (alGetUIntVector SOURCES 1) AL_BUFFER BUF1 || /* Set the parameters of the first source. */ *************** *** 110,123 **** alListenerfv AL_POSITION LISTENER_POS || alListenerfv AL_VELOCITY LISTENER_VEL || ! alListenerfv AL_ORIENTATION LISTENER_ORI || ! ! /* Install the GLUT callbacks. */ ! glutDisplayFunc display || ! glutReshapeFunc reshape || ! glutKeyboardFunc input || ! glutSpecialFunc input || ! ! /* Run the main loop. */ ! glutMainLoop; /* Helper functions to keep track of the activation state of the sound --- 116,124 ---- alListenerfv AL_POSITION LISTENER_POS || alListenerfv AL_VELOCITY LISTENER_VEL || ! alListenerfv AL_ORIENTATION LISTENER_ORI ! where _ = alutInit ARGS, ! /* Load the wave files into the buffers. */ ! BUF0 = alutCreateBufferFromFile "left.wav", ! BUF1 = alutCreateBufferFromFile "right.wav"; /* Helper functions to keep track of the activation state of the sound |