/** * Allows the application to connect to a device. * * <p>If the function returns {@code NULL}, then no sound driver/device has been found. The argument is a null terminated string that requests a certain device or * device configuration. If {@code NULL} is specified, the implementation will provide an implementation specific default.</p> * * @param deviceSpecifier the requested device or device configuration */ @NativeType("ALCdevice *") public static long alcOpenDevice(@Nullable @NativeType("ALCchar const *") ByteBuffer deviceSpecifier) { if (CHECKS) { checkNT1Safe(deviceSpecifier); } return nalcOpenDevice(memAddressSafe(deviceSpecifier)); }
/** * Allows the application to connect to a device. * * <p>If the function returns {@code NULL}, then no sound driver/device has been found. The argument is a null terminated string that requests a certain device or * device configuration. If {@code NULL} is specified, the implementation will provide an implementation specific default.</p> * * @param deviceSpecifier the requested device or device configuration */ @NativeType("ALCdevice *") public static long alcOpenDevice(@Nullable @NativeType("ALCchar const *") CharSequence deviceSpecifier) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { stack.nUTF8Safe(deviceSpecifier, true); long deviceSpecifierEncoded = deviceSpecifier == null ? NULL : stack.getPointerAddress(); return nalcOpenDevice(deviceSpecifierEncoded); } finally { stack.setPointer(stackPointer); } }