All pastes #355280 Raw Edit

Something

public cpp v1 · immutable
·published 2007-02-14 11:38 UTC
rendered paste body
ALboolean ALFWInitOpenAL(){	ALDeviceList *pDeviceList = NULL;	ALCcontext *pContext = NULL;	ALCdevice *pDevice = NULL;	ALint i;	ALboolean bReturn = AL_FALSE;	pDeviceList = new ALDeviceList();	if ((pDeviceList) && (pDeviceList->GetNumDevices()))	{		ALFWprintf("\nSelect OpenAL Device:\n");		for (i = 0; i < pDeviceList->GetNumDevices(); i++) ALFWprintf("%d. %s%s\n", i + 1, pDeviceList->GetDeviceName(i),             i == pDeviceList>GetDefaultDevice() ? "(DEFAULT)" : "");			do {			ALchar ch = _getch();			i = atoi(&ch);		} while ((i < 1) || (i > pDeviceList->GetNumDevices()));		pDevice = alcOpenDevice(pDeviceList->GetDeviceName(i - 1));		if (pDevice)		{			pContext = alcCreateContext(pDevice, NULL);			if (pContext)			{				ALFWprintf("\nOpened %s Device\n", alcGetString(pDevice, ALC_DEVICE_SPECIFIER));				alcMakeContextCurrent(pContext);				bReturn = AL_TRUE;			}			else			{				alcCloseDevice(pDevice);			}		}		delete pDeviceList;	}	return bReturn;}