mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-14 15:28:57 +00:00
support getSupportedExtensions
This commit is contained in:
@@ -112,6 +112,16 @@ pub const Extension = union(enum) {
|
||||
};
|
||||
};
|
||||
|
||||
/// An array of supported WebGL extensions.
|
||||
const extension_array = blk: {
|
||||
const fields = @typeInfo(Extension.Kind).@"enum".fields;
|
||||
var items: [fields.len][:0]const u8 = undefined;
|
||||
for (fields, 0..) |field, i| {
|
||||
items[i] = field.name;
|
||||
}
|
||||
break :blk items;
|
||||
};
|
||||
|
||||
/// Enables a WebGL extension.
|
||||
pub fn _getExtension(self: *const WebGLRenderingContext, name: []const u8) ?Extension {
|
||||
_ = self;
|
||||
@@ -123,3 +133,8 @@ pub fn _getExtension(self: *const WebGLRenderingContext, name: []const u8) ?Exte
|
||||
inline else => |comptime_enum| @unionInit(Extension, @tagName(comptime_enum), {}),
|
||||
};
|
||||
}
|
||||
|
||||
/// Returns a list of all the supported WebGL extensions.
|
||||
pub fn _getSupportedExtensions(_: *const WebGLRenderingContext) []const []const u8 {
|
||||
return &extension_array;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user