示例#1
0
void NativeSoundMix::BuildAndWrite( WaveHeader* wave, BOOL silence )
{
	int i = wave->bufferId;
	WAVEHDR* hdr = &waveHDR[i];

	// Clean up the header
	int res = waveOutUnprepareHeader(hWaveOut, hdr, sizeof(WAVEHDR));
	FLASHASSERT(res == MMSYSERR_NOERROR);

	// Generate the sound info
	if ( silence ) {
		memset(buffer[i], mixFormat.Is8Bit() ? 0x80 : 0, bufferBytes);
	} else {
		BuildBuffer( i );
	}

	res = waveOutPrepareHeader(hWaveOut, hdr, sizeof(WAVEHDR));
	FLASHASSERT(res == MMSYSERR_NOERROR);
	res = waveOutWrite(hWaveOut, hdr, sizeof(WAVEHDR)); 
	FLASHASSERT(res == MMSYSERR_NOERROR);
}
DepthStencilBuffer::DepthStencilBuffer(int width, int height, const DepthStencilFormat &format)
	: _Width(width), _Height(height), _Format (format)
{
	glGenTextures (1,&ID);
	BuildBuffer (width,height,format);
}