But I´ve correct.
1 2 3 4 5 6 7 | WAVEFORMATEX WaveFormat = {}; WaveFormat.wFormatTag = WAVE_FORMAT_PCM; WaveFormat.nChannels = 2; WaveFormat.nSamplesPerSec = samplesPerSecond; WaveFormat.wBitsPerSample = 16; WaveFormat.nBlockAlign = (WaveFormat.nChannels*WaveFormat.wBitsPerSample) / 8; WaveFormat.nAvgBytesPerSec = WaveFormat.nBlockAlign*WaveFormat.nBlockAlign; |
Also, the calling of Win32DirectSoundInit, seems equal.
1 2 3 4 5 6 7 8 9 10 | int samplesPersecond = 44000; int squareWaveCounter = 0; int Hz = 440; int squareWavePeriod = 48000/440; uint32 runningIndexBuffer = 0; int bytesPersample = sizeof(int16) * 2; int SecondaryBufferSize = samplesPersecond*bytesPersample; Win32InitDSound(Window, samplesPersecond, SecondaryBufferSize); |
My code is very close to Casys, I add my stile a bit and encapsulate a little. I will preorder de game as soon I fixe my Paypal account.
https://github.com/ThadeuFerreira...master/code/main_handmadehero.cpp