//http://www.youtube.com/user/thecplusplusguy //Playing 3D sound with OpenAL, and loading a wav file manually #include #include #include #include #include #include bool isBigEndian() { int a=1; return !((char*)&a)[0]; } int convertToInt(char* buffer,int len) { int a=0; if(!isBigEndian()) for(int i=0;iSDL_GetTicks()-start) SDL_Delay(1000/30.0-(SDL_GetTicks()-start)); } alDeleteSources(1,&sourceid); alDeleteBuffers(1,&bufferid); alcDestroyContext(context); alcCloseDevice(device); delete[] data; return 0; }