diff --git a/project/src/media/openal/OpenALBindings.cpp b/project/src/media/openal/OpenALBindings.cpp index cd67d72ccc..0ca8ff6de5 100644 --- a/project/src/media/openal/OpenALBindings.cpp +++ b/project/src/media/openal/OpenALBindings.cpp @@ -2301,6 +2301,17 @@ namespace lime { } + bool lime_alc_is_extension_present (HxString extname) { + + #ifdef LIME_OPENALSOFT + return alcIsExtensionPresent (extname.__s); + #else + return false; + #endif + + } + + HL_PRIM bool HL_NAME(hl_al_is_extension_present) (hl_vstring* extname) { #ifdef LIME_OPENALSOFT @@ -2312,6 +2323,17 @@ namespace lime { } + HL_PRIM bool HL_NAME(hl_alc_is_extension_present) (hl_vstring* extname) { + + #ifdef LIME_OPENALSOFT + return alcIsExtensionPresent (extname ? hl_to_utf8 (extname->bytes) : NULL); + #else + return false; + #endif + + } + + bool lime_al_is_filter (value filter) { #ifdef LIME_OPENALSOFT @@ -3580,6 +3602,7 @@ namespace lime { DEFINE_PRIME1 (lime_al_is_effect); DEFINE_PRIME1 (lime_al_is_enabled); DEFINE_PRIME1 (lime_al_is_extension_present); + DEFINE_PRIME1 (lime_alc_is_extension_present); DEFINE_PRIME1 (lime_al_is_filter); DEFINE_PRIME1 (lime_al_is_source); DEFINE_PRIME4v (lime_al_listener3f); @@ -3704,6 +3727,7 @@ namespace lime { DEFINE_HL_PRIM (_BOOL, hl_al_is_effect, _TCFFIPOINTER); DEFINE_HL_PRIM (_BOOL, hl_al_is_enabled, _I32); DEFINE_HL_PRIM (_BOOL, hl_al_is_extension_present, _STRING); + DEFINE_HL_PRIM (_BOOL, hl_alc_is_extension_present, _STRING); DEFINE_HL_PRIM (_BOOL, hl_al_is_filter, _TCFFIPOINTER); DEFINE_HL_PRIM (_BOOL, hl_al_is_source, _TCFFIPOINTER); DEFINE_HL_PRIM (_VOID, hl_al_listener3f, _I32 _F32 _F32 _F32); diff --git a/src/lime/_internal/backend/native/NativeCFFI.hx b/src/lime/_internal/backend/native/NativeCFFI.hx index 33ce3df541..03e0360f7c 100644 --- a/src/lime/_internal/backend/native/NativeCFFI.hx +++ b/src/lime/_internal/backend/native/NativeCFFI.hx @@ -1574,6 +1574,8 @@ class NativeCFFI @:cffi private static function lime_al_is_extension_present(extname:String):Bool; + @:cffi private static function lime_alc_is_extension_present(extname:String):Bool; + @:cffi private static function lime_al_is_source(source:CFFIPointer):Bool; @:cffi private static function lime_al_listener3f(param:Int, value1:Float32, value2:Float32, value3:Float32):Void; @@ -1760,6 +1762,8 @@ class NativeCFFI private static var lime_al_is_enabled = new cpp.CallableBool>(cpp.Prime._loadPrime("lime", "lime_al_is_enabled", "ib", false)); private static var lime_al_is_extension_present = new cpp.CallableBool>(cpp.Prime._loadPrime("lime", "lime_al_is_extension_present", "sb", false)); + private static var lime_alc_is_extension_present = new cpp.CallableBool>(cpp.Prime._loadPrime("lime", "lime_alc_is_extension_present", "sb", + false)); private static var lime_al_is_source = new cpp.CallableBool>(cpp.Prime._loadPrime("lime", "lime_al_is_source", "ob", false)); private static var lime_al_listener3f = new cpp.Callablecpp.Float32->cpp.Float32->cpp.Float32->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_al_listener3f", "ifffv", false)); @@ -1899,6 +1903,7 @@ class NativeCFFI private static var lime_al_is_buffer = CFFI.load("lime", "lime_al_is_buffer", 1); private static var lime_al_is_enabled = CFFI.load("lime", "lime_al_is_enabled", 1); private static var lime_al_is_extension_present = CFFI.load("lime", "lime_al_is_extension_present", 1); + private static var lime_alc_is_extension_present = CFFI.load("lime", "lime_alc_is_extension_present", 1); private static var lime_al_is_source = CFFI.load("lime", "lime_al_is_source", 1); private static var lime_al_listener3f = CFFI.load("lime", "lime_al_listener3f", 4); private static var lime_al_listener3i = CFFI.load("lime", "lime_al_listener3i", 4); @@ -2180,6 +2185,11 @@ class NativeCFFI return false; } + @:hlNative("lime", "hl_alc_is_extension_present") private static function lime_alc_is_extension_present(extname:String):Bool + { + return false; + } + @:hlNative("lime", "hl_al_is_source") private static function lime_al_is_source(source:CFFIPointer):Bool { return false; diff --git a/src/lime/media/openal/ALC.hx b/src/lime/media/openal/ALC.hx index 62a3b6e264..8c8b337c18 100644 --- a/src/lime/media/openal/ALC.hx +++ b/src/lime/media/openal/ALC.hx @@ -201,5 +201,14 @@ class ALC NativeCFFI.lime_alc_suspend_context(context); #end } + + public static function isExtensionPresent(extname:String):Bool + { + #if (lime_cffi && lime_openal && !macro) + return NativeCFFI.lime_alc_is_extension_present(extname); + #else + return false; + #end + } } #end