如何在LWJGL 3中创建OpenAL上下文

3

我该如何在LWJGL3中创建OpenAL上下文?

我看到过需要使用“ALcontext”,但在当前版本的发布构建中,该类不存在。

(LWJGL 3.0.0 构建 90)

1个回答

2
在LWJGL 3中,已删除了用于OpenAL和OpenCL的多个实用类,因此您将需要使用alXXX函数手动创建一个OpenAL上下文。
发行说明中(强调原文):
  • 删除了OpenAL的ALDevice/ALContext包装器和OpenCL的CLPlatform/CLDevice包装器。(#152
问题#152提供了示例代码:

Opening the default device and creating a default context with the above changes and no error checks:

// Can call "alc" functions at any time
long device = alcOpenDevice((ByteBuffer)null);
ALCCapabilities deviceCaps = ALC.createCapabilities(device);

long context = alcCreateContext(device, (ByteBuffer)null);
alcMakeContextCurrent(context);
AL.createCapabilities(deviceCaps);
// Can now call "al" functions

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接