コード例 #1
0
ファイル: OpenALThread.cpp プロジェクト: Bigpet/rpcs3
void OpenALThread::Init()
{
	m_device = alcOpenDevice(nullptr);
	checkForAlcError("alcOpenDevice");

	m_context = alcCreateContext(m_device, nullptr);
	checkForAlcError("alcCreateContext");

	alcMakeContextCurrent(m_context);
	checkForAlcError("alcMakeContextCurrent");
}
コード例 #2
0
ファイル: OpenALBackend.cpp プロジェクト: AniLeo/rpcs3
OpenALBackend::OpenALBackend()
	: m_sampling_rate(get_sampling_rate())
	, m_sample_size(get_sample_size())
{
	ALCdevice* m_device = alcOpenDevice(nullptr);
	checkForAlcError("OpenALBackend->alcOpenDevice");

	ALCcontext* m_context = alcCreateContext(m_device, nullptr);
	checkForAlcError("OpenALBackend->alcCreateContext");

	alcMakeContextCurrent(m_context);
	checkForAlcError("OpenALBackend->alcMakeContextCurrent");

	if (get_channels() == 2)
	{
		m_format = (m_sample_size == 2) ? AL_FORMAT_STEREO16 : AL_FORMAT_STEREO_FLOAT32;
	}
	else
	{
		m_format = (m_sample_size == 2) ? AL_FORMAT_71CHN16 : AL_FORMAT_71CHN32;
	}
}