Mercurial > hg > beaglert
diff projects/tank_wars/render.cpp @ 14:06f93bef7dd2
Updated remaining examples to new API
author | andrewm |
---|---|
date | Fri, 23 Jan 2015 15:35:10 +0000 |
parents | 49f22e1246b2 |
children | fbfeb5895efd |
line wrap: on
line diff
--- a/projects/tank_wars/render.cpp Fri Jan 23 15:17:09 2015 +0000 +++ b/projects/tank_wars/render.cpp Fri Jan 23 15:35:10 2015 +0000 @@ -14,11 +14,6 @@ #include <cstdlib> #include <time.h> -float gFrequency; -float gPhase; -float gInverseSampleRate; -int gNumChannels; - int gInputTank1Angle = 0; // Inputs for the cannon angles int gInputTank2Angle = 1; int gInputLauncher = 2; // Input for launcher FSR @@ -77,15 +72,17 @@ // // Return true on success; returning false halts the program. -bool initialise_render(int numChannels, int numMatrixFramesPerPeriod, - int numAudioFramesPerPeriod, float matrixSampleRate, - float audioSampleRate, void *userData) +bool initialise_render(int numMatrixChannels, int numAudioChannels, + int numMatrixFramesPerPeriod, + int numAudioFramesPerPeriod, + float matrixSampleRate, float audioSampleRate, + void *userData) { srandom(time(NULL)); // Verify we are running with matrix enabled - if(numMatrixFramesPerPeriod*2 != numAudioFramesPerPeriod) { - rt_printf("Error: this example needs the matrix enabled, running at half audio rate\n"); + if(numMatrixFramesPerPeriod == 0 || numMatrixChannels < 4) { + rt_printf("Error: this example needs the matrix enabled with at least 4 channels\n"); return false; }