
OpenAL context를 destroy하기 전에, 모든 소스를 종료하고, context를 detach해야 합니다.
#hostingforum.kr
c
ALCcontext* context = alcGetCurrentContext();
if (context != NULL) {
alcMakeContextCurrent(NULL);
}
다음으로, context를 destroy합니다.
#hostingforum.kr
c
openal_context_destroy(context);
context를 다시 만들기 위해서는, ALC device를 얻고, context를 생성해야 합니다.
#hostingforum.kr
c
ALCdevice* device = alcOpenDevice(NULL);
if (device != NULL) {
ALCcontext* context = alcCreateContext(device, NULL);
if (context != NULL) {
alcMakeContextCurrent(context);
}
alcCloseDevice(device);
}
context를 destroy한 후 다시 context를 만들기 위해서는, device를 close하고, device를 open해야 합니다.
#hostingforum.kr
c
alcCloseDevice(device);
device = alcOpenDevice(NULL);
이러한 과정을 통해 context를 다시 만들 수 있습니다.
2025-07-14 08:57