code
stringlengths
38
801k
repo_path
stringlengths
6
263
const std = @import("std"); const Allocator = std.mem.Allocator; const vk = @import("../include/vk.zig"); const glfw = @import("../include/glfw.zig"); const windowing = @import("../windowing.zig"); const shader = @import("shader.zig"); const BackendError = @import("backend.zig").BackendError; const enableValidationLayers = std.debug.runtime_safety; const validationLayers = [_][*:0]const u8{"VK_LAYER_LUNARG_standard_validation"}; const deviceExtensions = [_][*:0]const u8{vk.extension_info.khr_swapchain.name}; const BaseDispatch = struct { vkCreateInstance: vk.PfnCreateInstance, vkEnumerateInstanceLayerProperties: vk.PfnEnumerateInstanceLayerProperties, usingnamespace vk.BaseWrapper(@This()); }; const InstanceDispatch = struct { vkDestroyInstance: vk.PfnDestroyInstance, vkDestroySurfaceKHR: vk.PfnDestroySurfaceKHR, vkCreateDevice: vk.PfnCreateDevice, vkEnumeratePhysicalDevices: vk.PfnEnumeratePhysicalDevices, vkGetPhysicalDeviceProperties: vk.PfnGetPhysicalDeviceProperties, vkGetPhysicalDeviceMemoryProperties: vk.PfnGetPhysicalDeviceMemoryProperties, vkGetPhysicalDeviceFeatures: vk.PfnGetPhysicalDeviceFeatures, vkEnumerateDeviceExtensionProperties: vk.PfnEnumerateDeviceExtensionProperties, vkGetPhysicalDeviceSurfaceFormatsKHR: vk.PfnGetPhysicalDeviceSurfaceFormatsKHR, vkGetPhysicalDeviceSurfacePresentModesKHR: vk.PfnGetPhysicalDeviceSurfacePresentModesKHR, vkGetPhysicalDeviceQueueFamilyProperties: vk.PfnGetPhysicalDeviceQueueFamilyProperties, vkGetPhysicalDeviceSurfaceSupportKHR: vk.PfnGetPhysicalDeviceSurfaceSupportKHR, vkGetPhysicalDeviceSurfaceCapabilitiesKHR: vk.PfnGetPhysicalDeviceSurfaceCapabilitiesKHR, vkGetDeviceProcAddr: vk.PfnGetDeviceProcAddr, usingnamespace vk.InstanceWrapper(@This()); }; const DeviceDispatch = struct { vkDestroyDevice: vk.PfnDestroyDevice, vkGetDeviceQueue: vk.PfnGetDeviceQueue, vkDeviceWaitIdle: vk.PfnDeviceWaitIdle, vkCreateSemaphore: vk.PfnCreateSemaphore, vkDestroySemaphore: vk.PfnDestroySemaphore, vkCreateFence: vk.PfnCreateFence, vkDestroyFence: vk.PfnDestroyFence, vkWaitForFences: vk.PfnWaitForFences, vkResetFences: vk.PfnResetFences, vkCreateImageView: vk.PfnCreateImageView, vkDestroyImageView: vk.PfnDestroyImageView, vkCreateSwapchainKHR: vk.PfnCreateSwapchainKHR, vkDestroySwapchainKHR: vk.PfnDestroySwapchainKHR, vkGetSwapchainImagesKHR: vk.PfnGetSwapchainImagesKHR, vkAcquireNextImageKHR: vk.PfnAcquireNextImageKHR, vkQueueSubmit: vk.PfnQueueSubmit, vkQueuePresentKHR: vk.PfnQueuePresentKHR, vkQueueWaitIdle: vk.PfnQueueWaitIdle, vkCreateCommandPool: vk.PfnCreateCommandPool, vkDestroyCommandPool: vk.PfnDestroyCommandPool, vkResetCommandPool: vk.PfnResetCommandPool, vkAllocateCommandBuffers: vk.PfnAllocateCommandBuffers, vkFreeCommandBuffers: vk.PfnFreeCommandBuffers, vkCreateShaderModule: vk.PfnCreateShaderModule, vkDestroyShaderModule: vk.PfnDestroyShaderModule, vkCreatePipelineLayout: vk.PfnCreatePipelineLayout, vkDestroyPipelineLayout: vk.PfnDestroyPipelineLayout, vkCreateRenderPass: vk.PfnCreateRenderPass, vkDestroyRenderPass: vk.PfnDestroyRenderPass, vkCreateGraphicsPipelines: vk.PfnCreateGraphicsPipelines, vkDestroyPipeline: vk.PfnDestroyPipeline, vkCreateFramebuffer: vk.PfnCreateFramebuffer, vkDestroyFramebuffer: vk.PfnDestroyFramebuffer, vkBeginCommandBuffer: vk.PfnBeginCommandBuffer, vkEndCommandBuffer: vk.PfnEndCommandBuffer, vkAllocateMemory: vk.PfnAllocateMemory, vkFreeMemory: vk.PfnFreeMemory, vkMapMemory: vk.PfnMapMemory, vkUnmapMemory: vk.PfnUnmapMemory, vkCreateBuffer: vk.PfnCreateBuffer, vkDestroyBuffer: vk.PfnDestroyBuffer, vkGetBufferMemoryRequirements: vk.PfnGetBufferMemoryRequirements, vkBindBufferMemory: vk.PfnBindBufferMemory, vkCreateDescriptorSetLayout: vk.PfnCreateDescriptorSetLayout, vkDestroyDescriptorSetLayout: vk.PfnDestroyDescriptorSetLayout, vkCmdBeginRenderPass: vk.PfnCmdBeginRenderPass, vkCmdEndRenderPass: vk.PfnCmdEndRenderPass, vkCmdBindPipeline: vk.PfnCmdBindPipeline, vkCmdDrawIndexed: vk.PfnCmdDrawIndexed, vkCmdSetViewport: vk.PfnCmdSetViewport, vkCmdSetScissor: vk.PfnCmdSetScissor, vkCmdBindVertexBuffers: vk.PfnCmdBindVertexBuffers, vkCmdBindIndexBuffer: vk.PfnCmdBindIndexBuffer, vkCmdCopyBuffer: vk.PfnCmdCopyBuffer, usingnamespace vk.DeviceWrapper(@This()); }; pub const Context = struct { const Self = @This(); allocator: *Allocator, // arena is used for loading shader code arena: std.heap.ArenaAllocator, vkb: BaseDispatch, vki: InstanceDispatch, vkd: DeviceDispatch, window: *windowing.Window, instance: vk.Instance, physical_device: vk.PhysicalDevice, properties: vk.PhysicalDeviceProperties, mem_properties: vk.PhysicalDeviceMemoryProperties, features: vk.PhysicalDeviceFeatures, indices: QueueFamilyIndices, device: vk.Device, surface: vk.SurfaceKHR, graphics_queue: vk.Queue, present_queue: vk.Queue, transfer_queue: vk.Queue, graphics_pool: vk.CommandPool, transfer_pool: vk.CommandPool, pub fn init(allocator: *Allocator, window: *windowing.Window) !Self { var self: Context = undefined; self.allocator = allocator; self.arena = std.heap.ArenaAllocator.init(allocator); self.window = window; self.vkb = try BaseDispatch.load(glfw.glfwGetInstanceProcAddress); try self.createInstance(); self.vki = try InstanceDispatch.load(self.instance, glfw.glfwGetInstanceProcAddress); errdefer self.vki.destroyInstance(self.instance, null); try self.createSurface(); errdefer self.vki.destroySurfaceKHR(self.instance, self.surface, null); try self.pickPhysicalDevice(); self.indices = try findQueueFamilies(self.allocator, self.vki, self.physical_device, self.surface); try self.createLogicalDevice(); self.vkd = try DeviceDispatch.load(self.device, self.vki.vkGetDeviceProcAddr); errdefer self.vkd.destroyDevice(self.device, null); self.graphics_queue = self.vkd.getDeviceQueue(self.device, self.indices.graphics_family.?, 0); self.present_queue = self.vkd.getDeviceQueue(self.device, self.indices.present_family.?, 0); self.transfer_queue = self.vkd.getDeviceQueue(self.device, self.indices.transfer_family.?, 0); try self.createGraphicsPool(); try self.createTransferPool(); return self; } pub fn deinit(self: Self) void { self.vkd.destroyCommandPool(self.device, self.graphics_pool, null); self.vkd.destroyCommandPool(self.device, self.transfer_pool, null); self.vkd.destroyDevice(self.device, null); self.vki.destroySurfaceKHR(self.instance, self.surface, null); self.vki.destroyInstance(self.instance, null); self.arena.deinit(); } // Creates the vulkan instance fn createInstance(self: *Self) !void { // Check validation layer support if enabled if (enableValidationLayers and !(try checkValidationLayerSupport(self.vkb, self.allocator))) return BackendError.ValidationLayersNotAvailable; const appInfo = vk.ApplicationInfo{ .p_application_name = self.window.name, .application_version = vk.makeVersion(0, 0, 0), .p_engine_name = "zetaframe", .engine_version = vk.makeVersion(0, 0, 0), .api_version = vk.API_VERSION_1_1, }; // Get required vulkan extensions var glfwExtensionCount: u32 = 0; const glfwExtensions = glfw.glfwGetRequiredInstanceExtensions(&glfwExtensionCount); // Call createInstance self.instance = try self.vkb.createInstance(.{ .p_application_info = &appInfo, .enabled_extension_count = glfwExtensionCount, .pp_enabled_extension_names = @ptrCast([*]const [*:0]const u8, glfwExtensions), .enabled_layer_count = if (enableValidationLayers) @intCast(u32, validationLayers.len) else 0, .pp_enabled_layer_names = if (enableValidationLayers) &validationLayers else undefined, .flags = .{}, }, null); } // Creates a surface for vulkan to draw on // Currently uses glfw fn createSurface(self: *Self) !void { if (glfw.glfwCreateWindowSurface(self.instance, self.window.window, null, &self.surface) != vk.Result.success) { return BackendError.CreateSurfaceFailed; } } // Chooses a physicalDevice based on a calculated device score fn pickPhysicalDevice(self: *Self) !void { var deviceCount: u32 = 0; _ = try self.vki.enumeratePhysicalDevices(self.instance, &deviceCount, null); if (deviceCount == 0) return BackendError.NoValidDevices; const devices = try self.allocator.alloc(vk.PhysicalDevice, deviceCount); defer self.allocator.free(devices); _ = try self.vki.enumeratePhysicalDevices(self.instance, &deviceCount, devices.ptr); var deviceSelected = false; var selectedDevice: vk.PhysicalDevice = undefined; var selectedDeviceScore: u32 = 0; for (devices) |device| { var score = try calculateDeviceScore(self.allocator, self.vki, device, self.surface); if (score > selectedDeviceScore and score != 0) { deviceSelected = true; selectedDeviceScore = score; selectedDevice = device; } } if (!deviceSelected) return BackendError.NoValidDevices; self.physical_device = selectedDevice; self.properties = self.vki.getPhysicalDeviceProperties(self.physical_device); self.mem_properties = self.vki.getPhysicalDeviceMemoryProperties(self.physical_device); self.features = self.vki.getPhysicalDeviceFeatures(self.physical_device); std.log.info("Using Device: {}", .{self.properties.device_name}); } // Creates the device from the physicalDevice fn createLogicalDevice(self: *Self) !void { var queueCreateInfos = std.ArrayList(vk.DeviceQueueCreateInfo).init(self.allocator); defer queueCreateInfos.deinit(); var uniqueQueueFamilies: []u32 = undefined; if (self.indices.graphics_family.? == self.indices.present_family.?) { if (self.indices.graphics_family.? == self.indices.transfer_family.?) { uniqueQueueFamilies = &[_]u32{self.indices.graphics_family.?}; } else { uniqueQueueFamilies = &[_]u32{ self.indices.graphics_family.?, self.indices.transfer_family.? }; } } else { if (self.indices.present_family.? == self.indices.transfer_family.?) { uniqueQueueFamilies = &[_]u32{ self.indices.graphics_family.?, self.indices.present_family.? }; } else { uniqueQueueFamilies = &[_]u32{ self.indices.graphics_family.?, self.indices.present_family.?, self.indices.transfer_family.? }; } } var queuePriority: f32 = 1.0; for (uniqueQueueFamilies) |queueFamily| { const queueCreateInfo = vk.DeviceQueueCreateInfo{ .queue_family_index = queueFamily, .queue_count = 1, .p_queue_priorities = &[_]f32{queuePriority}, .flags = .{}, }; try queueCreateInfos.append(queueCreateInfo); } const createInfo = vk.DeviceCreateInfo{ .queue_create_info_count = @intCast(u32, queueCreateInfos.items.len), .p_queue_create_infos = queueCreateInfos.items.ptr, .p_enabled_features = null, .enabled_extension_count = @intCast(u32, deviceExtensions.len), .pp_enabled_extension_names = &deviceExtensions, .enabled_layer_count = if (enableValidationLayers) @intCast(u32, validationLayers.len) else 0, .pp_enabled_layer_names = if (enableValidationLayers) &validationLayers else undefined, .flags = .{}, }; self.device = try self.vki.createDevice(self.physical_device, createInfo, null); } fn createGraphicsPool(self: *Self) !void { const indices = self.indices; const poolInfo = vk.CommandPoolCreateInfo{ .queue_family_index = indices.graphics_family.?, .flags = .{ .transient_bit = true, .reset_command_buffer_bit = true, }, }; self.graphics_pool = try self.vkd.createCommandPool(self.device, poolInfo, null); } fn createTransferPool(self: *Self) !void { const indices = self.indices; const poolInfo = vk.CommandPoolCreateInfo{ .queue_family_index = indices.transfer_family.?, .flags = .{}, }; self.transfer_pool = try self.vkd.createCommandPool(self.device, poolInfo, null); } }; // Checks validation layer support fn checkValidationLayerSupport(vkb: BaseDispatch, allocator: *Allocator) !bool { var layerCount: u32 = 0; _ = try vkb.enumerateInstanceLayerProperties(&layerCount, null); const availableLayers = try allocator.alloc(vk.LayerProperties, layerCount); defer allocator.free(availableLayers); _ = try vkb.enumerateInstanceLayerProperties(&layerCount, availableLayers.ptr); for (validationLayers) |layerName| { var layerFound = false; for (availableLayers) |layerProperties| { if (std.cstr.cmp(layerName, @ptrCast([*c]const u8, &layerProperties.layer_name)) == 0) { layerFound = true; break; } } if (!layerFound) { return false; } } return true; } // Calculates pdevice score based on a number of factors fn calculateDeviceScore(allocator: *Allocator, vki: InstanceDispatch, pdevice: vk.PhysicalDevice, surface: vk.SurfaceKHR) !u32 { var deviceProperties = vki.getPhysicalDeviceProperties(pdevice); var deviceMemProperties = vki.getPhysicalDeviceMemoryProperties(pdevice); var deviceFeatures = vki.getPhysicalDeviceFeatures(pdevice); var score: u32 = 0; if (deviceProperties.device_type == .discrete_gpu) { score += 4200; } score += @intCast(u32, deviceProperties.limits.max_image_dimension_2d); score += @intCast(u32, deviceMemProperties.memory_heap_count); //----- Must Haves if (deviceFeatures.geometry_shader == 0) return 0; if (!(try findQueueFamilies(allocator, vki, pdevice, surface)).isComplete()) return 0; if (!try checkDeviceExtensionSupport(allocator, vki, pdevice)) return 0; if (!try checkSwapchainSupport(vki, pdevice, surface)) return 0; std.log.debug("Device: {}, Type: {}, Score: {}", .{ deviceProperties.device_name, deviceProperties.device_type, score }); return score; } const QueueFamilyIndices = struct { graphics_family: ?u32, present_family: ?u32, transfer_family: ?u32, fn init() QueueFamilyIndices { return QueueFamilyIndices{ .graphics_family = null, .present_family = null, .transfer_family = null, }; } fn isComplete(self: QueueFamilyIndices) bool { return self.graphics_family != null and self.present_family != null and self.transfer_family != null; } }; fn findQueueFamilies(allocator: *Allocator, vki: InstanceDispatch, device: vk.PhysicalDevice, surface: vk.SurfaceKHR) !QueueFamilyIndices { var indices = QueueFamilyIndices.init(); var queueFamilyCount: u32 = 0; vki.getPhysicalDeviceQueueFamilyProperties(device, &queueFamilyCount, null); const queueFamilies = try allocator.alloc(vk.QueueFamilyProperties, queueFamilyCount); defer allocator.free(queueFamilies); vki.getPhysicalDeviceQueueFamilyProperties(device, &queueFamilyCount, queueFamilies.ptr); var i: u32 = 0; for (queueFamilies) |queueFamily| { if (queueFamily.queue_count < 0) { continue; } if (queueFamily.queue_flags.graphics_bit) { indices.graphics_family = i; } if (queueFamily.queue_flags.transfer_bit) { indices.transfer_family = i; } if ((try vki.getPhysicalDeviceSurfaceSupportKHR(device, i, surface)) == vk.TRUE) { indices.present_family = i; } if (indices.isComplete()) { break; } i += 1; } return indices; } // Checks the extensions that the pdevice supports fn checkDeviceExtensionSupport(allocator: *Allocator, vki: InstanceDispatch, pdevice: vk.PhysicalDevice) !bool { var count: u32 = 0; _ = try vki.enumerateDeviceExtensionProperties(pdevice, null, &count, null); const availableExtensions = try allocator.alloc(vk.ExtensionProperties, count); defer allocator.free(availableExtensions); _ = try vki.enumerateDeviceExtensionProperties(pdevice, null, &count, availableExtensions.ptr); for (deviceExtensions) |deviceExt| { for (availableExtensions) |extension| { if (std.cstr.cmp(deviceExt, @ptrCast([*c]const u8, &extension.extension_name)) == 0) { break; } } else { return false; } } return true; } // Checks pdevice's swapchain support fn checkSwapchainSupport(vki: InstanceDispatch, pdevice: vk.PhysicalDevice, surface: vk.SurfaceKHR) !bool { var formatCount: u32 = 0; _ = try vki.getPhysicalDeviceSurfaceFormatsKHR(pdevice, surface, &formatCount, null); var presentModeCount: u32 = 0; _ = try vki.getPhysicalDeviceSurfacePresentModesKHR(pdevice, surface, &presentModeCount, null); return formatCount > 0 and presentModeCount > 0; }
render/src/backend/context.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const expect = std.testing.expect; const expectEqual = std.testing.expectEqual; const expectEqualSlices = std.testing.expectEqualSlices; const expectEqualStrings = std.testing.expectEqualStrings; const panic = std.debug.panic; const assert = std.debug.assert; pub const Config = struct { initial_capacity: u64 = 32, grown_factor: u64 = 2, }; pub fn List(comptime T: type, comptime config: Config) type { assert(config.grown_factor > 1); return struct { items: []T, len: u64, allocator: Allocator, const Self = @This(); pub fn init(allocator: Allocator) Self { return Self{ .items = &.{}, .len = 0, .allocator = allocator, }; } pub fn fromSlice(allocator: Allocator, data: []const T) !Self { const items = try allocator.dupe(T, data); return Self{ .items = items, .len = data.len, .allocator = allocator, }; } pub fn withCapacity(allocator: Allocator, capacity: u64) !Self { const items = try allocator.alloc(T, capacity); return Self{ .items = items, .len = 0, .allocator = allocator, }; } pub fn append(self: *Self, value: T) !void { if (self.items.len == self.len) { const capacity = std.math.max( self.len * config.grown_factor, config.initial_capacity, ); const items = try self.allocator.alloc(T, capacity); std.mem.copy(T, items, self.items); self.allocator.free(self.items); self.items = items; } self.items[self.len] = value; self.len += 1; } pub fn appendAssumeCapacity(self: *Self, value: T) void { assert(self.len < self.items.len); self.items[self.len] = value; self.len += 1; } pub fn appendSlice(self: *Self, value: []const T) !void { const needed_length = self.len + value.len; if (self.items.len < needed_length) { var capacity = std.math.max( self.len * config.grown_factor, config.initial_capacity, ); while (capacity < needed_length) { capacity *= config.grown_factor; } const items = try self.allocator.alloc(T, capacity); std.mem.copy(T, items, self.items); self.allocator.free(self.items); self.items = items; } var i: u64 = 0; while (i < value.len) : (i += 1) { self.items[self.len + i] = value[i]; } self.len += value.len; } pub fn deinit(self: *Self) void { self.allocator.free(self.items); } pub fn slice(self: Self) []const T { return self.items[0..self.len]; } pub fn mutSlice(self: Self) []T { return self.items[0..self.len]; } pub fn last(self: Self) T { assert(self.len > 0); return self.items[self.len - 1]; } }; }
src/list.zig
const std = @import("std"); const interop = @import("../interop.zig"); const iup = @import("../iup.zig"); const Impl = @import("../impl.zig").Impl; const CallbackHandler = @import("../callback_handler.zig").CallbackHandler; const debug = std.debug; const trait = std.meta.trait; const Element = iup.Element; const Handle = iup.Handle; const Error = iup.Error; const ChildrenIterator = iup.ChildrenIterator; const Size = iup.Size; const Margin = iup.Margin; /// /// Creates an editable text field. pub const Text = opaque { pub const CLASS_NAME = "text"; pub const NATIVE_TYPE = iup.NativeType.Control; const Self = @This(); /// /// K_ANY K_ANY Action generated when a keyboard event occurs. /// Callback int function(Ihandle *ih, int c); [in C] ih:k_any(c: number) -> /// (ret: number) [in Lua] ih: identifier of the element that activated the event. /// c: identifier of typed key. /// Please refer to the Keyboard Codes table for a list of possible values. /// Returns: If IUP_IGNORE is returned the key is ignored and not processed by /// the control and not propagated. /// If returns IUP_CONTINUE, the key will be processed and the event will be /// propagated to the parent of the element receiving it, this is the default behavior. /// If returns IUP_DEFAULT the key is processed but it is not propagated. /// IUP_CLOSE will be processed. /// Notes Keyboard callbacks depend on the keyboard usage of the control with /// the focus. /// So if you return IUP_IGNORE the control will usually not process the key. /// But be aware that sometimes the control process the key in another event so /// even returning IUP_IGNORE the key can get processed. /// Although it will not be propagated. /// IMPORTANT: The callbacks "K_*" of the dialog or native containers depend on /// the IUP_CONTINUE return value to work while the control is in focus. /// If the callback does not exists it is automatically propagated to the /// parent of the element. /// K_* callbacks All defined keys are also callbacks of any element, called /// when the respective key is activated. /// For example: "K_cC" is also a callback activated when the user press /// Ctrl+C, when the focus is at the element or at a children with focus. /// This is the way an application can create shortcut keys, also called hot keys. /// These callbacks are not available in IupLua. /// Affects All elements with keyboard interaction. pub const OnKAnyFn = fn (self: *Self, arg0: i32) anyerror!void; /// /// HELP_CB HELP_CB Action generated when the user press F1 at a control. /// In Motif is also activated by the Help button in some workstations keyboard. /// Callback void function(Ihandle *ih); [in C] ih:help_cb() -> (ret: number) /// [in Lua] ih: identifier of the element that activated the event. /// Returns: IUP_CLOSE will be processed. /// Affects All elements with user interaction. pub const OnHelpFn = fn (self: *Self) anyerror!void; pub const OnDropMotionFn = fn (self: *Self, arg0: i32, arg1: i32, arg2: [:0]const u8) anyerror!void; pub const OnDragEndFn = fn (self: *Self, arg0: i32) anyerror!void; pub const OnDragBeginFn = fn (self: *Self, arg0: i32, arg1: i32) anyerror!void; /// /// ACTION ACTION Action generated when the element is activated. /// Affects each element differently. /// Callback int function(Ihandle *ih); [in C] ih:action() -> (ret: number) [in /// Lua] ih: identifier of the element that activated the event. /// In some elements, this callback may receive more parameters, apart from ih. /// Please refer to each element's documentation. /// Affects IupButton, IupItem, IupList, IupText, IupCanvas, IupMultiline, /// IupToggle pub const OnActionFn = fn (self: *Self, arg0: i32, arg1: [:0]const u8) anyerror!void; /// /// MOTION_CB MOTION_CB Action generated when the mouse moves. /// Callback int function(Ihandle *ih, int x, int y, char *status); [in C] /// ih:motion_cb(x, y: number, status: string) -> (ret: number) [in Lua] ih: /// identifier of the element that activated the event. /// x, y: position in the canvas where the event has occurred, in pixels. /// status: status of mouse buttons and certain keyboard keys at the moment the /// event was generated. /// The same macros used for BUTTON_CB can be used for this status. /// Notes Between press and release all mouse events are redirected only to /// this control, even if the cursor moves outside the element. /// So the BUTTON_CB callback when released and the MOTION_CB callback can be /// called with coordinates outside the element rectangle. /// Affects IupCanvas, IupGLCanvas pub const OnMotionFn = fn (self: *Self, arg0: i32, arg1: i32, arg2: [:0]const u8) anyerror!void; /// /// MAP_CB MAP_CB Called right after an element is mapped and its attributes /// updated in IupMap. /// When the element is a dialog, it is called after the layout is updated. /// For all other elements is called before the layout is updated, so the /// element current size will still be 0x0 during MAP_CB (since 3.14). /// Callback int function(Ihandle *ih); [in C] ih:map_cb() -> (ret: number) [in /// Lua] ih: identifier of the element that activated the event. /// Affects All that have a native representation. pub const OnMapFn = fn (self: *Self) anyerror!void; /// /// ENTERWINDOW_CB ENTERWINDOW_CB Action generated when the mouse enters the /// native element. /// Callback int function(Ihandle *ih); [in C] ih:enterwindow_cb() -> (ret: /// number) [in Lua] ih: identifier of the element that activated the event. /// Notes When the cursor is moved from one element to another, the call order /// in all platforms will be first the LEAVEWINDOW_CB callback of the old /// control followed by the ENTERWINDOW_CB callback of the new control. /// (since 3.14) If the mouse button is hold pressed and the cursor moves /// outside the element the behavior is system dependent. /// In Windows the LEAVEWINDOW_CB/ENTERWINDOW_CB callbacks are NOT called, in /// GTK the callbacks are called. /// Affects All controls with user interaction. /// See Also LEAVEWINDOW_CB pub const OnEnterWindowFn = fn (self: *Self) anyerror!void; /// /// DESTROY_CB DESTROY_CB Called right before an element is destroyed. /// Callback int function(Ihandle *ih); [in C] ih:destroy_cb() -> (ret: number) /// [in Lua] ih: identifier of the element that activated the event. /// Notes If the dialog is visible then it is hidden before it is destroyed. /// The callback will be called right after it is hidden. /// The callback will be called before all other destroy procedures. /// For instance, if the element has children then it is called before the /// children are destroyed. /// For language binding implementations use the callback name "LDESTROY_CB" to /// release memory allocated by the binding for the element. /// Also the callback will be called before the language callback. /// Affects All. pub const OnDestroyFn = fn (self: *Self) anyerror!void; pub const OnDropDataFn = fn (self: *Self, arg0: [:0]const u8, arg1: *iup.Unknow, arg2: i32, arg3: i32, arg4: i32) anyerror!void; /// /// KILLFOCUS_CB KILLFOCUS_CB Action generated when an element loses keyboard focus. /// This callback is called before the GETFOCUS_CB of the element that gets the focus. /// Callback int function(Ihandle *ih); [in C] ih:killfocus_cb() -> (ret: /// number) [in Lua] ih: identifier of the element that activated the event. /// Affects All elements with user interaction, except menus. /// In Windows, there are restrictions when using this callback. /// From MSDN on WM_KILLFOCUS: "While processing this message, do not make any /// function calls that display or activate a window. /// This causes the thread to yield control and can cause the application to /// stop responding to messages. /// See Also GETFOCUS_CB, IupGetFocus, IupSetFocus pub const OnKillFocusFn = fn (self: *Self) anyerror!void; pub const OnDragDataFn = fn (self: *Self, arg0: [:0]const u8, arg1: *iup.Unknow, arg2: i32) anyerror!void; pub const OnDragDataSizeFn = fn (self: *Self, arg0: [:0]const u8) anyerror!void; /// /// DROPFILES_CB DROPFILES_CB Action called when a file is "dropped" into the control. /// When several files are dropped at once, the callback is called several /// times, once for each file. /// If defined after the element is mapped then the attribute DROPFILESTARGET /// must be set to YES. /// [Windows and GTK Only] (GTK 2.6) Callback int function(Ihandle *ih, const /// char* filename, int num, int x, int y); [in C] ih:dropfiles_cb(filename: /// string; num, x, y: number) -> (ret: number) [in Lua] ih: identifier of the /// element that activated the event. /// filename: Name of the dropped file. /// num: Number index of the dropped file. /// If several files are dropped, num is the index of the dropped file starting /// from "total-1" to "0". /// x: X coordinate of the point where the user released the mouse button. /// y: Y coordinate of the point where the user released the mouse button. /// Returns: If IUP_IGNORE is returned the callback will NOT be called for the /// next dropped files, and the processing of dropped files will be interrupted. /// Affects IupDialog, IupCanvas, IupGLCanvas, IupText, IupList pub const OnDropFilesFn = fn (self: *Self, arg0: [:0]const u8, arg1: i32, arg2: i32, arg3: i32) anyerror!void; /// /// UNMAP_CB UNMAP_CB Called right before an element is unmapped. /// Callback int function(Ihandle *ih); [in C] ih:unmap_cb() -> (ret: number) /// [in Lua] ih: identifier of the element that activated the event. /// Affects All that have a native representation. pub const OnUnmapFn = fn (self: *Self) anyerror!void; /// /// CARET_CB: Action generated when the caret/cursor position is changed. /// int function(Ihandle *ih, int lin, int col, int pos); [in /// C]ih:caret_cb(lin, col, pos: number) -> (ret: number) [in Lua] pub const OnCaretFn = fn (self: *Self, arg0: i32, arg1: i32, arg2: i32) anyerror!void; /// /// GETFOCUS_CB GETFOCUS_CB Action generated when an element is given keyboard focus. /// This callback is called after the KILLFOCUS_CB of the element that loosed /// the focus. /// The IupGetFocus function during the callback returns the element that /// loosed the focus. /// Callback int function(Ihandle *ih); [in C] ih:getfocus_cb() -> (ret: /// number) [in Lua] ih: identifier of the element that received keyboard focus. /// Affects All elements with user interaction, except menus. /// See Also KILLFOCUS_CB, IupGetFocus, IupSetFocus pub const OnGetFocusFn = fn (self: *Self) anyerror!void; /// /// BUTTON_CB BUTTON_CB Action generated when a mouse button is pressed or released. /// Callback int function(Ihandle* ih, int button, int pressed, int x, int y, /// char* status); [in C] ih:button_cb(button, pressed, x, y: number, status: /// string) -> (ret: number) [in Lua] ih: identifies the element that activated /// the event. /// button: identifies the activated mouse button: IUP_BUTTON1 - left mouse /// button (button 1); IUP_BUTTON2 - middle mouse button (button 2); /// IUP_BUTTON3 - right mouse button (button 3). /// pressed: indicates the state of the button: 0 - mouse button was released; /// 1 - mouse button was pressed. /// x, y: position in the canvas where the event has occurred, in pixels. /// status: status of the mouse buttons and some keyboard keys at the moment /// the event is generated. /// The following macros must be used for verification: iup_isshift(status) /// iup_iscontrol(status) iup_isbutton1(status) iup_isbutton2(status) /// iup_isbutton3(status) iup_isbutton4(status) iup_isbutton5(status) /// iup_isdouble(status) iup_isalt(status) iup_issys(status) They return 1 if /// the respective key or button is pressed, and 0 otherwise. /// These macros are also available in Lua, returning a boolean. /// Returns: IUP_CLOSE will be processed. /// On some controls if IUP_IGNORE is returned the action is ignored (this is /// system dependent). /// Notes This callback can be used to customize a button behavior. /// For a standard button behavior use the ACTION callback of the IupButton. /// For a single click the callback is called twice, one for pressed=1 and one /// for pressed=0. /// Only after both calls the ACTION callback is called. /// In Windows, if a dialog is shown or popup in any situation there could be /// unpredictable results because the native system still has processing to be /// done even after the callback is called. /// A double click is preceded by two single clicks, one for pressed=1 and one /// for pressed=0, and followed by a press=0, all three without the double /// click flag set. /// In GTK, it is preceded by an additional two single clicks sequence. /// For example, for one double click all the following calls are made: /// BUTTON_CB(but=1 (1), x=154, y=83 [ 1 ]) BUTTON_CB(but=1 (0), x=154, y=83 [ /// 1 ]) BUTTON_CB(but=1 (1), x=154, y=83 [ 1 ]) (in GTK only) BUTTON_CB(but=1 /// (0), x=154, y=83 [ 1 ]) (in GTK only) BUTTON_CB(but=1 (1), x=154, y=83 [ 1 /// D ]) BUTTON_CB(but=1 (0), x=154, y=83 [ 1 ]) Between press and release all /// mouse events are redirected only to this control, even if the cursor moves /// outside the element. /// So the BUTTON_CB callback when released and the MOTION_CB callback can be /// called with coordinates outside the element rectangle. /// Affects IupCanvas, IupButton, IupText, IupList, IupGLCanvas pub const OnButtonFn = fn (self: *Self, arg0: i32, arg1: i32, arg2: i32, arg3: i32, arg4: [:0]const u8) anyerror!void; /// /// VALUECHANGED_CB: Called after the value was interactively changed by the user. /// (since 3.0) int function(Ihandle *ih); [in C]ih:valuechanged_cb() -> (ret: /// number) [in Lua] pub const OnValueChangedFn = fn (self: *Self) anyerror!void; /// /// SPIN_CB: Action generated when a spin button is pressed. /// Valid only when SPIN=YES. /// When this callback is called the ACTION callback is not called. /// The VALUE attribute can be changed during this callback only if SPINAUTO=NO. /// (since 3.0) int function(Ihandle *ih, int pos); [in C]ih:spin_cb(pos: /// number) -> (ret: number) [in Lua] pub const OnSpinFn = fn (self: *Self, arg0: i32) anyerror!void; pub const OnLDestroyFn = fn (self: *Self) anyerror!void; /// /// LEAVEWINDOW_CB LEAVEWINDOW_CB Action generated when the mouse leaves the /// native element. /// Callback int function(Ihandle *ih); [in C] ih:leavewindow_cb() -> (ret: /// number) [in Lua] ih: identifier of the element that activated the event. /// Notes When the cursor is moved from one element to another, the call order /// in all platforms will be first the LEAVEWINDOW_CB callback of the old /// control followed by the ENTERWINDOW_CB callback of the new control. /// (since 3.14) If the mouse button is hold pressed and the cursor moves /// outside the element the behavior is system dependent. /// In Windows the LEAVEWINDOW_CB/ENTERWINDOW_CB callbacks are NOT called, in /// GTK the callbacks are called. /// Affects All controls with user interaction. /// See Also ENTERWINDOW_CB pub const OnLeaveWindowFn = fn (self: *Self) anyerror!void; pub const OnPostMessageFn = fn (self: *Self, arg0: [:0]const u8, arg1: i32, arg2: f64, arg3: *iup.Unknow) anyerror!void; pub const ZOrder = enum { Top, Bottom, }; pub const MaskReal = enum { Signed, Unsigned, }; pub const Expand = enum { Yes, Horizontal, Vertical, HorizontalFree, VerticalFree, No, }; pub const Floating = enum { Yes, Ignore, No, }; pub const SpinAlign = enum { Left, Right, }; /// /// FILTER [Windows Only] (non inheritable): allows a custom filter to process /// the characters: Can be LOWERCASE, UPPERCASE or NUMBER (only numbers allowed). /// (since 3.0) pub const Filter = enum { LowerCase, Number, UpperCase, }; /// /// CHANGECASE (non inheritable): Change case according to given conversion. /// Can be UPPER, LOWER, TOGGLE, or TITLE. /// TITLE case change first letter of words separated by spaces to upper case /// others to lower case, but first letter is changed only if word has more /// than 3 characters, for instance: "Best of the World". /// Supports Latin-1 encoding only, even when using UTF-8. /// Does not depends on current locale. /// (since 3.28) pub const ChangeCase = enum { Upper, Lower, Toggle, Title, }; /// /// CLIPBOARD (write-only): clear, cut, copy or paste the selection to or from /// the clipboard. /// Values: "CLEAR", "CUT", "COPY" or "PASTE". /// In Windows UNDO is also available, and REDO is available when FORMATTING=YES. /// (since 3.0) pub const Clipboard = enum { Copy, Cut, Paste, Clear, Undo, Redo, }; pub const RemoveFormatting = enum { All, Selection, }; pub const Initializer = struct { last_error: ?anyerror = null, ref: *Self, /// /// Returns a pointer to IUP element or an error. /// Only top-level or detached elements needs to be unwraped, pub fn unwrap(self: Initializer) !*Self { if (self.last_error) |e| { return e; } else { return self.ref; } } /// /// Captures a reference into a external variable /// Allows to capture some references even using full declarative API pub fn capture(self: *Initializer, ref: **Self) Initializer { ref.* = self.ref; return self.*; } pub fn setStrAttribute(self: *Initializer, attributeName: [:0]const u8, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; Self.setStrAttribute(self.ref, attributeName, arg); return self.*; } pub fn setIntAttribute(self: *Initializer, attributeName: [:0]const u8, arg: i32) Initializer { if (self.last_error) |_| return self.*; Self.setIntAttribute(self.ref, attributeName, arg); return self.*; } pub fn setBoolAttribute(self: *Initializer, attributeName: [:0]const u8, arg: bool) Initializer { if (self.last_error) |_| return self.*; Self.setBoolAttribute(self.ref, attributeName, arg); return self.*; } pub fn setPtrAttribute(self: *Initializer, comptime T: type, attributeName: [:0]const u8, value: ?*T) Initializer { if (self.last_error) |_| return self.*; Self.setPtrAttribute(self.ref, T, attributeName, value); return self.*; } pub fn setHandle(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setHandle(self.ref, arg); return self.*; } /// /// FGCOLOR: Text color. /// Default: the global attribute TXTFGCOLOR. pub fn setFgColor(self: *Initializer, rgb: iup.Rgb) Initializer { if (self.last_error) |_| return self.*; interop.setRgb(self.ref, "FGCOLOR", .{}, rgb); return self.*; } pub fn setHandleName(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "HANDLENAME", .{}, arg); return self.*; } pub fn setTipBgColor(self: *Initializer, rgb: iup.Rgb) Initializer { if (self.last_error) |_| return self.*; interop.setRgb(self.ref, "TIPBGCOLOR", .{}, rgb); return self.*; } /// /// WORDWRAP (creation only): Valid only when MULTILINE=YES. /// If enabled will force a word wrap of lines that are greater than the with /// of the control, and the horizontal scrollbar will be removed. /// Default: NO. pub fn setWordWrap(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "WORDWRAP", .{}, arg); return self.*; } /// /// PASSWORD (creation only) [Windows and GTK Only] (non inheritable): Hide the /// typed character using an "*". /// Default: "NO". pub fn setPassword(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "PASSWORD", .{}, arg); return self.*; } /// /// CARET (non inheritable): Character position of the insertion point. /// Its format depends in MULTILINE=YES. /// The first position, lin or col, is "1". pub fn setCaret(self: *Initializer, lin: i32, col: i32) Initializer { if (self.last_error) |_| return self.*; var buffer: [128]u8 = undefined; var value = iup.LinColPos.intIntToString(&buffer, lin, col, ','); interop.setStrAttribute(self.ref, "CARET", .{}, value); return self.*; } pub fn setMaskDecimalSymbol(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "MASKDECIMALSYMBOL", .{}, arg); return self.*; } pub fn setTipIcon(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "TIPICON", .{}, arg); return self.*; } /// /// OVERWRITE [Windows and GTK Only] (non inheritable): turns the overwrite /// mode ON or OFF. /// Works only when FORMATTING=YES. /// (since 3.0) pub fn setOverwrite(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "OVERWRITE", .{}, arg); return self.*; } pub fn setAddFormatTagHandle(self: *Initializer, arg: *iup.User) Initializer { if (self.last_error) |_| return self.*; interop.setHandleAttribute(self.ref, "ADDFORMATTAG_HANDLE", .{}, arg); return self.*; } pub fn setAddFormatTagHandleHandleName(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "ADDFORMATTAG_HANDLE", .{}, arg); return self.*; } pub fn setSpinInc(self: *Initializer, arg: i32) Initializer { if (self.last_error) |_| return self.*; interop.setIntAttribute(self.ref, "SPININC", .{}, arg); return self.*; } pub fn setMaxSize(self: *Initializer, width: ?i32, height: ?i32) Initializer { if (self.last_error) |_| return self.*; var buffer: [128]u8 = undefined; var value = Size.intIntToString(&buffer, width, height); interop.setStrAttribute(self.ref, "MAXSIZE", .{}, value); return self.*; } pub fn setPosition(self: *Initializer, x: i32, y: i32) Initializer { if (self.last_error) |_| return self.*; var buffer: [128]u8 = undefined; var value = iup.XYPos.intIntToString(&buffer, x, y, ','); interop.setStrAttribute(self.ref, "POSITION", .{}, value); return self.*; } pub fn setAppendNewLine(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "APPENDNEWLINE", .{}, arg); return self.*; } /// /// DROPFILESTARGET [Windows and GTK Only] (non inheritable): Enable or disable /// the drop of files. /// Default: NO, but if DROPFILES_CB is defined when the element is mapped then /// it will be automatically enabled. /// (since 3.0) pub fn setDropFilesTarget(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "DROPFILESTARGET", .{}, arg); return self.*; } pub fn setTip(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "TIP", .{}, arg); return self.*; } /// /// CANFOCUS (creation only) (non inheritable): enables the focus traversal of /// the control. /// In Windows the control will still get the focus when clicked. /// Default: YES. /// (since 3.0) pub fn setCanFocus(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "CANFOCUS", .{}, arg); return self.*; } pub fn setDragSourceMove(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "DRAGSOURCEMOVE", .{}, arg); return self.*; } pub fn setAddFormatTag(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "ADDFORMATTAG", .{}, arg); return self.*; } pub fn setVisible(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "VISIBLE", .{}, arg); return self.*; } /// /// NC: Maximum number of characters allowed for keyboard input, larger text /// can still be set using attributes. /// The maximum value is the limit of the VALUE attribute. /// The "0" value is the same as maximum. /// Default: maximum. pub fn setNc(self: *Initializer, arg: i32) Initializer { if (self.last_error) |_| return self.*; interop.setIntAttribute(self.ref, "NC", .{}, arg); return self.*; } pub fn zOrder(self: *Initializer, arg: ?ZOrder) Initializer { if (self.last_error) |_| return self.*; if (arg) |value| switch (value) { .Top => interop.setStrAttribute(self.ref, "ZORDER", .{}, "TOP"), .Bottom => interop.setStrAttribute(self.ref, "ZORDER", .{}, "BOTTOM"), } else { interop.clearAttribute(self.ref, "ZORDER", .{}); } return self.*; } pub fn setDragDrop(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "DRAGDROP", .{}, arg); return self.*; } pub fn setTheme(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "THEME", .{}, arg); return self.*; } pub fn setMaskReal(self: *Initializer, arg: ?MaskReal) Initializer { if (self.last_error) |_| return self.*; if (arg) |value| switch (value) { .Signed => interop.setStrAttribute(self.ref, "MASKREAL", .{}, "SIGNED"), .Unsigned => interop.setStrAttribute(self.ref, "MASKREAL", .{}, "UNSIGNED"), } else { interop.clearAttribute(self.ref, "MASKREAL", .{}); } return self.*; } pub fn setExpand(self: *Initializer, arg: ?Expand) Initializer { if (self.last_error) |_| return self.*; if (arg) |value| switch (value) { .Yes => interop.setStrAttribute(self.ref, "EXPAND", .{}, "YES"), .Horizontal => interop.setStrAttribute(self.ref, "EXPAND", .{}, "HORIZONTAL"), .Vertical => interop.setStrAttribute(self.ref, "EXPAND", .{}, "VERTICAL"), .HorizontalFree => interop.setStrAttribute(self.ref, "EXPAND", .{}, "HORIZONTALFREE"), .VerticalFree => interop.setStrAttribute(self.ref, "EXPAND", .{}, "VERTICALFREE"), .No => interop.setStrAttribute(self.ref, "EXPAND", .{}, "NO"), } else { interop.clearAttribute(self.ref, "EXPAND", .{}); } return self.*; } /// /// VISIBLELINES: When MULTILINE=YES defines the number of visible lines for /// the Natural Size, this means that will act also as minimum number of /// visible lines. /// As for SIZE you can set to NULL after map to use it as an initial value. /// Default: 1 (since 3.0) pub fn setVisibleLines(self: *Initializer, arg: i32) Initializer { if (self.last_error) |_| return self.*; interop.setIntAttribute(self.ref, "VISIBLELINES", .{}, arg); return self.*; } /// /// SIZE (non inheritable): Since the contents can be changed by the user, the /// Natural Size is not affected by the text contents (since 3.0). /// Use VISIBLECOLUMNS and VISIBLELINES to control the Natural Size. pub fn setSize(self: *Initializer, width: ?i32, height: ?i32) Initializer { if (self.last_error) |_| return self.*; var buffer: [128]u8 = undefined; var value = Size.intIntToString(&buffer, width, height); interop.setStrAttribute(self.ref, "SIZE", .{}, value); return self.*; } /// /// PADDING: internal margin. /// Works just like the MARGIN attribute of the IupHbox and IupVbox containers, /// but uses a different name to avoid inheritance problems. /// Default value: "0x0". /// In Windows, only the horizontal value is used. /// (since 3.0) (GTK 2.10 for single line) pub fn setPadding(self: *Initializer, width: ?i32, height: ?i32) Initializer { if (self.last_error) |_| return self.*; var buffer: [128]u8 = undefined; var value = Size.intIntToString(&buffer, width, height); interop.setStrAttribute(self.ref, "PADDING", .{}, value); return self.*; } pub fn setSpinMin(self: *Initializer, arg: i32) Initializer { if (self.last_error) |_| return self.*; interop.setIntAttribute(self.ref, "SPINMIN", .{}, arg); return self.*; } pub fn setTipMarkup(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "TIPMARKUP", .{}, arg); return self.*; } pub fn setFontSize(self: *Initializer, arg: i32) Initializer { if (self.last_error) |_| return self.*; interop.setIntAttribute(self.ref, "FONTSIZE", .{}, arg); return self.*; } pub fn setDropTypes(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "DROPTYPES", .{}, arg); return self.*; } pub fn setUserSize(self: *Initializer, width: ?i32, height: ?i32) Initializer { if (self.last_error) |_| return self.*; var buffer: [128]u8 = undefined; var value = Size.intIntToString(&buffer, width, height); interop.setStrAttribute(self.ref, "USERSIZE", .{}, value); return self.*; } pub fn setTipDelay(self: *Initializer, arg: i32) Initializer { if (self.last_error) |_| return self.*; interop.setIntAttribute(self.ref, "TIPDELAY", .{}, arg); return self.*; } /// /// SCROLLBAR (creation only): Valid only when MULTILINE=YES. /// Associates an automatic horizontal and/or vertical scrollbar to the multiline. /// Can be: "VERTICAL", "HORIZONTAL", "YES" (both) or "NO" (none). /// Default: "YES". /// For all systems, when SCROLLBAR!=NO the natural size will always include /// its size even if the native system hides the scrollbar. /// If AUTOHIDE=YES scrollbars are visible only if they are necessary, by /// default AUTOHIDE=NO. /// In Windows when FORMATTING=NO, AUTOHIDE is not supported. /// In Motif AUTOHIDE is not supported. pub fn setScrollBar(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "SCROLLBAR", .{}, arg); return self.*; } /// /// TABSIZE [Windows and GTK Only]: Valid only when MULTILINE=YES. /// Controls the number of characters for a tab stop. /// Default: 8. pub fn setTabsIZe(self: *Initializer, arg: i32) Initializer { if (self.last_error) |_| return self.*; interop.setIntAttribute(self.ref, "TABSIZE", .{}, arg); return self.*; } /// /// PROPAGATEFOCUS(non inheritable): enables the focus callback forwarding to /// the next native parent with FOCUS_CB defined. /// Default: NO. /// (since 3.23) pub fn setPropagateFocus(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "PROPAGATEFOCUS", .{}, arg); return self.*; } /// /// BGCOLOR: Background color of the text. /// Default: the global attribute TXTBGCOLOR. /// Ignored in GTK when MULTILINE=NO. pub fn setBgColor(self: *Initializer, rgb: iup.Rgb) Initializer { if (self.last_error) |_| return self.*; interop.setRgb(self.ref, "BGCOLOR", .{}, rgb); return self.*; } pub fn setDropTarget(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "DROPTARGET", .{}, arg); return self.*; } /// /// VALUEMASKED (non inheritable) (write-only): sets VALUE but first checks if /// it is validated by MASK. /// If not does nothing. /// (since 3.4) pub fn valueMasked(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "VALUEMASKED", .{}, arg); return self.*; } pub fn setDragSource(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "DRAGSOURCE", .{}, arg); return self.*; } pub fn setFloating(self: *Initializer, arg: ?Floating) Initializer { if (self.last_error) |_| return self.*; if (arg) |value| switch (value) { .Yes => interop.setStrAttribute(self.ref, "FLOATING", .{}, "YES"), .Ignore => interop.setStrAttribute(self.ref, "FLOATING", .{}, "IGNORE"), .No => interop.setStrAttribute(self.ref, "FLOATING", .{}, "NO"), } else { interop.clearAttribute(self.ref, "FLOATING", .{}); } return self.*; } pub fn setNormalizerGroup(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "NORMALIZERGROUP", .{}, arg); return self.*; } pub fn setRasterSize(self: *Initializer, width: ?i32, height: ?i32) Initializer { if (self.last_error) |_| return self.*; var buffer: [128]u8 = undefined; var value = Size.intIntToString(&buffer, width, height); interop.setStrAttribute(self.ref, "RASTERSIZE", .{}, value); return self.*; } /// /// SCROLLTOPOS (non inheritable, write only): Scroll the text to make the /// given character position visible. /// It uses the same format and reference of the CARETPOS attribute ("pos" /// starting at 0). /// (since 3.0) pub fn scrollTopOs(self: *Initializer, arg: i32) Initializer { if (self.last_error) |_| return self.*; interop.setIntAttribute(self.ref, "SCROLLTOPOS", .{}, arg); return self.*; } /// /// FORMATTING [Windows and GTK Only] (non inheritable): When enabled allow the /// use of text formatting attributes. /// In GTK is always enabled, but only when MULTILINE=YES. /// Default: NO. /// (since 3.0) pub fn setFormatting(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "FORMATTING", .{}, arg); return self.*; } /// /// SCROLLTO (non inheritable, write only): Scroll the text to make the given /// character position visible. /// It uses the same format and reference of the CARET attribute ("lin:col" or /// "col" starting at 1). /// In Windows, when FORMATTING=Yes "col" is ignored. /// (since 3.0) pub fn scrollTo(self: *Initializer, arg: i32) Initializer { if (self.last_error) |_| return self.*; interop.setIntAttribute(self.ref, "SCROLLTO", .{}, arg); return self.*; } pub fn setTipFgColor(self: *Initializer, rgb: iup.Rgb) Initializer { if (self.last_error) |_| return self.*; interop.setRgb(self.ref, "TIPFGCOLOR", .{}, rgb); return self.*; } pub fn setSpinWrap(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "SPINWRAP", .{}, arg); return self.*; } pub fn setFontFace(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "FONTFACE", .{}, arg); return self.*; } /// /// VISIBLECOLUMNS: Defines the number of visible columns for the Natural Size, /// this means that will act also as minimum number of visible columns. /// It uses a wider character size than the one used for the SIZE attribute so /// strings will fit better without the need of extra columns. /// As for SIZE you can set to NULL after map to use it as an initial value. /// Default: 5 (since 3.0) pub fn setVisibleColumns(self: *Initializer, arg: i32) Initializer { if (self.last_error) |_| return self.*; interop.setIntAttribute(self.ref, "VISIBLECOLUMNS", .{}, arg); return self.*; } pub fn setMaskInt(self: *Initializer, begin: i32, end: i32) Initializer { if (self.last_error) |_| return self.*; var buffer: [128]u8 = undefined; var value = iup.Range.intIntToString(&buffer, begin, end, ','); interop.setStrAttribute(self.ref, "MASKINT", .{}, value); return self.*; } /// /// SPINVALUE (non inheritable): the current value of the spin. /// The value is limited to the minimum and maximum values. /// SPINMAX (non inheritable): the maximum value. /// Default: 100. /// SPINMIN (non inheritable): the minimum value. /// Default: 0. /// SPININC (non inheritable): the increment value. /// Default: 1. /// SPINALIGN (creation only): the position of the spin. /// Can be LEFT or RIGHT. /// Default: RIGHT. /// In GTK is always RIGHT. /// SPINWRAP (creation only): if the position reach a limit it continues from /// the opposite limit. /// Default: NO. /// SPINAUTO (creation only): enables the automatic update of the text contents. /// Default: YES. /// Use SPINAUTO=NO and the VALUE attribute during SPIN_CB to control the text /// contents when the spin is incremented. pub fn setSpinValue(self: *Initializer, arg: i32) Initializer { if (self.last_error) |_| return self.*; interop.setIntAttribute(self.ref, "SPINVALUE", .{}, arg); return self.*; } pub fn setSpinAlign(self: *Initializer, arg: ?SpinAlign) Initializer { if (self.last_error) |_| return self.*; if (arg) |value| switch (value) { .Left => interop.setStrAttribute(self.ref, "SPINALIGN", .{}, "LEFT"), .Right => interop.setStrAttribute(self.ref, "SPINALIGN", .{}, "RIGHT"), } else { interop.clearAttribute(self.ref, "SPINALIGN", .{}); } return self.*; } pub fn setName(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "NAME", .{}, arg); return self.*; } pub fn setMaskCasei(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "MASKCASEI", .{}, arg); return self.*; } /// /// SELECTIONPOS (non inheritable): Same as SELECTION but using a zero based /// character index "pos1:pos2". /// Useful for indexing the VALUE string. /// The values ALL and NONE are also accepted. /// See the Notes below if using UTF-8 strings in GTK. /// (since 3.0) pub fn setSelectionPos(self: *Initializer, begin: i32, end: i32) Initializer { if (self.last_error) |_| return self.*; var buffer: [128]u8 = undefined; var value = iup.Range.intIntToString(&buffer, begin, end, ','); interop.setStrAttribute(self.ref, "SELECTIONPOS", .{}, value); return self.*; } /// /// VALUE (non inheritable): Text entered by the user. /// The '\n' character indicates a new line, valid only when MULTILINE=YES. /// After the element is mapped and if there is no text will return the empty /// string "". pub fn setValue(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "VALUE", .{}, arg); return self.*; } /// /// FILTER [Windows Only] (non inheritable): allows a custom filter to process /// the characters: Can be LOWERCASE, UPPERCASE or NUMBER (only numbers allowed). /// (since 3.0) pub fn setFilter(self: *Initializer, arg: ?Filter) Initializer { if (self.last_error) |_| return self.*; if (arg) |value| switch (value) { .LowerCase => interop.setStrAttribute(self.ref, "FILTER", .{}, "LOWERCASE"), .Number => interop.setStrAttribute(self.ref, "FILTER", .{}, "NUMBER"), .UpperCase => interop.setStrAttribute(self.ref, "FILTER", .{}, "UPPERCASE"), } else { interop.clearAttribute(self.ref, "FILTER", .{}); } return self.*; } pub fn setSpinMax(self: *Initializer, arg: i32) Initializer { if (self.last_error) |_| return self.*; interop.setIntAttribute(self.ref, "SPINMAX", .{}, arg); return self.*; } /// /// MULTILINE (creation only) (non inheritable): allows the edition of multiple lines. /// In single line mode some characters are invalid, like "\t", "\r" and "\n". /// Default: NO. /// When set to Yes will also reset the SCROLLBAR attribute to Yes. /// The values ALL and NONE are also accepted independently of MULTILINE (since 3.0). pub fn setMultiline(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "MULTILINE", .{}, arg); return self.*; } /// /// SELECTEDTEXT (non inheritable): Selection text. /// Returns NULL if there is no selection. /// When changed replaces the current selection. /// Similar to INSERT, but does nothing if there is no selection. pub fn setSelectedText(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "SELECTEDTEXT", .{}, arg); return self.*; } /// /// CPADDING: same as PADDING but using the units of the SIZE attribute. /// It will actually set the PADDING attribute. /// (since 3.29) pub fn setCPadding(self: *Initializer, width: ?i32, height: ?i32) Initializer { if (self.last_error) |_| return self.*; var buffer: [128]u8 = undefined; var value = Size.intIntToString(&buffer, width, height); interop.setStrAttribute(self.ref, "CPADDING", .{}, value); return self.*; } /// /// ACTIVE, FONT, EXPAND, SCREENPOSITION, POSITION, MINSIZE, MAXSIZE, WID, TIP, /// RASTERSIZE, ZORDER, VISIBLE, THEME: also accepted. pub fn setActive(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "ACTIVE", .{}, arg); return self.*; } pub fn setTipVisible(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "TIPVISIBLE", .{}, arg); return self.*; } /// /// CHANGECASE (non inheritable): Change case according to given conversion. /// Can be UPPER, LOWER, TOGGLE, or TITLE. /// TITLE case change first letter of words separated by spaces to upper case /// others to lower case, but first letter is changed only if word has more /// than 3 characters, for instance: "Best of the World". /// Supports Latin-1 encoding only, even when using UTF-8. /// Does not depends on current locale. /// (since 3.28) pub fn changeCase(self: *Initializer, arg: ?ChangeCase) Initializer { if (self.last_error) |_| return self.*; if (arg) |value| switch (value) { .Upper => interop.setStrAttribute(self.ref, "CHANGECASE", .{}, "UPPER"), .Lower => interop.setStrAttribute(self.ref, "CHANGECASE", .{}, "LOWER"), .Toggle => interop.setStrAttribute(self.ref, "CHANGECASE", .{}, "TOGGLE"), .Title => interop.setStrAttribute(self.ref, "CHANGECASE", .{}, "TITLE"), } else { interop.clearAttribute(self.ref, "CHANGECASE", .{}); } return self.*; } /// /// CUEBANNER [Windows and GTK Only] (non inheritable): a text that is /// displayed when there is no text at the control. /// It works as a textual cue, or tip to prompt the user for input. /// Valid only for MULTILINE=NO, and works only when Visual Styles are enabled. /// (since 3.0) [GTK 3.2] (GTK support added in IUP 3.20) pub fn setCueBanner(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "CUEBANNER", .{}, arg); return self.*; } pub fn setExpandWeight(self: *Initializer, arg: f64) Initializer { if (self.last_error) |_| return self.*; interop.setDoubleAttribute(self.ref, "EXPANDWEIGHT", .{}, arg); return self.*; } pub fn setMinSize(self: *Initializer, width: ?i32, height: ?i32) Initializer { if (self.last_error) |_| return self.*; var buffer: [128]u8 = undefined; var value = Size.intIntToString(&buffer, width, height); interop.setStrAttribute(self.ref, "MINSIZE", .{}, value); return self.*; } /// /// SPIN (non inheritable, creation only): enables a spin control attached to /// the element. /// Default: NO. /// The spin increments and decrements an integer number. /// The editing in the element is still available. /// (since 3.0) pub fn setSpin(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "SPIN", .{}, arg); return self.*; } pub fn setNTheme(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "NTHEME", .{}, arg); return self.*; } /// /// BORDER (creation only): Shows a border around the text. /// Default: "YES". pub fn setBorder(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "BORDER", .{}, arg); return self.*; } /// /// CARETPOS (non inheritable): Also the character position of the insertion /// point, but using a zero based character unique index "pos". /// Useful for indexing the VALUE string. /// See the Notes below if using UTF-8 strings in GTK. /// (since 3.0) pub fn setCaretPos(self: *Initializer, arg: i32) Initializer { if (self.last_error) |_| return self.*; interop.setIntAttribute(self.ref, "CARETPOS", .{}, arg); return self.*; } pub fn setSpinAuto(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "SPINAUTO", .{}, arg); return self.*; } /// /// MASK (non inheritable): Defines a mask that will filter interactive text input. pub fn setMask(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "MASK", .{}, arg); return self.*; } pub fn setDragTypes(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "DRAGTYPES", .{}, arg); return self.*; } pub fn setAutoHide(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "AUTOHIDE", .{}, arg); return self.*; } pub fn setFontStyle(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "FONTSTYLE", .{}, arg); return self.*; } /// /// CLIPBOARD (write-only): clear, cut, copy or paste the selection to or from /// the clipboard. /// Values: "CLEAR", "CUT", "COPY" or "PASTE". /// In Windows UNDO is also available, and REDO is available when FORMATTING=YES. /// (since 3.0) pub fn setClipboard(self: *Initializer, arg: ?Clipboard) Initializer { if (self.last_error) |_| return self.*; if (arg) |value| switch (value) { .Copy => interop.setStrAttribute(self.ref, "CLIPBOARD", .{}, "COPY"), .Cut => interop.setStrAttribute(self.ref, "CLIPBOARD", .{}, "CUT"), .Paste => interop.setStrAttribute(self.ref, "CLIPBOARD", .{}, "PASTE"), .Clear => interop.setStrAttribute(self.ref, "CLIPBOARD", .{}, "CLEAR"), .Undo => interop.setStrAttribute(self.ref, "CLIPBOARD", .{}, "UNDO"), .Redo => interop.setStrAttribute(self.ref, "CLIPBOARD", .{}, "REDO"), } else { interop.clearAttribute(self.ref, "CLIPBOARD", .{}); } return self.*; } pub fn removeFormatting(self: *Initializer, arg: ?RemoveFormatting) Initializer { if (self.last_error) |_| return self.*; if (arg) |value| switch (value) { .All => interop.setStrAttribute(self.ref, "REMOVEFORMATTING", .{}, "ALL"), .Selection => interop.setStrAttribute(self.ref, "REMOVEFORMATTING", .{}, "SELECTION"), } else { interop.clearAttribute(self.ref, "REMOVEFORMATTING", .{}); } return self.*; } /// /// READONLY: Allows the user only to read the contents, without changing it. /// Restricts keyboard input only, text value can still be changed using attributes. /// Navigation keys are still available. /// Possible values: "YES", "NO". /// Default: NO. pub fn setReadonly(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "READONLY", .{}, arg); return self.*; } /// /// APPEND (write-only): Inserts a text at the end of the current text. /// In the Multiline, if APPENDNEWLINE=YES, a "\n" character will be /// automatically inserted before the appended text if the current text is not /// empty(APPENDNEWLINE default is YES). /// Ignored if set before map. pub fn append(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "APPEND", .{}, arg); return self.*; } pub fn setMaskNoEmpty(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "MASKNOEMPTY", .{}, arg); return self.*; } pub fn setFont(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "FONT", .{}, arg); return self.*; } /// /// TABIMAGEn (non inheritable): image name to be used in the respective tab. /// Use IupSetHandle or IupSetAttributeHandle to associate an image to a name. /// n starts at 0. /// See also IupImage. /// In Motif, the image is shown only if TABTITLEn is NULL. /// In Windows and Motif set the BGCOLOR attribute before setting the image. /// When set after map will update the TABIMAGE attribute on the respective /// child (since 3.10). /// (since 3.0). /// TABIMAGE (non inheritable) (at children only): Same as TABIMAGEn but set in /// each child. /// Works only if set before the child is added to the tabs. pub fn setTabImage(self: *Initializer, index: i32, arg: anytype) Initializer { if (self.last_error) |_| return self.*; if (interop.validateHandle(.Image, arg)) { interop.setHandleAttribute(self.ref, "TABIMAGE", .{index}, arg); } else |err| { self.last_error = err; } return self.*; } pub fn setTabImageHandleName(self: *Initializer, index: i32, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "TABIMAGE", .{index}, arg); return self.*; } /// /// TABTITLEn (non inheritable): Contains the text to be shown in the /// respective tab title. /// n starts at 0. /// If this value is NULL, it will remain empty. /// The "&" character can be used to define a mnemonic, the next character will /// be used as key. /// Use "&&" to show the "&" character instead on defining a mnemonic. /// The button can be activated from any control in the dialog using the /// "Alt+key" combination. /// (mnemonic support since 3.3). /// When set after map will update the TABTITLE attribute on the respective /// child (since 3.10). /// (since 3.0). /// TABTITLE (non inheritable) (at children only): Same as TABTITLEn but set in /// each child. /// Works only if set before the child is added to the tabs. pub fn setTabTitle(self: *Initializer, index: i32, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "TABTITLE", .{index}, arg); return self.*; } /// /// K_ANY K_ANY Action generated when a keyboard event occurs. /// Callback int function(Ihandle *ih, int c); [in C] ih:k_any(c: number) -> /// (ret: number) [in Lua] ih: identifier of the element that activated the event. /// c: identifier of typed key. /// Please refer to the Keyboard Codes table for a list of possible values. /// Returns: If IUP_IGNORE is returned the key is ignored and not processed by /// the control and not propagated. /// If returns IUP_CONTINUE, the key will be processed and the event will be /// propagated to the parent of the element receiving it, this is the default behavior. /// If returns IUP_DEFAULT the key is processed but it is not propagated. /// IUP_CLOSE will be processed. /// Notes Keyboard callbacks depend on the keyboard usage of the control with /// the focus. /// So if you return IUP_IGNORE the control will usually not process the key. /// But be aware that sometimes the control process the key in another event so /// even returning IUP_IGNORE the key can get processed. /// Although it will not be propagated. /// IMPORTANT: The callbacks "K_*" of the dialog or native containers depend on /// the IUP_CONTINUE return value to work while the control is in focus. /// If the callback does not exists it is automatically propagated to the /// parent of the element. /// K_* callbacks All defined keys are also callbacks of any element, called /// when the respective key is activated. /// For example: "K_cC" is also a callback activated when the user press /// Ctrl+C, when the focus is at the element or at a children with focus. /// This is the way an application can create shortcut keys, also called hot keys. /// These callbacks are not available in IupLua. /// Affects All elements with keyboard interaction. pub fn setKAnyCallback(self: *Initializer, callback: ?OnKAnyFn) Initializer { const Handler = CallbackHandler(Self, OnKAnyFn, "K_ANY"); Handler.setCallback(self.ref, callback); return self.*; } /// /// HELP_CB HELP_CB Action generated when the user press F1 at a control. /// In Motif is also activated by the Help button in some workstations keyboard. /// Callback void function(Ihandle *ih); [in C] ih:help_cb() -> (ret: number) /// [in Lua] ih: identifier of the element that activated the event. /// Returns: IUP_CLOSE will be processed. /// Affects All elements with user interaction. pub fn setHelpCallback(self: *Initializer, callback: ?OnHelpFn) Initializer { const Handler = CallbackHandler(Self, OnHelpFn, "HELP_CB"); Handler.setCallback(self.ref, callback); return self.*; } pub fn setDropMotionCallback(self: *Initializer, callback: ?OnDropMotionFn) Initializer { const Handler = CallbackHandler(Self, OnDropMotionFn, "DROPMOTION_CB"); Handler.setCallback(self.ref, callback); return self.*; } pub fn setDragEndCallback(self: *Initializer, callback: ?OnDragEndFn) Initializer { const Handler = CallbackHandler(Self, OnDragEndFn, "DRAGEND_CB"); Handler.setCallback(self.ref, callback); return self.*; } pub fn setDragBeginCallback(self: *Initializer, callback: ?OnDragBeginFn) Initializer { const Handler = CallbackHandler(Self, OnDragBeginFn, "DRAGBEGIN_CB"); Handler.setCallback(self.ref, callback); return self.*; } /// /// ACTION ACTION Action generated when the element is activated. /// Affects each element differently. /// Callback int function(Ihandle *ih); [in C] ih:action() -> (ret: number) [in /// Lua] ih: identifier of the element that activated the event. /// In some elements, this callback may receive more parameters, apart from ih. /// Please refer to each element's documentation. /// Affects IupButton, IupItem, IupList, IupText, IupCanvas, IupMultiline, /// IupToggle pub fn setActionCallback(self: *Initializer, callback: ?OnActionFn) Initializer { const Handler = CallbackHandler(Self, OnActionFn, "ACTION"); Handler.setCallback(self.ref, callback); return self.*; } /// /// MOTION_CB MOTION_CB Action generated when the mouse moves. /// Callback int function(Ihandle *ih, int x, int y, char *status); [in C] /// ih:motion_cb(x, y: number, status: string) -> (ret: number) [in Lua] ih: /// identifier of the element that activated the event. /// x, y: position in the canvas where the event has occurred, in pixels. /// status: status of mouse buttons and certain keyboard keys at the moment the /// event was generated. /// The same macros used for BUTTON_CB can be used for this status. /// Notes Between press and release all mouse events are redirected only to /// this control, even if the cursor moves outside the element. /// So the BUTTON_CB callback when released and the MOTION_CB callback can be /// called with coordinates outside the element rectangle. /// Affects IupCanvas, IupGLCanvas pub fn setMotionCallback(self: *Initializer, callback: ?OnMotionFn) Initializer { const Handler = CallbackHandler(Self, OnMotionFn, "MOTION_CB"); Handler.setCallback(self.ref, callback); return self.*; } /// /// MAP_CB MAP_CB Called right after an element is mapped and its attributes /// updated in IupMap. /// When the element is a dialog, it is called after the layout is updated. /// For all other elements is called before the layout is updated, so the /// element current size will still be 0x0 during MAP_CB (since 3.14). /// Callback int function(Ihandle *ih); [in C] ih:map_cb() -> (ret: number) [in /// Lua] ih: identifier of the element that activated the event. /// Affects All that have a native representation. pub fn setMapCallback(self: *Initializer, callback: ?OnMapFn) Initializer { const Handler = CallbackHandler(Self, OnMapFn, "MAP_CB"); Handler.setCallback(self.ref, callback); return self.*; } /// /// ENTERWINDOW_CB ENTERWINDOW_CB Action generated when the mouse enters the /// native element. /// Callback int function(Ihandle *ih); [in C] ih:enterwindow_cb() -> (ret: /// number) [in Lua] ih: identifier of the element that activated the event. /// Notes When the cursor is moved from one element to another, the call order /// in all platforms will be first the LEAVEWINDOW_CB callback of the old /// control followed by the ENTERWINDOW_CB callback of the new control. /// (since 3.14) If the mouse button is hold pressed and the cursor moves /// outside the element the behavior is system dependent. /// In Windows the LEAVEWINDOW_CB/ENTERWINDOW_CB callbacks are NOT called, in /// GTK the callbacks are called. /// Affects All controls with user interaction. /// See Also LEAVEWINDOW_CB pub fn setEnterWindowCallback(self: *Initializer, callback: ?OnEnterWindowFn) Initializer { const Handler = CallbackHandler(Self, OnEnterWindowFn, "ENTERWINDOW_CB"); Handler.setCallback(self.ref, callback); return self.*; } /// /// DESTROY_CB DESTROY_CB Called right before an element is destroyed. /// Callback int function(Ihandle *ih); [in C] ih:destroy_cb() -> (ret: number) /// [in Lua] ih: identifier of the element that activated the event. /// Notes If the dialog is visible then it is hidden before it is destroyed. /// The callback will be called right after it is hidden. /// The callback will be called before all other destroy procedures. /// For instance, if the element has children then it is called before the /// children are destroyed. /// For language binding implementations use the callback name "LDESTROY_CB" to /// release memory allocated by the binding for the element. /// Also the callback will be called before the language callback. /// Affects All. pub fn setDestroyCallback(self: *Initializer, callback: ?OnDestroyFn) Initializer { const Handler = CallbackHandler(Self, OnDestroyFn, "DESTROY_CB"); Handler.setCallback(self.ref, callback); return self.*; } pub fn setDropDataCallback(self: *Initializer, callback: ?OnDropDataFn) Initializer { const Handler = CallbackHandler(Self, OnDropDataFn, "DROPDATA_CB"); Handler.setCallback(self.ref, callback); return self.*; } /// /// KILLFOCUS_CB KILLFOCUS_CB Action generated when an element loses keyboard focus. /// This callback is called before the GETFOCUS_CB of the element that gets the focus. /// Callback int function(Ihandle *ih); [in C] ih:killfocus_cb() -> (ret: /// number) [in Lua] ih: identifier of the element that activated the event. /// Affects All elements with user interaction, except menus. /// In Windows, there are restrictions when using this callback. /// From MSDN on WM_KILLFOCUS: "While processing this message, do not make any /// function calls that display or activate a window. /// This causes the thread to yield control and can cause the application to /// stop responding to messages. /// See Also GETFOCUS_CB, IupGetFocus, IupSetFocus pub fn setKillFocusCallback(self: *Initializer, callback: ?OnKillFocusFn) Initializer { const Handler = CallbackHandler(Self, OnKillFocusFn, "KILLFOCUS_CB"); Handler.setCallback(self.ref, callback); return self.*; } pub fn setDragDataCallback(self: *Initializer, callback: ?OnDragDataFn) Initializer { const Handler = CallbackHandler(Self, OnDragDataFn, "DRAGDATA_CB"); Handler.setCallback(self.ref, callback); return self.*; } pub fn setDragDataSizeCallback(self: *Initializer, callback: ?OnDragDataSizeFn) Initializer { const Handler = CallbackHandler(Self, OnDragDataSizeFn, "DRAGDATASIZE_CB"); Handler.setCallback(self.ref, callback); return self.*; } /// /// DROPFILES_CB DROPFILES_CB Action called when a file is "dropped" into the control. /// When several files are dropped at once, the callback is called several /// times, once for each file. /// If defined after the element is mapped then the attribute DROPFILESTARGET /// must be set to YES. /// [Windows and GTK Only] (GTK 2.6) Callback int function(Ihandle *ih, const /// char* filename, int num, int x, int y); [in C] ih:dropfiles_cb(filename: /// string; num, x, y: number) -> (ret: number) [in Lua] ih: identifier of the /// element that activated the event. /// filename: Name of the dropped file. /// num: Number index of the dropped file. /// If several files are dropped, num is the index of the dropped file starting /// from "total-1" to "0". /// x: X coordinate of the point where the user released the mouse button. /// y: Y coordinate of the point where the user released the mouse button. /// Returns: If IUP_IGNORE is returned the callback will NOT be called for the /// next dropped files, and the processing of dropped files will be interrupted. /// Affects IupDialog, IupCanvas, IupGLCanvas, IupText, IupList pub fn setDropFilesCallback(self: *Initializer, callback: ?OnDropFilesFn) Initializer { const Handler = CallbackHandler(Self, OnDropFilesFn, "DROPFILES_CB"); Handler.setCallback(self.ref, callback); return self.*; } /// /// UNMAP_CB UNMAP_CB Called right before an element is unmapped. /// Callback int function(Ihandle *ih); [in C] ih:unmap_cb() -> (ret: number) /// [in Lua] ih: identifier of the element that activated the event. /// Affects All that have a native representation. pub fn setUnmapCallback(self: *Initializer, callback: ?OnUnmapFn) Initializer { const Handler = CallbackHandler(Self, OnUnmapFn, "UNMAP_CB"); Handler.setCallback(self.ref, callback); return self.*; } /// /// CARET_CB: Action generated when the caret/cursor position is changed. /// int function(Ihandle *ih, int lin, int col, int pos); [in /// C]ih:caret_cb(lin, col, pos: number) -> (ret: number) [in Lua] pub fn setCaretCallback(self: *Initializer, callback: ?OnCaretFn) Initializer { const Handler = CallbackHandler(Self, OnCaretFn, "CARET_CB"); Handler.setCallback(self.ref, callback); return self.*; } /// /// GETFOCUS_CB GETFOCUS_CB Action generated when an element is given keyboard focus. /// This callback is called after the KILLFOCUS_CB of the element that loosed /// the focus. /// The IupGetFocus function during the callback returns the element that /// loosed the focus. /// Callback int function(Ihandle *ih); [in C] ih:getfocus_cb() -> (ret: /// number) [in Lua] ih: identifier of the element that received keyboard focus. /// Affects All elements with user interaction, except menus. /// See Also KILLFOCUS_CB, IupGetFocus, IupSetFocus pub fn setGetFocusCallback(self: *Initializer, callback: ?OnGetFocusFn) Initializer { const Handler = CallbackHandler(Self, OnGetFocusFn, "GETFOCUS_CB"); Handler.setCallback(self.ref, callback); return self.*; } /// /// BUTTON_CB BUTTON_CB Action generated when a mouse button is pressed or released. /// Callback int function(Ihandle* ih, int button, int pressed, int x, int y, /// char* status); [in C] ih:button_cb(button, pressed, x, y: number, status: /// string) -> (ret: number) [in Lua] ih: identifies the element that activated /// the event. /// button: identifies the activated mouse button: IUP_BUTTON1 - left mouse /// button (button 1); IUP_BUTTON2 - middle mouse button (button 2); /// IUP_BUTTON3 - right mouse button (button 3). /// pressed: indicates the state of the button: 0 - mouse button was released; /// 1 - mouse button was pressed. /// x, y: position in the canvas where the event has occurred, in pixels. /// status: status of the mouse buttons and some keyboard keys at the moment /// the event is generated. /// The following macros must be used for verification: iup_isshift(status) /// iup_iscontrol(status) iup_isbutton1(status) iup_isbutton2(status) /// iup_isbutton3(status) iup_isbutton4(status) iup_isbutton5(status) /// iup_isdouble(status) iup_isalt(status) iup_issys(status) They return 1 if /// the respective key or button is pressed, and 0 otherwise. /// These macros are also available in Lua, returning a boolean. /// Returns: IUP_CLOSE will be processed. /// On some controls if IUP_IGNORE is returned the action is ignored (this is /// system dependent). /// Notes This callback can be used to customize a button behavior. /// For a standard button behavior use the ACTION callback of the IupButton. /// For a single click the callback is called twice, one for pressed=1 and one /// for pressed=0. /// Only after both calls the ACTION callback is called. /// In Windows, if a dialog is shown or popup in any situation there could be /// unpredictable results because the native system still has processing to be /// done even after the callback is called. /// A double click is preceded by two single clicks, one for pressed=1 and one /// for pressed=0, and followed by a press=0, all three without the double /// click flag set. /// In GTK, it is preceded by an additional two single clicks sequence. /// For example, for one double click all the following calls are made: /// BUTTON_CB(but=1 (1), x=154, y=83 [ 1 ]) BUTTON_CB(but=1 (0), x=154, y=83 [ /// 1 ]) BUTTON_CB(but=1 (1), x=154, y=83 [ 1 ]) (in GTK only) BUTTON_CB(but=1 /// (0), x=154, y=83 [ 1 ]) (in GTK only) BUTTON_CB(but=1 (1), x=154, y=83 [ 1 /// D ]) BUTTON_CB(but=1 (0), x=154, y=83 [ 1 ]) Between press and release all /// mouse events are redirected only to this control, even if the cursor moves /// outside the element. /// So the BUTTON_CB callback when released and the MOTION_CB callback can be /// called with coordinates outside the element rectangle. /// Affects IupCanvas, IupButton, IupText, IupList, IupGLCanvas pub fn setButtonCallback(self: *Initializer, callback: ?OnButtonFn) Initializer { const Handler = CallbackHandler(Self, OnButtonFn, "BUTTON_CB"); Handler.setCallback(self.ref, callback); return self.*; } /// /// VALUECHANGED_CB: Called after the value was interactively changed by the user. /// (since 3.0) int function(Ihandle *ih); [in C]ih:valuechanged_cb() -> (ret: /// number) [in Lua] pub fn setValueChangedCallback(self: *Initializer, callback: ?OnValueChangedFn) Initializer { const Handler = CallbackHandler(Self, OnValueChangedFn, "VALUECHANGED_CB"); Handler.setCallback(self.ref, callback); return self.*; } /// /// SPIN_CB: Action generated when a spin button is pressed. /// Valid only when SPIN=YES. /// When this callback is called the ACTION callback is not called. /// The VALUE attribute can be changed during this callback only if SPINAUTO=NO. /// (since 3.0) int function(Ihandle *ih, int pos); [in C]ih:spin_cb(pos: /// number) -> (ret: number) [in Lua] pub fn setSpinCallback(self: *Initializer, callback: ?OnSpinFn) Initializer { const Handler = CallbackHandler(Self, OnSpinFn, "SPIN_CB"); Handler.setCallback(self.ref, callback); return self.*; } pub fn setLDestroyCallback(self: *Initializer, callback: ?OnLDestroyFn) Initializer { const Handler = CallbackHandler(Self, OnLDestroyFn, "LDESTROY_CB"); Handler.setCallback(self.ref, callback); return self.*; } /// /// LEAVEWINDOW_CB LEAVEWINDOW_CB Action generated when the mouse leaves the /// native element. /// Callback int function(Ihandle *ih); [in C] ih:leavewindow_cb() -> (ret: /// number) [in Lua] ih: identifier of the element that activated the event. /// Notes When the cursor is moved from one element to another, the call order /// in all platforms will be first the LEAVEWINDOW_CB callback of the old /// control followed by the ENTERWINDOW_CB callback of the new control. /// (since 3.14) If the mouse button is hold pressed and the cursor moves /// outside the element the behavior is system dependent. /// In Windows the LEAVEWINDOW_CB/ENTERWINDOW_CB callbacks are NOT called, in /// GTK the callbacks are called. /// Affects All controls with user interaction. /// See Also ENTERWINDOW_CB pub fn setLeaveWindowCallback(self: *Initializer, callback: ?OnLeaveWindowFn) Initializer { const Handler = CallbackHandler(Self, OnLeaveWindowFn, "LEAVEWINDOW_CB"); Handler.setCallback(self.ref, callback); return self.*; } pub fn setPostMessageCallback(self: *Initializer, callback: ?OnPostMessageFn) Initializer { const Handler = CallbackHandler(Self, OnPostMessageFn, "POSTMESSAGE_CB"); Handler.setCallback(self.ref, callback); return self.*; } }; pub fn setStrAttribute(self: *Self, attribute: [:0]const u8, arg: [:0]const u8) void { interop.setStrAttribute(self, attribute, .{}, arg); } pub fn getStrAttribute(self: *Self, attribute: [:0]const u8) [:0]const u8 { return interop.getStrAttribute(self, attribute, .{}); } pub fn setIntAttribute(self: *Self, attribute: [:0]const u8, arg: i32) void { interop.setIntAttribute(self, attribute, .{}, arg); } pub fn getIntAttribute(self: *Self, attribute: [:0]const u8) i32 { return interop.getIntAttribute(self, attribute, .{}); } pub fn setBoolAttribute(self: *Self, attribute: [:0]const u8, arg: bool) void { interop.setBoolAttribute(self, attribute, .{}, arg); } pub fn getBoolAttribute(self: *Self, attribute: [:0]const u8) bool { return interop.getBoolAttribute(self, attribute, .{}); } pub fn getPtrAttribute(self: *Self, comptime T: type, attribute: [:0]const u8) ?*T { return interop.getPtrAttribute(T, self, attribute, .{}); } pub fn setPtrAttribute(self: *Self, comptime T: type, attribute: [:0]const u8, value: ?*T) void { interop.setPtrAttribute(T, self, attribute, .{}, value); } pub fn setHandle(self: *Self, arg: [:0]const u8) void { interop.setHandle(self, arg); } pub fn fromHandleName(handle_name: [:0]const u8) ?*Self { return interop.fromHandleName(Self, handle_name); } /// /// Creates an interface element given its class name and parameters. /// After creation the element still needs to be attached to a container and mapped to the native system so it can be visible. pub fn init() Initializer { var handle = interop.create(Self); if (handle) |valid| { return .{ .ref = @ptrCast(*Self, valid), }; } else { return .{ .ref = undefined, .last_error = Error.NotInitialized }; } } /// /// Displays a dialog in the current position, or changes a control VISIBLE attribute. /// For dialogs it is equivalent to call IupShowXY using IUP_CURRENT. See IupShowXY for more details. /// For other controls, to call IupShow is the same as setting VISIBLE=YES. pub fn show(self: *Self) !void { try interop.show(self); } /// /// Hides an interface element. This function has the same effect as attributing value "NO" to the interface element’s VISIBLE attribute. /// Once a dialog is hidden, either by means of IupHide or by changing the VISIBLE attribute or by means of a click in the window close button, the elements inside this dialog are not destroyed, so that you can show the dialog again. To destroy dialogs, the IupDestroy function must be called. pub fn hide(self: *Self) void { interop.hide(self); } /// /// Destroys an interface element and all its children. /// Only dialogs, timers, popup menus and images should be normally destroyed, but detached elements can also be destroyed. pub fn deinit(self: *Self) void { interop.destroy(self); } /// /// Creates (maps) the native interface objects corresponding to the given IUP interface elements. /// It will also called recursively to create the native element of all the children in the element's tree. /// The element must be already attached to a mapped container, except the dialog. A child can only be mapped if its parent is already mapped. /// This function is automatically called before the dialog is shown in IupShow, IupShowXY or IupPopup. /// If the element is a dialog then the abstract layout will be updated even if the dialog is already mapped. If the dialog is visible the elements will be immediately repositioned. Calling IupMap for an already mapped dialog is the same as only calling IupRefresh for the dialog. /// Calling IupMap for an already mapped element that is not a dialog does nothing. /// If you add new elements to an already mapped dialog you must call IupMap for that elements. And then call IupRefresh to update the dialog layout. /// If the WID attribute of an element is NULL, it means the element was not already mapped. Some containers do not have a native element associated, like VBOX and HBOX. In this case their WID is a fake value (void*)(-1). /// It is useful for the application to call IupMap when the value of the WID attribute must be known, i.e. the native element must exist, before a dialog is made visible. /// The MAP_CB callback is called at the end of the IupMap function, after all processing, so it can also be used to create other things that depend on the WID attribute. But notice that for non dialog elements it will be called before the dialog layout has been updated, so the element current size will still be 0x0 (since 3.14). pub fn map(self: *Self) !void { try interop.map(self); } /// /// pub fn getDialog(self: *Self) ?*iup.Dialog { return interop.getDialog(self); } /// /// Converts a (lin, col) character positioning into an absolute position. lin and col starts at 1, pos starts at 0. For single line controls pos is always "col - 1". (since 3.0) pub fn convertLinColToPos(self: *Self, lin: i32, col: i32) ?i32 { return Impl(Self).convertLinColToPos(self, lin, col); } /// /// pub fn convertPosToLinCol(self: *Self, pos: i32) ?iup.LinColPos { return Impl(Self).convertPosToLinCol(self, pos); } /// /// Returns the the child element that has the NAME attribute equals to the given value on the same dialog hierarchy. /// Works also for children of a menu that is associated with a dialog. pub fn getDialogChild(self: *Self, byName: [:0]const u8) ?Element { return interop.getDialogChild(self, byName); } /// /// Updates the size and layout of all controls in the same dialog. /// To be used after changing size attributes, or attributes that affect the size of the control. Can be used for any element inside a dialog, but the layout of the dialog and all controls will be updated. It can change the layout of all the controls inside the dialog because of the dynamic layout positioning. pub fn refresh(self: *Self) void { Impl(Self).refresh(self); } /// /// FGCOLOR: Text color. /// Default: the global attribute TXTFGCOLOR. pub fn getFgColor(self: *Self) ?iup.Rgb { return interop.getRgb(self, "FGCOLOR", .{}); } /// /// FGCOLOR: Text color. /// Default: the global attribute TXTFGCOLOR. pub fn setFgColor(self: *Self, rgb: iup.Rgb) void { interop.setRgb(self, "FGCOLOR", .{}, rgb); } /// /// COUNT (read-only): returns the number of characters in the text, including /// the line breaks. /// (since 3.5) pub fn getCount(self: *Self) i32 { return interop.getIntAttribute(self, "COUNT", .{}); } pub fn getHandleName(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "HANDLENAME", .{}); } pub fn setHandleName(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "HANDLENAME", .{}, arg); } pub fn getTipBgColor(self: *Self) ?iup.Rgb { return interop.getRgb(self, "TIPBGCOLOR", .{}); } pub fn setTipBgColor(self: *Self, rgb: iup.Rgb) void { interop.setRgb(self, "TIPBGCOLOR", .{}, rgb); } /// /// CARET (non inheritable): Character position of the insertion point. /// Its format depends in MULTILINE=YES. /// The first position, lin or col, is "1". pub fn getCaret(self: *Self) iup.LinColPos { var str = interop.getStrAttribute(self, "CARET", .{}); return iup.LinColPos.parse(str, ','); } /// /// CARET (non inheritable): Character position of the insertion point. /// Its format depends in MULTILINE=YES. /// The first position, lin or col, is "1". pub fn setCaret(self: *Self, lin: i32, col: i32) void { var buffer: [128]u8 = undefined; var value = iup.LinColPos.intIntToString(&buffer, lin, col, ','); interop.setStrAttribute(self, "CARET", .{}, value); } pub fn getMaskDecimalSymbol(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "MASKDECIMALSYMBOL", .{}); } pub fn setMaskDecimalSymbol(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "MASKDECIMALSYMBOL", .{}, arg); } pub fn getTipIcon(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "TIPICON", .{}); } pub fn setTipIcon(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "TIPICON", .{}, arg); } /// /// OVERWRITE [Windows and GTK Only] (non inheritable): turns the overwrite /// mode ON or OFF. /// Works only when FORMATTING=YES. /// (since 3.0) pub fn getOverwrite(self: *Self) bool { return interop.getBoolAttribute(self, "OVERWRITE", .{}); } /// /// OVERWRITE [Windows and GTK Only] (non inheritable): turns the overwrite /// mode ON or OFF. /// Works only when FORMATTING=YES. /// (since 3.0) pub fn setOverwrite(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "OVERWRITE", .{}, arg); } pub fn getAddFormatTagHandle(self: *Self) ?*iup.User { if (interop.getHandleAttribute(self, "ADDFORMATTAG_HANDLE", .{})) |handle| { return @ptrCast(*iup.User, handle); } else { return null; } } pub fn setAddFormatTagHandle(self: *Self, arg: *iup.User) void { interop.setHandleAttribute(self, "ADDFORMATTAG_HANDLE", .{}, arg); } pub fn setAddFormatTagHandleHandleName(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "ADDFORMATTAG_HANDLE", .{}, arg); } pub fn getSpinInc(self: *Self) i32 { return interop.getIntAttribute(self, "SPININC", .{}); } pub fn setSpinInc(self: *Self, arg: i32) void { interop.setIntAttribute(self, "SPININC", .{}, arg); } pub fn getMaxSize(self: *Self) Size { var str = interop.getStrAttribute(self, "MAXSIZE", .{}); return Size.parse(str); } pub fn setMaxSize(self: *Self, width: ?i32, height: ?i32) void { var buffer: [128]u8 = undefined; var value = Size.intIntToString(&buffer, width, height); interop.setStrAttribute(self, "MAXSIZE", .{}, value); } pub fn getScreenPosition(self: *Self) iup.XYPos { var str = interop.getStrAttribute(self, "SCREENPOSITION", .{}); return iup.XYPos.parse(str, ','); } pub fn getPosition(self: *Self) iup.XYPos { var str = interop.getStrAttribute(self, "POSITION", .{}); return iup.XYPos.parse(str, ','); } pub fn setPosition(self: *Self, x: i32, y: i32) void { var buffer: [128]u8 = undefined; var value = iup.XYPos.intIntToString(&buffer, x, y, ','); interop.setStrAttribute(self, "POSITION", .{}, value); } pub fn getAppendNewLine(self: *Self) bool { return interop.getBoolAttribute(self, "APPENDNEWLINE", .{}); } pub fn setAppendNewLine(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "APPENDNEWLINE", .{}, arg); } /// /// DROPFILESTARGET [Windows and GTK Only] (non inheritable): Enable or disable /// the drop of files. /// Default: NO, but if DROPFILES_CB is defined when the element is mapped then /// it will be automatically enabled. /// (since 3.0) pub fn getDropFilesTarget(self: *Self) bool { return interop.getBoolAttribute(self, "DROPFILESTARGET", .{}); } /// /// DROPFILESTARGET [Windows and GTK Only] (non inheritable): Enable or disable /// the drop of files. /// Default: NO, but if DROPFILES_CB is defined when the element is mapped then /// it will be automatically enabled. /// (since 3.0) pub fn setDropFilesTarget(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "DROPFILESTARGET", .{}, arg); } pub fn getTip(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "TIP", .{}); } pub fn setTip(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "TIP", .{}, arg); } pub fn getDragSourceMove(self: *Self) bool { return interop.getBoolAttribute(self, "DRAGSOURCEMOVE", .{}); } pub fn setDragSourceMove(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "DRAGSOURCEMOVE", .{}, arg); } pub fn getAddFormatTag(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "ADDFORMATTAG", .{}); } pub fn setAddFormatTag(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "ADDFORMATTAG", .{}, arg); } pub fn getVisible(self: *Self) bool { return interop.getBoolAttribute(self, "VISIBLE", .{}); } pub fn setVisible(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "VISIBLE", .{}, arg); } /// /// NC: Maximum number of characters allowed for keyboard input, larger text /// can still be set using attributes. /// The maximum value is the limit of the VALUE attribute. /// The "0" value is the same as maximum. /// Default: maximum. pub fn getNc(self: *Self) i32 { return interop.getIntAttribute(self, "NC", .{}); } /// /// NC: Maximum number of characters allowed for keyboard input, larger text /// can still be set using attributes. /// The maximum value is the limit of the VALUE attribute. /// The "0" value is the same as maximum. /// Default: maximum. pub fn setNc(self: *Self, arg: i32) void { interop.setIntAttribute(self, "NC", .{}, arg); } pub fn zOrder(self: *Self, arg: ?ZOrder) void { if (arg) |value| switch (value) { .Top => interop.setStrAttribute(self, "ZORDER", .{}, "TOP"), .Bottom => interop.setStrAttribute(self, "ZORDER", .{}, "BOTTOM"), } else { interop.clearAttribute(self, "ZORDER", .{}); } } pub fn getX(self: *Self) i32 { return interop.getIntAttribute(self, "X", .{}); } pub fn getY(self: *Self) i32 { return interop.getIntAttribute(self, "Y", .{}); } pub fn getDragDrop(self: *Self) bool { return interop.getBoolAttribute(self, "DRAGDROP", .{}); } pub fn setDragDrop(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "DRAGDROP", .{}, arg); } pub fn getTheme(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "THEME", .{}); } pub fn setTheme(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "THEME", .{}, arg); } pub fn getMaskReal(self: *Self) ?MaskReal { var ret = interop.getStrAttribute(self, "MASKREAL", .{}); if (std.ascii.eqlIgnoreCase("SIGNED", ret)) return .Signed; if (std.ascii.eqlIgnoreCase("UNSIGNED", ret)) return .Unsigned; return null; } pub fn setMaskReal(self: *Self, arg: ?MaskReal) void { if (arg) |value| switch (value) { .Signed => interop.setStrAttribute(self, "MASKREAL", .{}, "SIGNED"), .Unsigned => interop.setStrAttribute(self, "MASKREAL", .{}, "UNSIGNED"), } else { interop.clearAttribute(self, "MASKREAL", .{}); } } /// /// LINEVALUE (read-only): returns the text of the line where the caret is. /// It does not include the "\n" character. /// When MULTILINE=NO returns the same as VALUE. /// (since 3.5) pub fn getLineValue(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "LINEVALUE", .{}); } pub fn getExpand(self: *Self) ?Expand { var ret = interop.getStrAttribute(self, "EXPAND", .{}); if (std.ascii.eqlIgnoreCase("YES", ret)) return .Yes; if (std.ascii.eqlIgnoreCase("HORIZONTAL", ret)) return .Horizontal; if (std.ascii.eqlIgnoreCase("VERTICAL", ret)) return .Vertical; if (std.ascii.eqlIgnoreCase("HORIZONTALFREE", ret)) return .HorizontalFree; if (std.ascii.eqlIgnoreCase("VERTICALFREE", ret)) return .VerticalFree; if (std.ascii.eqlIgnoreCase("NO", ret)) return .No; return null; } pub fn setExpand(self: *Self, arg: ?Expand) void { if (arg) |value| switch (value) { .Yes => interop.setStrAttribute(self, "EXPAND", .{}, "YES"), .Horizontal => interop.setStrAttribute(self, "EXPAND", .{}, "HORIZONTAL"), .Vertical => interop.setStrAttribute(self, "EXPAND", .{}, "VERTICAL"), .HorizontalFree => interop.setStrAttribute(self, "EXPAND", .{}, "HORIZONTALFREE"), .VerticalFree => interop.setStrAttribute(self, "EXPAND", .{}, "VERTICALFREE"), .No => interop.setStrAttribute(self, "EXPAND", .{}, "NO"), } else { interop.clearAttribute(self, "EXPAND", .{}); } } /// /// VISIBLELINES: When MULTILINE=YES defines the number of visible lines for /// the Natural Size, this means that will act also as minimum number of /// visible lines. /// As for SIZE you can set to NULL after map to use it as an initial value. /// Default: 1 (since 3.0) pub fn getVisibleLines(self: *Self) i32 { return interop.getIntAttribute(self, "VISIBLELINES", .{}); } /// /// VISIBLELINES: When MULTILINE=YES defines the number of visible lines for /// the Natural Size, this means that will act also as minimum number of /// visible lines. /// As for SIZE you can set to NULL after map to use it as an initial value. /// Default: 1 (since 3.0) pub fn setVisibleLines(self: *Self, arg: i32) void { interop.setIntAttribute(self, "VISIBLELINES", .{}, arg); } /// /// SIZE (non inheritable): Since the contents can be changed by the user, the /// Natural Size is not affected by the text contents (since 3.0). /// Use VISIBLECOLUMNS and VISIBLELINES to control the Natural Size. pub fn getSize(self: *Self) Size { var str = interop.getStrAttribute(self, "SIZE", .{}); return Size.parse(str); } /// /// SIZE (non inheritable): Since the contents can be changed by the user, the /// Natural Size is not affected by the text contents (since 3.0). /// Use VISIBLECOLUMNS and VISIBLELINES to control the Natural Size. pub fn setSize(self: *Self, width: ?i32, height: ?i32) void { var buffer: [128]u8 = undefined; var value = Size.intIntToString(&buffer, width, height); interop.setStrAttribute(self, "SIZE", .{}, value); } /// /// PADDING: internal margin. /// Works just like the MARGIN attribute of the IupHbox and IupVbox containers, /// but uses a different name to avoid inheritance problems. /// Default value: "0x0". /// In Windows, only the horizontal value is used. /// (since 3.0) (GTK 2.10 for single line) pub fn getPadding(self: *Self) Size { var str = interop.getStrAttribute(self, "PADDING", .{}); return Size.parse(str); } /// /// PADDING: internal margin. /// Works just like the MARGIN attribute of the IupHbox and IupVbox containers, /// but uses a different name to avoid inheritance problems. /// Default value: "0x0". /// In Windows, only the horizontal value is used. /// (since 3.0) (GTK 2.10 for single line) pub fn setPadding(self: *Self, width: ?i32, height: ?i32) void { var buffer: [128]u8 = undefined; var value = Size.intIntToString(&buffer, width, height); interop.setStrAttribute(self, "PADDING", .{}, value); } pub fn getSpinMin(self: *Self) i32 { return interop.getIntAttribute(self, "SPINMIN", .{}); } pub fn setSpinMin(self: *Self, arg: i32) void { interop.setIntAttribute(self, "SPINMIN", .{}, arg); } pub fn getWId(self: *Self) i32 { return interop.getIntAttribute(self, "WID", .{}); } pub fn getTipMarkup(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "TIPMARKUP", .{}); } pub fn setTipMarkup(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "TIPMARKUP", .{}, arg); } pub fn getFontSize(self: *Self) i32 { return interop.getIntAttribute(self, "FONTSIZE", .{}); } pub fn setFontSize(self: *Self, arg: i32) void { interop.setIntAttribute(self, "FONTSIZE", .{}, arg); } pub fn getNaturalSize(self: *Self) Size { var str = interop.getStrAttribute(self, "NATURALSIZE", .{}); return Size.parse(str); } pub fn getDropTypes(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "DROPTYPES", .{}); } pub fn setDropTypes(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "DROPTYPES", .{}, arg); } pub fn getUserSize(self: *Self) Size { var str = interop.getStrAttribute(self, "USERSIZE", .{}); return Size.parse(str); } pub fn setUserSize(self: *Self, width: ?i32, height: ?i32) void { var buffer: [128]u8 = undefined; var value = Size.intIntToString(&buffer, width, height); interop.setStrAttribute(self, "USERSIZE", .{}, value); } pub fn getTipDelay(self: *Self) i32 { return interop.getIntAttribute(self, "TIPDELAY", .{}); } pub fn setTipDelay(self: *Self, arg: i32) void { interop.setIntAttribute(self, "TIPDELAY", .{}, arg); } /// /// TABSIZE [Windows and GTK Only]: Valid only when MULTILINE=YES. /// Controls the number of characters for a tab stop. /// Default: 8. pub fn getTabsIZe(self: *Self) i32 { return interop.getIntAttribute(self, "TABSIZE", .{}); } /// /// TABSIZE [Windows and GTK Only]: Valid only when MULTILINE=YES. /// Controls the number of characters for a tab stop. /// Default: 8. pub fn setTabsIZe(self: *Self, arg: i32) void { interop.setIntAttribute(self, "TABSIZE", .{}, arg); } /// /// PROPAGATEFOCUS(non inheritable): enables the focus callback forwarding to /// the next native parent with FOCUS_CB defined. /// Default: NO. /// (since 3.23) pub fn getPropagateFocus(self: *Self) bool { return interop.getBoolAttribute(self, "PROPAGATEFOCUS", .{}); } /// /// PROPAGATEFOCUS(non inheritable): enables the focus callback forwarding to /// the next native parent with FOCUS_CB defined. /// Default: NO. /// (since 3.23) pub fn setPropagateFocus(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "PROPAGATEFOCUS", .{}, arg); } /// /// BGCOLOR: Background color of the text. /// Default: the global attribute TXTBGCOLOR. /// Ignored in GTK when MULTILINE=NO. pub fn getBgColor(self: *Self) ?iup.Rgb { return interop.getRgb(self, "BGCOLOR", .{}); } /// /// BGCOLOR: Background color of the text. /// Default: the global attribute TXTBGCOLOR. /// Ignored in GTK when MULTILINE=NO. pub fn setBgColor(self: *Self, rgb: iup.Rgb) void { interop.setRgb(self, "BGCOLOR", .{}, rgb); } pub fn getDropTarget(self: *Self) bool { return interop.getBoolAttribute(self, "DROPTARGET", .{}); } pub fn setDropTarget(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "DROPTARGET", .{}, arg); } /// /// VALUEMASKED (non inheritable) (write-only): sets VALUE but first checks if /// it is validated by MASK. /// If not does nothing. /// (since 3.4) pub fn valueMasked(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "VALUEMASKED", .{}, arg); } pub fn getDragSource(self: *Self) bool { return interop.getBoolAttribute(self, "DRAGSOURCE", .{}); } pub fn setDragSource(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "DRAGSOURCE", .{}, arg); } pub fn getFloating(self: *Self) ?Floating { var ret = interop.getStrAttribute(self, "FLOATING", .{}); if (std.ascii.eqlIgnoreCase("YES", ret)) return .Yes; if (std.ascii.eqlIgnoreCase("IGNORE", ret)) return .Ignore; if (std.ascii.eqlIgnoreCase("NO", ret)) return .No; return null; } pub fn setFloating(self: *Self, arg: ?Floating) void { if (arg) |value| switch (value) { .Yes => interop.setStrAttribute(self, "FLOATING", .{}, "YES"), .Ignore => interop.setStrAttribute(self, "FLOATING", .{}, "IGNORE"), .No => interop.setStrAttribute(self, "FLOATING", .{}, "NO"), } else { interop.clearAttribute(self, "FLOATING", .{}); } } pub fn getNormalizerGroup(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "NORMALIZERGROUP", .{}); } pub fn setNormalizerGroup(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "NORMALIZERGROUP", .{}, arg); } pub fn getRasterSize(self: *Self) Size { var str = interop.getStrAttribute(self, "RASTERSIZE", .{}); return Size.parse(str); } pub fn setRasterSize(self: *Self, width: ?i32, height: ?i32) void { var buffer: [128]u8 = undefined; var value = Size.intIntToString(&buffer, width, height); interop.setStrAttribute(self, "RASTERSIZE", .{}, value); } /// /// SCROLLTOPOS (non inheritable, write only): Scroll the text to make the /// given character position visible. /// It uses the same format and reference of the CARETPOS attribute ("pos" /// starting at 0). /// (since 3.0) pub fn scrollTopOs(self: *Self, arg: i32) void { interop.setIntAttribute(self, "SCROLLTOPOS", .{}, arg); } /// /// FORMATTING [Windows and GTK Only] (non inheritable): When enabled allow the /// use of text formatting attributes. /// In GTK is always enabled, but only when MULTILINE=YES. /// Default: NO. /// (since 3.0) pub fn getFormatting(self: *Self) bool { return interop.getBoolAttribute(self, "FORMATTING", .{}); } /// /// FORMATTING [Windows and GTK Only] (non inheritable): When enabled allow the /// use of text formatting attributes. /// In GTK is always enabled, but only when MULTILINE=YES. /// Default: NO. /// (since 3.0) pub fn setFormatting(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "FORMATTING", .{}, arg); } /// /// SCROLLTO (non inheritable, write only): Scroll the text to make the given /// character position visible. /// It uses the same format and reference of the CARET attribute ("lin:col" or /// "col" starting at 1). /// In Windows, when FORMATTING=Yes "col" is ignored. /// (since 3.0) pub fn scrollTo(self: *Self, arg: i32) void { interop.setIntAttribute(self, "SCROLLTO", .{}, arg); } pub fn getTipFgColor(self: *Self) ?iup.Rgb { return interop.getRgb(self, "TIPFGCOLOR", .{}); } pub fn setTipFgColor(self: *Self, rgb: iup.Rgb) void { interop.setRgb(self, "TIPFGCOLOR", .{}, rgb); } /// /// LINECOUNT (read-only): returns the number of lines in the text. /// When MULTILINE=NO returns always "1". /// (since 3.5) pub fn getLineCount(self: *Self) i32 { return interop.getIntAttribute(self, "LINECOUNT", .{}); } pub fn getSpinWrap(self: *Self) bool { return interop.getBoolAttribute(self, "SPINWRAP", .{}); } pub fn setSpinWrap(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "SPINWRAP", .{}, arg); } pub fn getFontFace(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "FONTFACE", .{}); } pub fn setFontFace(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "FONTFACE", .{}, arg); } /// /// VISIBLECOLUMNS: Defines the number of visible columns for the Natural Size, /// this means that will act also as minimum number of visible columns. /// It uses a wider character size than the one used for the SIZE attribute so /// strings will fit better without the need of extra columns. /// As for SIZE you can set to NULL after map to use it as an initial value. /// Default: 5 (since 3.0) pub fn getVisibleColumns(self: *Self) i32 { return interop.getIntAttribute(self, "VISIBLECOLUMNS", .{}); } /// /// VISIBLECOLUMNS: Defines the number of visible columns for the Natural Size, /// this means that will act also as minimum number of visible columns. /// It uses a wider character size than the one used for the SIZE attribute so /// strings will fit better without the need of extra columns. /// As for SIZE you can set to NULL after map to use it as an initial value. /// Default: 5 (since 3.0) pub fn setVisibleColumns(self: *Self, arg: i32) void { interop.setIntAttribute(self, "VISIBLECOLUMNS", .{}, arg); } pub fn getMaskInt(self: *Self) iup.Range { var str = interop.getStrAttribute(self, "MASKINT", .{}); return iup.Range.parse(str, ','); } pub fn setMaskInt(self: *Self, begin: i32, end: i32) void { var buffer: [128]u8 = undefined; var value = iup.Range.intIntToString(&buffer, begin, end, ','); interop.setStrAttribute(self, "MASKINT", .{}, value); } pub fn getSpinAlign(self: *Self) ?SpinAlign { var ret = interop.getStrAttribute(self, "SPINALIGN", .{}); if (std.ascii.eqlIgnoreCase("LEFT", ret)) return .Left; if (std.ascii.eqlIgnoreCase("RIGHT", ret)) return .Right; return null; } pub fn setSpinAlign(self: *Self, arg: ?SpinAlign) void { if (arg) |value| switch (value) { .Left => interop.setStrAttribute(self, "SPINALIGN", .{}, "LEFT"), .Right => interop.setStrAttribute(self, "SPINALIGN", .{}, "RIGHT"), } else { interop.clearAttribute(self, "SPINALIGN", .{}); } } pub fn getName(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "NAME", .{}); } pub fn setName(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "NAME", .{}, arg); } pub fn getMaskCasei(self: *Self) bool { return interop.getBoolAttribute(self, "MASKCASEI", .{}); } pub fn setMaskCasei(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "MASKCASEI", .{}, arg); } /// /// SELECTIONPOS (non inheritable): Same as SELECTION but using a zero based /// character index "pos1:pos2". /// Useful for indexing the VALUE string. /// The values ALL and NONE are also accepted. /// See the Notes below if using UTF-8 strings in GTK. /// (since 3.0) pub fn getSelectionPos(self: *Self) iup.Range { var str = interop.getStrAttribute(self, "SELECTIONPOS", .{}); return iup.Range.parse(str, ','); } /// /// SELECTIONPOS (non inheritable): Same as SELECTION but using a zero based /// character index "pos1:pos2". /// Useful for indexing the VALUE string. /// The values ALL and NONE are also accepted. /// See the Notes below if using UTF-8 strings in GTK. /// (since 3.0) pub fn setSelectionPos(self: *Self, begin: i32, end: i32) void { var buffer: [128]u8 = undefined; var value = iup.Range.intIntToString(&buffer, begin, end, ','); interop.setStrAttribute(self, "SELECTIONPOS", .{}, value); } /// /// VALUE (non inheritable): Text entered by the user. /// The '\n' character indicates a new line, valid only when MULTILINE=YES. /// After the element is mapped and if there is no text will return the empty /// string "". pub fn getValue(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "VALUE", .{}); } /// /// VALUE (non inheritable): Text entered by the user. /// The '\n' character indicates a new line, valid only when MULTILINE=YES. /// After the element is mapped and if there is no text will return the empty /// string "". pub fn setValue(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "VALUE", .{}, arg); } /// /// FILTER [Windows Only] (non inheritable): allows a custom filter to process /// the characters: Can be LOWERCASE, UPPERCASE or NUMBER (only numbers allowed). /// (since 3.0) pub fn getFilter(self: *Self) ?Filter { var ret = interop.getStrAttribute(self, "FILTER", .{}); if (std.ascii.eqlIgnoreCase("LOWERCASE", ret)) return .LowerCase; if (std.ascii.eqlIgnoreCase("NUMBER", ret)) return .Number; if (std.ascii.eqlIgnoreCase("UPPERCASE", ret)) return .UpperCase; return null; } /// /// FILTER [Windows Only] (non inheritable): allows a custom filter to process /// the characters: Can be LOWERCASE, UPPERCASE or NUMBER (only numbers allowed). /// (since 3.0) pub fn setFilter(self: *Self, arg: ?Filter) void { if (arg) |value| switch (value) { .LowerCase => interop.setStrAttribute(self, "FILTER", .{}, "LOWERCASE"), .Number => interop.setStrAttribute(self, "FILTER", .{}, "NUMBER"), .UpperCase => interop.setStrAttribute(self, "FILTER", .{}, "UPPERCASE"), } else { interop.clearAttribute(self, "FILTER", .{}); } } pub fn getSpinMax(self: *Self) i32 { return interop.getIntAttribute(self, "SPINMAX", .{}); } pub fn setSpinMax(self: *Self, arg: i32) void { interop.setIntAttribute(self, "SPINMAX", .{}, arg); } /// /// MULTILINE (creation only) (non inheritable): allows the edition of multiple lines. /// In single line mode some characters are invalid, like "\t", "\r" and "\n". /// Default: NO. /// When set to Yes will also reset the SCROLLBAR attribute to Yes. /// The values ALL and NONE are also accepted independently of MULTILINE (since 3.0). pub fn getMultiline(self: *Self) bool { return interop.getBoolAttribute(self, "MULTILINE", .{}); } /// /// MULTILINE (creation only) (non inheritable): allows the edition of multiple lines. /// In single line mode some characters are invalid, like "\t", "\r" and "\n". /// Default: NO. /// When set to Yes will also reset the SCROLLBAR attribute to Yes. /// The values ALL and NONE are also accepted independently of MULTILINE (since 3.0). pub fn setMultiline(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "MULTILINE", .{}, arg); } /// /// SELECTEDTEXT (non inheritable): Selection text. /// Returns NULL if there is no selection. /// When changed replaces the current selection. /// Similar to INSERT, but does nothing if there is no selection. pub fn getSelectedText(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "SELECTEDTEXT", .{}); } /// /// SELECTEDTEXT (non inheritable): Selection text. /// Returns NULL if there is no selection. /// When changed replaces the current selection. /// Similar to INSERT, but does nothing if there is no selection. pub fn setSelectedText(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "SELECTEDTEXT", .{}, arg); } /// /// CPADDING: same as PADDING but using the units of the SIZE attribute. /// It will actually set the PADDING attribute. /// (since 3.29) pub fn getCPadding(self: *Self) Size { var str = interop.getStrAttribute(self, "CPADDING", .{}); return Size.parse(str); } /// /// CPADDING: same as PADDING but using the units of the SIZE attribute. /// It will actually set the PADDING attribute. /// (since 3.29) pub fn setCPadding(self: *Self, width: ?i32, height: ?i32) void { var buffer: [128]u8 = undefined; var value = Size.intIntToString(&buffer, width, height); interop.setStrAttribute(self, "CPADDING", .{}, value); } /// /// ACTIVE, FONT, EXPAND, SCREENPOSITION, POSITION, MINSIZE, MAXSIZE, WID, TIP, /// RASTERSIZE, ZORDER, VISIBLE, THEME: also accepted. pub fn getActive(self: *Self) bool { return interop.getBoolAttribute(self, "ACTIVE", .{}); } /// /// ACTIVE, FONT, EXPAND, SCREENPOSITION, POSITION, MINSIZE, MAXSIZE, WID, TIP, /// RASTERSIZE, ZORDER, VISIBLE, THEME: also accepted. pub fn setActive(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "ACTIVE", .{}, arg); } pub fn getTipVisible(self: *Self) bool { return interop.getBoolAttribute(self, "TIPVISIBLE", .{}); } pub fn setTipVisible(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "TIPVISIBLE", .{}, arg); } /// /// CHANGECASE (non inheritable): Change case according to given conversion. /// Can be UPPER, LOWER, TOGGLE, or TITLE. /// TITLE case change first letter of words separated by spaces to upper case /// others to lower case, but first letter is changed only if word has more /// than 3 characters, for instance: "Best of the World". /// Supports Latin-1 encoding only, even when using UTF-8. /// Does not depends on current locale. /// (since 3.28) pub fn changeCase(self: *Self, arg: ?ChangeCase) void { if (arg) |value| switch (value) { .Upper => interop.setStrAttribute(self, "CHANGECASE", .{}, "UPPER"), .Lower => interop.setStrAttribute(self, "CHANGECASE", .{}, "LOWER"), .Toggle => interop.setStrAttribute(self, "CHANGECASE", .{}, "TOGGLE"), .Title => interop.setStrAttribute(self, "CHANGECASE", .{}, "TITLE"), } else { interop.clearAttribute(self, "CHANGECASE", .{}); } } /// /// CUEBANNER [Windows and GTK Only] (non inheritable): a text that is /// displayed when there is no text at the control. /// It works as a textual cue, or tip to prompt the user for input. /// Valid only for MULTILINE=NO, and works only when Visual Styles are enabled. /// (since 3.0) [GTK 3.2] (GTK support added in IUP 3.20) pub fn getCueBanner(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "CUEBANNER", .{}); } /// /// CUEBANNER [Windows and GTK Only] (non inheritable): a text that is /// displayed when there is no text at the control. /// It works as a textual cue, or tip to prompt the user for input. /// Valid only for MULTILINE=NO, and works only when Visual Styles are enabled. /// (since 3.0) [GTK 3.2] (GTK support added in IUP 3.20) pub fn setCueBanner(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "CUEBANNER", .{}, arg); } pub fn getExpandWeight(self: *Self) f64 { return interop.getDoubleAttribute(self, "EXPANDWEIGHT", .{}); } pub fn setExpandWeight(self: *Self, arg: f64) void { interop.setDoubleAttribute(self, "EXPANDWEIGHT", .{}, arg); } pub fn getMinSize(self: *Self) Size { var str = interop.getStrAttribute(self, "MINSIZE", .{}); return Size.parse(str); } pub fn setMinSize(self: *Self, width: ?i32, height: ?i32) void { var buffer: [128]u8 = undefined; var value = Size.intIntToString(&buffer, width, height); interop.setStrAttribute(self, "MINSIZE", .{}, value); } pub fn getNTheme(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "NTHEME", .{}); } pub fn setNTheme(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "NTHEME", .{}, arg); } pub fn getCharSize(self: *Self) Size { var str = interop.getStrAttribute(self, "CHARSIZE", .{}); return Size.parse(str); } /// /// CARETPOS (non inheritable): Also the character position of the insertion /// point, but using a zero based character unique index "pos". /// Useful for indexing the VALUE string. /// See the Notes below if using UTF-8 strings in GTK. /// (since 3.0) pub fn getCaretPos(self: *Self) i32 { return interop.getIntAttribute(self, "CARETPOS", .{}); } /// /// CARETPOS (non inheritable): Also the character position of the insertion /// point, but using a zero based character unique index "pos". /// Useful for indexing the VALUE string. /// See the Notes below if using UTF-8 strings in GTK. /// (since 3.0) pub fn setCaretPos(self: *Self, arg: i32) void { interop.setIntAttribute(self, "CARETPOS", .{}, arg); } pub fn getSpinAuto(self: *Self) bool { return interop.getBoolAttribute(self, "SPINAUTO", .{}); } pub fn setSpinAuto(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "SPINAUTO", .{}, arg); } /// /// MASK (non inheritable): Defines a mask that will filter interactive text input. pub fn getMask(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "MASK", .{}); } /// /// MASK (non inheritable): Defines a mask that will filter interactive text input. pub fn setMask(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "MASK", .{}, arg); } pub fn getDragTypes(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "DRAGTYPES", .{}); } pub fn setDragTypes(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "DRAGTYPES", .{}, arg); } pub fn getAutoHide(self: *Self) bool { return interop.getBoolAttribute(self, "AUTOHIDE", .{}); } pub fn setAutoHide(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "AUTOHIDE", .{}, arg); } pub fn getFontStyle(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "FONTSTYLE", .{}); } pub fn setFontStyle(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "FONTSTYLE", .{}, arg); } /// /// CLIPBOARD (write-only): clear, cut, copy or paste the selection to or from /// the clipboard. /// Values: "CLEAR", "CUT", "COPY" or "PASTE". /// In Windows UNDO is also available, and REDO is available when FORMATTING=YES. /// (since 3.0) pub fn getClipboard(self: *Self) ?Clipboard { var ret = interop.getStrAttribute(self, "CLIPBOARD", .{}); if (std.ascii.eqlIgnoreCase("COPY", ret)) return .Copy; if (std.ascii.eqlIgnoreCase("CUT", ret)) return .Cut; if (std.ascii.eqlIgnoreCase("PASTE", ret)) return .Paste; if (std.ascii.eqlIgnoreCase("CLEAR", ret)) return .Clear; if (std.ascii.eqlIgnoreCase("UNDO", ret)) return .Undo; if (std.ascii.eqlIgnoreCase("REDO", ret)) return .Redo; return null; } /// /// CLIPBOARD (write-only): clear, cut, copy or paste the selection to or from /// the clipboard. /// Values: "CLEAR", "CUT", "COPY" or "PASTE". /// In Windows UNDO is also available, and REDO is available when FORMATTING=YES. /// (since 3.0) pub fn setClipboard(self: *Self, arg: ?Clipboard) void { if (arg) |value| switch (value) { .Copy => interop.setStrAttribute(self, "CLIPBOARD", .{}, "COPY"), .Cut => interop.setStrAttribute(self, "CLIPBOARD", .{}, "CUT"), .Paste => interop.setStrAttribute(self, "CLIPBOARD", .{}, "PASTE"), .Clear => interop.setStrAttribute(self, "CLIPBOARD", .{}, "CLEAR"), .Undo => interop.setStrAttribute(self, "CLIPBOARD", .{}, "UNDO"), .Redo => interop.setStrAttribute(self, "CLIPBOARD", .{}, "REDO"), } else { interop.clearAttribute(self, "CLIPBOARD", .{}); } } pub fn removeFormatting(self: *Self, arg: ?RemoveFormatting) void { if (arg) |value| switch (value) { .All => interop.setStrAttribute(self, "REMOVEFORMATTING", .{}, "ALL"), .Selection => interop.setStrAttribute(self, "REMOVEFORMATTING", .{}, "SELECTION"), } else { interop.clearAttribute(self, "REMOVEFORMATTING", .{}); } } /// /// READONLY: Allows the user only to read the contents, without changing it. /// Restricts keyboard input only, text value can still be changed using attributes. /// Navigation keys are still available. /// Possible values: "YES", "NO". /// Default: NO. pub fn getReadonly(self: *Self) bool { return interop.getBoolAttribute(self, "READONLY", .{}); } /// /// READONLY: Allows the user only to read the contents, without changing it. /// Restricts keyboard input only, text value can still be changed using attributes. /// Navigation keys are still available. /// Possible values: "YES", "NO". /// Default: NO. pub fn setReadonly(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "READONLY", .{}, arg); } /// /// APPEND (write-only): Inserts a text at the end of the current text. /// In the Multiline, if APPENDNEWLINE=YES, a "\n" character will be /// automatically inserted before the appended text if the current text is not /// empty(APPENDNEWLINE default is YES). /// Ignored if set before map. pub fn append(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "APPEND", .{}, arg); } pub fn getMaskNoEmpty(self: *Self) bool { return interop.getBoolAttribute(self, "MASKNOEMPTY", .{}); } pub fn setMaskNoEmpty(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "MASKNOEMPTY", .{}, arg); } pub fn getFont(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "FONT", .{}); } pub fn setFont(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "FONT", .{}, arg); } /// /// TABIMAGEn (non inheritable): image name to be used in the respective tab. /// Use IupSetHandle or IupSetAttributeHandle to associate an image to a name. /// n starts at 0. /// See also IupImage. /// In Motif, the image is shown only if TABTITLEn is NULL. /// In Windows and Motif set the BGCOLOR attribute before setting the image. /// When set after map will update the TABIMAGE attribute on the respective /// child (since 3.10). /// (since 3.0). /// TABIMAGE (non inheritable) (at children only): Same as TABIMAGEn but set in /// each child. /// Works only if set before the child is added to the tabs. pub fn getTabImage(self: *Self, index: i32) ?iup.Element { if (interop.getHandleAttribute(self, "TABIMAGE", .{index})) |handle| { return iup.Element.fromHandle(handle); } else { return null; } } /// /// TABIMAGEn (non inheritable): image name to be used in the respective tab. /// Use IupSetHandle or IupSetAttributeHandle to associate an image to a name. /// n starts at 0. /// See also IupImage. /// In Motif, the image is shown only if TABTITLEn is NULL. /// In Windows and Motif set the BGCOLOR attribute before setting the image. /// When set after map will update the TABIMAGE attribute on the respective /// child (since 3.10). /// (since 3.0). /// TABIMAGE (non inheritable) (at children only): Same as TABIMAGEn but set in /// each child. /// Works only if set before the child is added to the tabs. pub fn setTabImage(self: *Self, index: i32, arg: anytype) !void { try interop.validateHandle(.Image, arg); interop.setHandleAttribute(self, "TABIMAGE", .{index}, arg); } pub fn setTabImageHandleName(self: *Self, index: i32, arg: [:0]const u8) void { interop.setStrAttribute(self, "TABIMAGE", .{index}, arg); } /// /// TABTITLEn (non inheritable): Contains the text to be shown in the /// respective tab title. /// n starts at 0. /// If this value is NULL, it will remain empty. /// The "&" character can be used to define a mnemonic, the next character will /// be used as key. /// Use "&&" to show the "&" character instead on defining a mnemonic. /// The button can be activated from any control in the dialog using the /// "Alt+key" combination. /// (mnemonic support since 3.3). /// When set after map will update the TABTITLE attribute on the respective /// child (since 3.10). /// (since 3.0). /// TABTITLE (non inheritable) (at children only): Same as TABTITLEn but set in /// each child. /// Works only if set before the child is added to the tabs. pub fn getTabTitle(self: *Self, index: i32) [:0]const u8 { return interop.getStrAttribute(self, "TABTITLE", .{index}); } /// /// TABTITLEn (non inheritable): Contains the text to be shown in the /// respective tab title. /// n starts at 0. /// If this value is NULL, it will remain empty. /// The "&" character can be used to define a mnemonic, the next character will /// be used as key. /// Use "&&" to show the "&" character instead on defining a mnemonic. /// The button can be activated from any control in the dialog using the /// "Alt+key" combination. /// (mnemonic support since 3.3). /// When set after map will update the TABTITLE attribute on the respective /// child (since 3.10). /// (since 3.0). /// TABTITLE (non inheritable) (at children only): Same as TABTITLEn but set in /// each child. /// Works only if set before the child is added to the tabs. pub fn setTabTitle(self: *Self, index: i32, arg: [:0]const u8) void { interop.setStrAttribute(self, "TABTITLE", .{index}, arg); } /// /// K_ANY K_ANY Action generated when a keyboard event occurs. /// Callback int function(Ihandle *ih, int c); [in C] ih:k_any(c: number) -> /// (ret: number) [in Lua] ih: identifier of the element that activated the event. /// c: identifier of typed key. /// Please refer to the Keyboard Codes table for a list of possible values. /// Returns: If IUP_IGNORE is returned the key is ignored and not processed by /// the control and not propagated. /// If returns IUP_CONTINUE, the key will be processed and the event will be /// propagated to the parent of the element receiving it, this is the default behavior. /// If returns IUP_DEFAULT the key is processed but it is not propagated. /// IUP_CLOSE will be processed. /// Notes Keyboard callbacks depend on the keyboard usage of the control with /// the focus. /// So if you return IUP_IGNORE the control will usually not process the key. /// But be aware that sometimes the control process the key in another event so /// even returning IUP_IGNORE the key can get processed. /// Although it will not be propagated. /// IMPORTANT: The callbacks "K_*" of the dialog or native containers depend on /// the IUP_CONTINUE return value to work while the control is in focus. /// If the callback does not exists it is automatically propagated to the /// parent of the element. /// K_* callbacks All defined keys are also callbacks of any element, called /// when the respective key is activated. /// For example: "K_cC" is also a callback activated when the user press /// Ctrl+C, when the focus is at the element or at a children with focus. /// This is the way an application can create shortcut keys, also called hot keys. /// These callbacks are not available in IupLua. /// Affects All elements with keyboard interaction. pub fn setKAnyCallback(self: *Self, callback: ?OnKAnyFn) void { const Handler = CallbackHandler(Self, OnKAnyFn, "K_ANY"); Handler.setCallback(self, callback); } /// /// HELP_CB HELP_CB Action generated when the user press F1 at a control. /// In Motif is also activated by the Help button in some workstations keyboard. /// Callback void function(Ihandle *ih); [in C] ih:help_cb() -> (ret: number) /// [in Lua] ih: identifier of the element that activated the event. /// Returns: IUP_CLOSE will be processed. /// Affects All elements with user interaction. pub fn setHelpCallback(self: *Self, callback: ?OnHelpFn) void { const Handler = CallbackHandler(Self, OnHelpFn, "HELP_CB"); Handler.setCallback(self, callback); } pub fn setDropMotionCallback(self: *Self, callback: ?OnDropMotionFn) void { const Handler = CallbackHandler(Self, OnDropMotionFn, "DROPMOTION_CB"); Handler.setCallback(self, callback); } pub fn setDragEndCallback(self: *Self, callback: ?OnDragEndFn) void { const Handler = CallbackHandler(Self, OnDragEndFn, "DRAGEND_CB"); Handler.setCallback(self, callback); } pub fn setDragBeginCallback(self: *Self, callback: ?OnDragBeginFn) void { const Handler = CallbackHandler(Self, OnDragBeginFn, "DRAGBEGIN_CB"); Handler.setCallback(self, callback); } /// /// ACTION ACTION Action generated when the element is activated. /// Affects each element differently. /// Callback int function(Ihandle *ih); [in C] ih:action() -> (ret: number) [in /// Lua] ih: identifier of the element that activated the event. /// In some elements, this callback may receive more parameters, apart from ih. /// Please refer to each element's documentation. /// Affects IupButton, IupItem, IupList, IupText, IupCanvas, IupMultiline, /// IupToggle pub fn setActionCallback(self: *Self, callback: ?OnActionFn) void { const Handler = CallbackHandler(Self, OnActionFn, "ACTION"); Handler.setCallback(self, callback); } /// /// MOTION_CB MOTION_CB Action generated when the mouse moves. /// Callback int function(Ihandle *ih, int x, int y, char *status); [in C] /// ih:motion_cb(x, y: number, status: string) -> (ret: number) [in Lua] ih: /// identifier of the element that activated the event. /// x, y: position in the canvas where the event has occurred, in pixels. /// status: status of mouse buttons and certain keyboard keys at the moment the /// event was generated. /// The same macros used for BUTTON_CB can be used for this status. /// Notes Between press and release all mouse events are redirected only to /// this control, even if the cursor moves outside the element. /// So the BUTTON_CB callback when released and the MOTION_CB callback can be /// called with coordinates outside the element rectangle. /// Affects IupCanvas, IupGLCanvas pub fn setMotionCallback(self: *Self, callback: ?OnMotionFn) void { const Handler = CallbackHandler(Self, OnMotionFn, "MOTION_CB"); Handler.setCallback(self, callback); } /// /// MAP_CB MAP_CB Called right after an element is mapped and its attributes /// updated in IupMap. /// When the element is a dialog, it is called after the layout is updated. /// For all other elements is called before the layout is updated, so the /// element current size will still be 0x0 during MAP_CB (since 3.14). /// Callback int function(Ihandle *ih); [in C] ih:map_cb() -> (ret: number) [in /// Lua] ih: identifier of the element that activated the event. /// Affects All that have a native representation. pub fn setMapCallback(self: *Self, callback: ?OnMapFn) void { const Handler = CallbackHandler(Self, OnMapFn, "MAP_CB"); Handler.setCallback(self, callback); } /// /// ENTERWINDOW_CB ENTERWINDOW_CB Action generated when the mouse enters the /// native element. /// Callback int function(Ihandle *ih); [in C] ih:enterwindow_cb() -> (ret: /// number) [in Lua] ih: identifier of the element that activated the event. /// Notes When the cursor is moved from one element to another, the call order /// in all platforms will be first the LEAVEWINDOW_CB callback of the old /// control followed by the ENTERWINDOW_CB callback of the new control. /// (since 3.14) If the mouse button is hold pressed and the cursor moves /// outside the element the behavior is system dependent. /// In Windows the LEAVEWINDOW_CB/ENTERWINDOW_CB callbacks are NOT called, in /// GTK the callbacks are called. /// Affects All controls with user interaction. /// See Also LEAVEWINDOW_CB pub fn setEnterWindowCallback(self: *Self, callback: ?OnEnterWindowFn) void { const Handler = CallbackHandler(Self, OnEnterWindowFn, "ENTERWINDOW_CB"); Handler.setCallback(self, callback); } /// /// DESTROY_CB DESTROY_CB Called right before an element is destroyed. /// Callback int function(Ihandle *ih); [in C] ih:destroy_cb() -> (ret: number) /// [in Lua] ih: identifier of the element that activated the event. /// Notes If the dialog is visible then it is hidden before it is destroyed. /// The callback will be called right after it is hidden. /// The callback will be called before all other destroy procedures. /// For instance, if the element has children then it is called before the /// children are destroyed. /// For language binding implementations use the callback name "LDESTROY_CB" to /// release memory allocated by the binding for the element. /// Also the callback will be called before the language callback. /// Affects All. pub fn setDestroyCallback(self: *Self, callback: ?OnDestroyFn) void { const Handler = CallbackHandler(Self, OnDestroyFn, "DESTROY_CB"); Handler.setCallback(self, callback); } pub fn setDropDataCallback(self: *Self, callback: ?OnDropDataFn) void { const Handler = CallbackHandler(Self, OnDropDataFn, "DROPDATA_CB"); Handler.setCallback(self, callback); } /// /// KILLFOCUS_CB KILLFOCUS_CB Action generated when an element loses keyboard focus. /// This callback is called before the GETFOCUS_CB of the element that gets the focus. /// Callback int function(Ihandle *ih); [in C] ih:killfocus_cb() -> (ret: /// number) [in Lua] ih: identifier of the element that activated the event. /// Affects All elements with user interaction, except menus. /// In Windows, there are restrictions when using this callback. /// From MSDN on WM_KILLFOCUS: "While processing this message, do not make any /// function calls that display or activate a window. /// This causes the thread to yield control and can cause the application to /// stop responding to messages. /// See Also GETFOCUS_CB, IupGetFocus, IupSetFocus pub fn setKillFocusCallback(self: *Self, callback: ?OnKillFocusFn) void { const Handler = CallbackHandler(Self, OnKillFocusFn, "KILLFOCUS_CB"); Handler.setCallback(self, callback); } pub fn setDragDataCallback(self: *Self, callback: ?OnDragDataFn) void { const Handler = CallbackHandler(Self, OnDragDataFn, "DRAGDATA_CB"); Handler.setCallback(self, callback); } pub fn setDragDataSizeCallback(self: *Self, callback: ?OnDragDataSizeFn) void { const Handler = CallbackHandler(Self, OnDragDataSizeFn, "DRAGDATASIZE_CB"); Handler.setCallback(self, callback); } /// /// DROPFILES_CB DROPFILES_CB Action called when a file is "dropped" into the control. /// When several files are dropped at once, the callback is called several /// times, once for each file. /// If defined after the element is mapped then the attribute DROPFILESTARGET /// must be set to YES. /// [Windows and GTK Only] (GTK 2.6) Callback int function(Ihandle *ih, const /// char* filename, int num, int x, int y); [in C] ih:dropfiles_cb(filename: /// string; num, x, y: number) -> (ret: number) [in Lua] ih: identifier of the /// element that activated the event. /// filename: Name of the dropped file. /// num: Number index of the dropped file. /// If several files are dropped, num is the index of the dropped file starting /// from "total-1" to "0". /// x: X coordinate of the point where the user released the mouse button. /// y: Y coordinate of the point where the user released the mouse button. /// Returns: If IUP_IGNORE is returned the callback will NOT be called for the /// next dropped files, and the processing of dropped files will be interrupted. /// Affects IupDialog, IupCanvas, IupGLCanvas, IupText, IupList pub fn setDropFilesCallback(self: *Self, callback: ?OnDropFilesFn) void { const Handler = CallbackHandler(Self, OnDropFilesFn, "DROPFILES_CB"); Handler.setCallback(self, callback); } /// /// UNMAP_CB UNMAP_CB Called right before an element is unmapped. /// Callback int function(Ihandle *ih); [in C] ih:unmap_cb() -> (ret: number) /// [in Lua] ih: identifier of the element that activated the event. /// Affects All that have a native representation. pub fn setUnmapCallback(self: *Self, callback: ?OnUnmapFn) void { const Handler = CallbackHandler(Self, OnUnmapFn, "UNMAP_CB"); Handler.setCallback(self, callback); } /// /// CARET_CB: Action generated when the caret/cursor position is changed. /// int function(Ihandle *ih, int lin, int col, int pos); [in /// C]ih:caret_cb(lin, col, pos: number) -> (ret: number) [in Lua] pub fn setCaretCallback(self: *Self, callback: ?OnCaretFn) void { const Handler = CallbackHandler(Self, OnCaretFn, "CARET_CB"); Handler.setCallback(self, callback); } /// /// GETFOCUS_CB GETFOCUS_CB Action generated when an element is given keyboard focus. /// This callback is called after the KILLFOCUS_CB of the element that loosed /// the focus. /// The IupGetFocus function during the callback returns the element that /// loosed the focus. /// Callback int function(Ihandle *ih); [in C] ih:getfocus_cb() -> (ret: /// number) [in Lua] ih: identifier of the element that received keyboard focus. /// Affects All elements with user interaction, except menus. /// See Also KILLFOCUS_CB, IupGetFocus, IupSetFocus pub fn setGetFocusCallback(self: *Self, callback: ?OnGetFocusFn) void { const Handler = CallbackHandler(Self, OnGetFocusFn, "GETFOCUS_CB"); Handler.setCallback(self, callback); } /// /// BUTTON_CB BUTTON_CB Action generated when a mouse button is pressed or released. /// Callback int function(Ihandle* ih, int button, int pressed, int x, int y, /// char* status); [in C] ih:button_cb(button, pressed, x, y: number, status: /// string) -> (ret: number) [in Lua] ih: identifies the element that activated /// the event. /// button: identifies the activated mouse button: IUP_BUTTON1 - left mouse /// button (button 1); IUP_BUTTON2 - middle mouse button (button 2); /// IUP_BUTTON3 - right mouse button (button 3). /// pressed: indicates the state of the button: 0 - mouse button was released; /// 1 - mouse button was pressed. /// x, y: position in the canvas where the event has occurred, in pixels. /// status: status of the mouse buttons and some keyboard keys at the moment /// the event is generated. /// The following macros must be used for verification: iup_isshift(status) /// iup_iscontrol(status) iup_isbutton1(status) iup_isbutton2(status) /// iup_isbutton3(status) iup_isbutton4(status) iup_isbutton5(status) /// iup_isdouble(status) iup_isalt(status) iup_issys(status) They return 1 if /// the respective key or button is pressed, and 0 otherwise. /// These macros are also available in Lua, returning a boolean. /// Returns: IUP_CLOSE will be processed. /// On some controls if IUP_IGNORE is returned the action is ignored (this is /// system dependent). /// Notes This callback can be used to customize a button behavior. /// For a standard button behavior use the ACTION callback of the IupButton. /// For a single click the callback is called twice, one for pressed=1 and one /// for pressed=0. /// Only after both calls the ACTION callback is called. /// In Windows, if a dialog is shown or popup in any situation there could be /// unpredictable results because the native system still has processing to be /// done even after the callback is called. /// A double click is preceded by two single clicks, one for pressed=1 and one /// for pressed=0, and followed by a press=0, all three without the double /// click flag set. /// In GTK, it is preceded by an additional two single clicks sequence. /// For example, for one double click all the following calls are made: /// BUTTON_CB(but=1 (1), x=154, y=83 [ 1 ]) BUTTON_CB(but=1 (0), x=154, y=83 [ /// 1 ]) BUTTON_CB(but=1 (1), x=154, y=83 [ 1 ]) (in GTK only) BUTTON_CB(but=1 /// (0), x=154, y=83 [ 1 ]) (in GTK only) BUTTON_CB(but=1 (1), x=154, y=83 [ 1 /// D ]) BUTTON_CB(but=1 (0), x=154, y=83 [ 1 ]) Between press and release all /// mouse events are redirected only to this control, even if the cursor moves /// outside the element. /// So the BUTTON_CB callback when released and the MOTION_CB callback can be /// called with coordinates outside the element rectangle. /// Affects IupCanvas, IupButton, IupText, IupList, IupGLCanvas pub fn setButtonCallback(self: *Self, callback: ?OnButtonFn) void { const Handler = CallbackHandler(Self, OnButtonFn, "BUTTON_CB"); Handler.setCallback(self, callback); } /// /// VALUECHANGED_CB: Called after the value was interactively changed by the user. /// (since 3.0) int function(Ihandle *ih); [in C]ih:valuechanged_cb() -> (ret: /// number) [in Lua] pub fn setValueChangedCallback(self: *Self, callback: ?OnValueChangedFn) void { const Handler = CallbackHandler(Self, OnValueChangedFn, "VALUECHANGED_CB"); Handler.setCallback(self, callback); } /// /// SPIN_CB: Action generated when a spin button is pressed. /// Valid only when SPIN=YES. /// When this callback is called the ACTION callback is not called. /// The VALUE attribute can be changed during this callback only if SPINAUTO=NO. /// (since 3.0) int function(Ihandle *ih, int pos); [in C]ih:spin_cb(pos: /// number) -> (ret: number) [in Lua] pub fn setSpinCallback(self: *Self, callback: ?OnSpinFn) void { const Handler = CallbackHandler(Self, OnSpinFn, "SPIN_CB"); Handler.setCallback(self, callback); } pub fn setLDestroyCallback(self: *Self, callback: ?OnLDestroyFn) void { const Handler = CallbackHandler(Self, OnLDestroyFn, "LDESTROY_CB"); Handler.setCallback(self, callback); } /// /// LEAVEWINDOW_CB LEAVEWINDOW_CB Action generated when the mouse leaves the /// native element. /// Callback int function(Ihandle *ih); [in C] ih:leavewindow_cb() -> (ret: /// number) [in Lua] ih: identifier of the element that activated the event. /// Notes When the cursor is moved from one element to another, the call order /// in all platforms will be first the LEAVEWINDOW_CB callback of the old /// control followed by the ENTERWINDOW_CB callback of the new control. /// (since 3.14) If the mouse button is hold pressed and the cursor moves /// outside the element the behavior is system dependent. /// In Windows the LEAVEWINDOW_CB/ENTERWINDOW_CB callbacks are NOT called, in /// GTK the callbacks are called. /// Affects All controls with user interaction. /// See Also ENTERWINDOW_CB pub fn setLeaveWindowCallback(self: *Self, callback: ?OnLeaveWindowFn) void { const Handler = CallbackHandler(Self, OnLeaveWindowFn, "LEAVEWINDOW_CB"); Handler.setCallback(self, callback); } pub fn setPostMessageCallback(self: *Self, callback: ?OnPostMessageFn) void { const Handler = CallbackHandler(Self, OnPostMessageFn, "POSTMESSAGE_CB"); Handler.setCallback(self, callback); } }; test "Text FgColor" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setFgColor(.{ .r = 9, .g = 10, .b = 11 }).unwrap()); defer item.deinit(); var ret = item.getFgColor(); try std.testing.expect(ret != null and ret.?.r == 9 and ret.?.g == 10 and ret.?.b == 11); } test "Text HandleName" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setHandleName("Hello").unwrap()); defer item.deinit(); var ret = item.getHandleName(); try std.testing.expect(std.mem.eql(u8, ret, "Hello")); } test "Text TipBgColor" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setTipBgColor(.{ .r = 9, .g = 10, .b = 11 }).unwrap()); defer item.deinit(); var ret = item.getTipBgColor(); try std.testing.expect(ret != null and ret.?.r == 9 and ret.?.g == 10 and ret.?.b == 11); } test "Text Caret" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setCaret(9, 10).unwrap()); defer item.deinit(); var ret = item.getCaret(); try std.testing.expect(ret.lin == 9 and ret.col == 10); } test "Text MaskDecimalSymbol" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setMaskDecimalSymbol("Hello").unwrap()); defer item.deinit(); var ret = item.getMaskDecimalSymbol(); try std.testing.expect(std.mem.eql(u8, ret, "Hello")); } test "Text TipIcon" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setTipIcon("Hello").unwrap()); defer item.deinit(); var ret = item.getTipIcon(); try std.testing.expect(std.mem.eql(u8, ret, "Hello")); } test "Text Overwrite" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setOverwrite(true).unwrap()); defer item.deinit(); var ret = item.getOverwrite(); try std.testing.expect(ret == true); } test "Text SpinInc" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setSpinInc(42).unwrap()); defer item.deinit(); var ret = item.getSpinInc(); try std.testing.expect(ret == 42); } test "Text MaxSize" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setMaxSize(9, 10).unwrap()); defer item.deinit(); var ret = item.getMaxSize(); try std.testing.expect(ret.width != null and ret.width.? == 9 and ret.height != null and ret.height.? == 10); } test "Text Position" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setPosition(9, 10).unwrap()); defer item.deinit(); var ret = item.getPosition(); try std.testing.expect(ret.x == 9 and ret.y == 10); } test "Text AppendNewLine" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setAppendNewLine(true).unwrap()); defer item.deinit(); var ret = item.getAppendNewLine(); try std.testing.expect(ret == true); } test "Text DropFilesTarget" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setDropFilesTarget(true).unwrap()); defer item.deinit(); var ret = item.getDropFilesTarget(); try std.testing.expect(ret == true); } test "Text Tip" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setTip("Hello").unwrap()); defer item.deinit(); var ret = item.getTip(); try std.testing.expect(std.mem.eql(u8, ret, "Hello")); } test "Text DragSourceMove" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setDragSourceMove(true).unwrap()); defer item.deinit(); var ret = item.getDragSourceMove(); try std.testing.expect(ret == true); } test "Text AddFormatTag" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setAddFormatTag("Hello").unwrap()); defer item.deinit(); var ret = item.getAddFormatTag(); try std.testing.expect(std.mem.eql(u8, ret, "Hello")); } test "Text Visible" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setVisible(true).unwrap()); defer item.deinit(); var ret = item.getVisible(); try std.testing.expect(ret == true); } test "Text Nc" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setNc(42).unwrap()); defer item.deinit(); var ret = item.getNc(); try std.testing.expect(ret == 42); } test "Text DragDrop" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setDragDrop(true).unwrap()); defer item.deinit(); var ret = item.getDragDrop(); try std.testing.expect(ret == true); } test "Text Theme" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setTheme("Hello").unwrap()); defer item.deinit(); var ret = item.getTheme(); try std.testing.expect(std.mem.eql(u8, ret, "Hello")); } test "Text MaskReal" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setMaskReal(.Signed).unwrap()); defer item.deinit(); var ret = item.getMaskReal(); try std.testing.expect(ret != null and ret.? == .Signed); } test "Text Expand" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setExpand(.Yes).unwrap()); defer item.deinit(); var ret = item.getExpand(); try std.testing.expect(ret != null and ret.? == .Yes); } test "Text VisibleLines" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setVisibleLines(42).unwrap()); defer item.deinit(); var ret = item.getVisibleLines(); try std.testing.expect(ret == 42); } test "Text Size" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setSize(9, 10).unwrap()); defer item.deinit(); var ret = item.getSize(); try std.testing.expect(ret.width != null and ret.width.? == 9 and ret.height != null and ret.height.? == 10); } test "Text Padding" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setPadding(9, 10).unwrap()); defer item.deinit(); var ret = item.getPadding(); try std.testing.expect(ret.width != null and ret.width.? == 9 and ret.height != null and ret.height.? == 10); } test "Text SpinMin" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setSpinMin(42).unwrap()); defer item.deinit(); var ret = item.getSpinMin(); try std.testing.expect(ret == 42); } test "Text TipMarkup" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setTipMarkup("Hello").unwrap()); defer item.deinit(); var ret = item.getTipMarkup(); try std.testing.expect(std.mem.eql(u8, ret, "Hello")); } test "Text FontSize" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setFontSize(42).unwrap()); defer item.deinit(); var ret = item.getFontSize(); try std.testing.expect(ret == 42); } test "Text DropTypes" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setDropTypes("Hello").unwrap()); defer item.deinit(); var ret = item.getDropTypes(); try std.testing.expect(std.mem.eql(u8, ret, "Hello")); } test "Text UserSize" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setUserSize(9, 10).unwrap()); defer item.deinit(); var ret = item.getUserSize(); try std.testing.expect(ret.width != null and ret.width.? == 9 and ret.height != null and ret.height.? == 10); } test "Text TipDelay" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setTipDelay(42).unwrap()); defer item.deinit(); var ret = item.getTipDelay(); try std.testing.expect(ret == 42); } test "Text TabsIZe" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setTabsIZe(42).unwrap()); defer item.deinit(); var ret = item.getTabsIZe(); try std.testing.expect(ret == 42); } test "Text PropagateFocus" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setPropagateFocus(true).unwrap()); defer item.deinit(); var ret = item.getPropagateFocus(); try std.testing.expect(ret == true); } test "Text BgColor" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setBgColor(.{ .r = 9, .g = 10, .b = 11 }).unwrap()); defer item.deinit(); var ret = item.getBgColor(); try std.testing.expect(ret != null and ret.?.r == 9 and ret.?.g == 10 and ret.?.b == 11); } test "Text DropTarget" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setDropTarget(true).unwrap()); defer item.deinit(); var ret = item.getDropTarget(); try std.testing.expect(ret == true); } test "Text DragSource" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setDragSource(true).unwrap()); defer item.deinit(); var ret = item.getDragSource(); try std.testing.expect(ret == true); } test "Text Floating" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setFloating(.Yes).unwrap()); defer item.deinit(); var ret = item.getFloating(); try std.testing.expect(ret != null and ret.? == .Yes); } test "Text NormalizerGroup" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setNormalizerGroup("Hello").unwrap()); defer item.deinit(); var ret = item.getNormalizerGroup(); try std.testing.expect(std.mem.eql(u8, ret, "Hello")); } test "Text RasterSize" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setRasterSize(9, 10).unwrap()); defer item.deinit(); var ret = item.getRasterSize(); try std.testing.expect(ret.width != null and ret.width.? == 9 and ret.height != null and ret.height.? == 10); } test "Text Formatting" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setFormatting(true).unwrap()); defer item.deinit(); var ret = item.getFormatting(); try std.testing.expect(ret == true); } test "Text TipFgColor" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setTipFgColor(.{ .r = 9, .g = 10, .b = 11 }).unwrap()); defer item.deinit(); var ret = item.getTipFgColor(); try std.testing.expect(ret != null and ret.?.r == 9 and ret.?.g == 10 and ret.?.b == 11); } test "Text SpinWrap" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setSpinWrap(true).unwrap()); defer item.deinit(); var ret = item.getSpinWrap(); try std.testing.expect(ret == true); } test "Text FontFace" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setFontFace("Hello").unwrap()); defer item.deinit(); var ret = item.getFontFace(); try std.testing.expect(std.mem.eql(u8, ret, "Hello")); } test "Text VisibleColumns" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setVisibleColumns(42).unwrap()); defer item.deinit(); var ret = item.getVisibleColumns(); try std.testing.expect(ret == 42); } test "Text MaskInt" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setMaskInt(9, 10).unwrap()); defer item.deinit(); var ret = item.getMaskInt(); try std.testing.expect(ret.begin == 9 and ret.end == 10); } test "Text SpinAlign" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setSpinAlign(.Left).unwrap()); defer item.deinit(); var ret = item.getSpinAlign(); try std.testing.expect(ret != null and ret.? == .Left); } test "Text Name" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setName("Hello").unwrap()); defer item.deinit(); var ret = item.getName(); try std.testing.expect(std.mem.eql(u8, ret, "Hello")); } test "Text MaskCasei" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setMaskCasei(true).unwrap()); defer item.deinit(); var ret = item.getMaskCasei(); try std.testing.expect(ret == true); } test "Text SelectionPos" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setSelectionPos(9, 10).unwrap()); defer item.deinit(); var ret = item.getSelectionPos(); try std.testing.expect(ret.begin == 9 and ret.end == 10); } test "Text Value" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setValue("Hello").unwrap()); defer item.deinit(); var ret = item.getValue(); try std.testing.expect(std.mem.eql(u8, ret, "Hello")); } test "Text Filter" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setFilter(.LowerCase).unwrap()); defer item.deinit(); var ret = item.getFilter(); try std.testing.expect(ret != null and ret.? == .LowerCase); } test "Text SpinMax" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setSpinMax(42).unwrap()); defer item.deinit(); var ret = item.getSpinMax(); try std.testing.expect(ret == 42); } test "Text Multiline" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setMultiline(true).unwrap()); defer item.deinit(); var ret = item.getMultiline(); try std.testing.expect(ret == true); } test "Text SelectedText" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setSelectedText("Hello").unwrap()); defer item.deinit(); var ret = item.getSelectedText(); try std.testing.expect(std.mem.eql(u8, ret, "Hello")); } test "Text CPadding" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setCPadding(9, 10).unwrap()); defer item.deinit(); var ret = item.getCPadding(); try std.testing.expect(ret.width != null and ret.width.? == 9 and ret.height != null and ret.height.? == 10); } test "Text Active" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setActive(true).unwrap()); defer item.deinit(); var ret = item.getActive(); try std.testing.expect(ret == true); } test "Text TipVisible" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setTipVisible(true).unwrap()); defer item.deinit(); var ret = item.getTipVisible(); try std.testing.expect(ret == true); } test "Text CueBanner" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setCueBanner("Hello").unwrap()); defer item.deinit(); var ret = item.getCueBanner(); try std.testing.expect(std.mem.eql(u8, ret, "Hello")); } test "Text ExpandWeight" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setExpandWeight(3.14).unwrap()); defer item.deinit(); var ret = item.getExpandWeight(); try std.testing.expect(ret == @as(f64, 3.14)); } test "Text MinSize" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setMinSize(9, 10).unwrap()); defer item.deinit(); var ret = item.getMinSize(); try std.testing.expect(ret.width != null and ret.width.? == 9 and ret.height != null and ret.height.? == 10); } test "Text NTheme" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setNTheme("Hello").unwrap()); defer item.deinit(); var ret = item.getNTheme(); try std.testing.expect(std.mem.eql(u8, ret, "Hello")); } test "Text CaretPos" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setCaretPos(42).unwrap()); defer item.deinit(); var ret = item.getCaretPos(); try std.testing.expect(ret == 42); } test "Text SpinAuto" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setSpinAuto(true).unwrap()); defer item.deinit(); var ret = item.getSpinAuto(); try std.testing.expect(ret == true); } test "Text Mask" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setMask("Hello").unwrap()); defer item.deinit(); var ret = item.getMask(); try std.testing.expect(std.mem.eql(u8, ret, "Hello")); } test "Text DragTypes" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setDragTypes("Hello").unwrap()); defer item.deinit(); var ret = item.getDragTypes(); try std.testing.expect(std.mem.eql(u8, ret, "Hello")); } test "Text AutoHide" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setAutoHide(true).unwrap()); defer item.deinit(); var ret = item.getAutoHide(); try std.testing.expect(ret == true); } test "Text FontStyle" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setFontStyle("Hello").unwrap()); defer item.deinit(); var ret = item.getFontStyle(); try std.testing.expect(std.mem.eql(u8, ret, "Hello")); } test "Text Clipboard" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setClipboard(.Copy).unwrap()); defer item.deinit(); var ret = item.getClipboard(); try std.testing.expect(ret != null and ret.? == .Copy); } test "Text Readonly" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setReadonly(true).unwrap()); defer item.deinit(); var ret = item.getReadonly(); try std.testing.expect(ret == true); } test "Text MaskNoEmpty" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setMaskNoEmpty(true).unwrap()); defer item.deinit(); var ret = item.getMaskNoEmpty(); try std.testing.expect(ret == true); } test "Text Font" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var item = try (iup.Text.init().setFont("Hello").unwrap()); defer item.deinit(); var ret = item.getFont(); try std.testing.expect(std.mem.eql(u8, ret, "Hello")); }
src/elements/text.zig
const std = @import("std"); const interop = @import("../interop.zig"); const iup = @import("../iup.zig"); const Impl = @import("../impl.zig").Impl; const CallbackHandler = @import("../callback_handler.zig").CallbackHandler; const debug = std.debug; const trait = std.meta.trait; const Element = iup.Element; const Handle = iup.Handle; const Error = iup.Error; const ChildrenIterator = iup.ChildrenIterator; const Size = iup.Size; const Margin = iup.Margin; /// /// Construction element used only in IupParamBox. /// It is not mapped in the native system, but it will exist while its /// IupParamBox container exists. pub const Param = opaque { pub const CLASS_NAME = "param"; pub const NATIVE_TYPE = iup.NativeType.Void; const Self = @This(); pub const OnLDestroyFn = fn (self: *Self) anyerror!void; /// /// DESTROY_CB DESTROY_CB Called right before an element is destroyed. /// Callback int function(Ihandle *ih); [in C] ih:destroy_cb() -> (ret: number) /// [in Lua] ih: identifier of the element that activated the event. /// Notes If the dialog is visible then it is hidden before it is destroyed. /// The callback will be called right after it is hidden. /// The callback will be called before all other destroy procedures. /// For instance, if the element has children then it is called before the /// children are destroyed. /// For language binding implementations use the callback name "LDESTROY_CB" to /// release memory allocated by the binding for the element. /// Also the callback will be called before the language callback. /// Affects All. pub const OnDestroyFn = fn (self: *Self) anyerror!void; /// /// MAP_CB MAP_CB Called right after an element is mapped and its attributes /// updated in IupMap. /// When the element is a dialog, it is called after the layout is updated. /// For all other elements is called before the layout is updated, so the /// element current size will still be 0x0 during MAP_CB (since 3.14). /// Callback int function(Ihandle *ih); [in C] ih:map_cb() -> (ret: number) [in /// Lua] ih: identifier of the element that activated the event. /// Affects All that have a native representation. pub const OnMapFn = fn (self: *Self) anyerror!void; pub const OnPostMessageFn = fn (self: *Self, arg0: [:0]const u8, arg1: i32, arg2: f64, arg3: *iup.Unknow) anyerror!void; /// /// UNMAP_CB UNMAP_CB Called right before an element is unmapped. /// Callback int function(Ihandle *ih); [in C] ih:unmap_cb() -> (ret: number) /// [in Lua] ih: identifier of the element that activated the event. /// Affects All that have a native representation. pub const OnUnmapFn = fn (self: *Self) anyerror!void; /// /// DIALOGTYPE, FILTER, DIRECTORY, NOCHANGEDIR, NOOVERWRITEPROMPT: used for the /// FILE parameter dialog. /// See IupFileDlg. /// For 'f' parameter. pub const DialogType = enum { Save, Dir, Open, }; /// /// FLOATING (non inheritable) (at children only): If a child has FLOATING=YES /// then its size and position will be ignored by the layout processing. /// Default: "NO". /// (since 3.0) pub const Floating = enum { Yes, Ignore, No, }; pub const Initializer = struct { last_error: ?anyerror = null, ref: *Self, /// /// Returns a pointer to IUP element or an error. /// Only top-level or detached elements needs to be unwraped, pub fn unwrap(self: Initializer) !*Self { if (self.last_error) |e| { return e; } else { return self.ref; } } /// /// Captures a reference into a external variable /// Allows to capture some references even using full declarative API pub fn capture(self: *Initializer, ref: **Self) Initializer { ref.* = self.ref; return self.*; } pub fn setStrAttribute(self: *Initializer, attributeName: [:0]const u8, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; Self.setStrAttribute(self.ref, attributeName, arg); return self.*; } pub fn setIntAttribute(self: *Initializer, attributeName: [:0]const u8, arg: i32) Initializer { if (self.last_error) |_| return self.*; Self.setIntAttribute(self.ref, attributeName, arg); return self.*; } pub fn setBoolAttribute(self: *Initializer, attributeName: [:0]const u8, arg: bool) Initializer { if (self.last_error) |_| return self.*; Self.setBoolAttribute(self.ref, attributeName, arg); return self.*; } pub fn setPtrAttribute(self: *Initializer, comptime T: type, attributeName: [:0]const u8, value: ?*T) Initializer { if (self.last_error) |_| return self.*; Self.setPtrAttribute(self.ref, T, attributeName, value); return self.*; } pub fn setHandle(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setHandle(self.ref, arg); return self.*; } pub fn setDirectory(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "DIRECTORY", .{}, arg); return self.*; } pub fn setNoOverwritePrompt(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "NOOVERWRITEPROMPT", .{}, arg); return self.*; } /// /// TITLE: text of the parameter, used as label. /// For all parameters. pub fn setTitle(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "TITLE", .{}, arg); return self.*; } /// /// MULTILINE: can be Yes or No. /// Defines if the edit box can have more than one line. /// For 'm' parameter. pub fn setMultiline(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "MULTILINE", .{}, arg); return self.*; } pub fn setFilter(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "FILTER", .{}, arg); return self.*; } /// /// TIP: text of the tip. /// For all parameters. pub fn setTip(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "TIP", .{}, arg); return self.*; } pub fn setMax(self: *Initializer, arg: f64) Initializer { if (self.last_error) |_| return self.*; interop.setDoubleAttribute(self.ref, "MAX", .{}, arg); return self.*; } /// /// BUTTON1, BUTTON2, BUTTON3: button titles. /// Default is "OK/Cancel/Help" for regular IupGetParam, and "Apply/Reset/Help" /// when IupParamBox is directly used. /// For 'u' parameter. pub fn setButton1(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "BUTTON1", .{}, arg); return self.*; } pub fn setButton2(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "BUTTON2", .{}, arg); return self.*; } /// /// MASK: mask for the edit box input. /// For 's' and 'm' parameters. pub fn setMask(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "MASK", .{}, arg); return self.*; } pub fn setButton3(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "BUTTON3", .{}, arg); return self.*; } /// /// TYPE: can be BOOLEAN ('b'), LIST ('l'), OPTIONS ('o'), REAL ('A', 'a', 'R', /// 'r'), STRING ('m', 's'), INTEGER ('i'), DATE ('d'), FILE ('f'), COLOR /// ('c'), SEPARATOR ('t'), BUTTONNAMES ('u'), PARAMBOX ('x') and HANDLE ('h'). /// And describe the type of the parameter. /// For all parameters. pub fn setType(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "TYPE", .{}, arg); return self.*; } /// /// VALUE - the value of the parameter. /// IupGetFloat and IupGetInt can also be used. /// For the current parameter inside the callback contains the new value that /// will be applied to the control, to get the old value use the VALUE /// attribute for the CONTROL returned Ihandle*. pub fn setValue(self: *Initializer, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "VALUE", .{}, arg); return self.*; } /// /// DIALOGTYPE, FILTER, DIRECTORY, NOCHANGEDIR, NOOVERWRITEPROMPT: used for the /// FILE parameter dialog. /// See IupFileDlg. /// For 'f' parameter. pub fn setDialogType(self: *Initializer, arg: ?DialogType) Initializer { if (self.last_error) |_| return self.*; if (arg) |value| switch (value) { .Save => interop.setStrAttribute(self.ref, "DIALOGTYPE", .{}, "SAVE"), .Dir => interop.setStrAttribute(self.ref, "DIALOGTYPE", .{}, "DIR"), .Open => interop.setStrAttribute(self.ref, "DIALOGTYPE", .{}, "OPEN"), } else { interop.clearAttribute(self.ref, "DIALOGTYPE", .{}); } return self.*; } pub fn setNoChangeDir(self: *Initializer, arg: bool) Initializer { if (self.last_error) |_| return self.*; interop.setBoolAttribute(self.ref, "NOCHANGEDIR", .{}, arg); return self.*; } pub fn setMin(self: *Initializer, arg: f64) Initializer { if (self.last_error) |_| return self.*; interop.setDoubleAttribute(self.ref, "MIN", .{}, arg); return self.*; } pub fn setStep(self: *Initializer, arg: f64) Initializer { if (self.last_error) |_| return self.*; interop.setDoubleAttribute(self.ref, "STEP", .{}, arg); return self.*; } /// /// EXPANDWEIGHT (non inheritable) (at children only): If a child defines the /// expand weight, then it is used to multiply the free space used for expansion. /// (since 3.1) pub fn setExpandWeight(self: *Initializer, arg: f64) Initializer { if (self.last_error) |_| return self.*; interop.setDoubleAttribute(self.ref, "EXPANDWEIGHT", .{}, arg); return self.*; } /// /// FLOATING (non inheritable) (at children only): If a child has FLOATING=YES /// then its size and position will be ignored by the layout processing. /// Default: "NO". /// (since 3.0) pub fn setFloating(self: *Initializer, arg: ?Floating) Initializer { if (self.last_error) |_| return self.*; if (arg) |value| switch (value) { .Yes => interop.setStrAttribute(self.ref, "FLOATING", .{}, "YES"), .Ignore => interop.setStrAttribute(self.ref, "FLOATING", .{}, "IGNORE"), .No => interop.setStrAttribute(self.ref, "FLOATING", .{}, "NO"), } else { interop.clearAttribute(self.ref, "FLOATING", .{}); } return self.*; } /// /// TABIMAGEn (non inheritable): image name to be used in the respective tab. /// Use IupSetHandle or IupSetAttributeHandle to associate an image to a name. /// n starts at 0. /// See also IupImage. /// In Motif, the image is shown only if TABTITLEn is NULL. /// In Windows and Motif set the BGCOLOR attribute before setting the image. /// When set after map will update the TABIMAGE attribute on the respective /// child (since 3.10). /// (since 3.0). /// TABIMAGE (non inheritable) (at children only): Same as TABIMAGEn but set in /// each child. /// Works only if set before the child is added to the tabs. pub fn setTabImage(self: *Initializer, index: i32, arg: anytype) Initializer { if (self.last_error) |_| return self.*; if (interop.validateHandle(.Image, arg)) { interop.setHandleAttribute(self.ref, "TABIMAGE", .{index}, arg); } else |err| { self.last_error = err; } return self.*; } pub fn setTabImageHandleName(self: *Initializer, index: i32, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "TABIMAGE", .{index}, arg); return self.*; } /// /// TABTITLEn (non inheritable): Contains the text to be shown in the /// respective tab title. /// n starts at 0. /// If this value is NULL, it will remain empty. /// The "&" character can be used to define a mnemonic, the next character will /// be used as key. /// Use "&&" to show the "&" character instead on defining a mnemonic. /// The button can be activated from any control in the dialog using the /// "Alt+key" combination. /// (mnemonic support since 3.3). /// When set after map will update the TABTITLE attribute on the respective /// child (since 3.10). /// (since 3.0). /// TABTITLE (non inheritable) (at children only): Same as TABTITLEn but set in /// each child. /// Works only if set before the child is added to the tabs. pub fn setTabTitle(self: *Initializer, index: i32, arg: [:0]const u8) Initializer { if (self.last_error) |_| return self.*; interop.setStrAttribute(self.ref, "TABTITLE", .{index}, arg); return self.*; } pub fn setLDestroyCallback(self: *Initializer, callback: ?OnLDestroyFn) Initializer { const Handler = CallbackHandler(Self, OnLDestroyFn, "LDESTROY_CB"); Handler.setCallback(self.ref, callback); return self.*; } /// /// DESTROY_CB DESTROY_CB Called right before an element is destroyed. /// Callback int function(Ihandle *ih); [in C] ih:destroy_cb() -> (ret: number) /// [in Lua] ih: identifier of the element that activated the event. /// Notes If the dialog is visible then it is hidden before it is destroyed. /// The callback will be called right after it is hidden. /// The callback will be called before all other destroy procedures. /// For instance, if the element has children then it is called before the /// children are destroyed. /// For language binding implementations use the callback name "LDESTROY_CB" to /// release memory allocated by the binding for the element. /// Also the callback will be called before the language callback. /// Affects All. pub fn setDestroyCallback(self: *Initializer, callback: ?OnDestroyFn) Initializer { const Handler = CallbackHandler(Self, OnDestroyFn, "DESTROY_CB"); Handler.setCallback(self.ref, callback); return self.*; } /// /// MAP_CB MAP_CB Called right after an element is mapped and its attributes /// updated in IupMap. /// When the element is a dialog, it is called after the layout is updated. /// For all other elements is called before the layout is updated, so the /// element current size will still be 0x0 during MAP_CB (since 3.14). /// Callback int function(Ihandle *ih); [in C] ih:map_cb() -> (ret: number) [in /// Lua] ih: identifier of the element that activated the event. /// Affects All that have a native representation. pub fn setMapCallback(self: *Initializer, callback: ?OnMapFn) Initializer { const Handler = CallbackHandler(Self, OnMapFn, "MAP_CB"); Handler.setCallback(self.ref, callback); return self.*; } pub fn setPostMessageCallback(self: *Initializer, callback: ?OnPostMessageFn) Initializer { const Handler = CallbackHandler(Self, OnPostMessageFn, "POSTMESSAGE_CB"); Handler.setCallback(self.ref, callback); return self.*; } /// /// UNMAP_CB UNMAP_CB Called right before an element is unmapped. /// Callback int function(Ihandle *ih); [in C] ih:unmap_cb() -> (ret: number) /// [in Lua] ih: identifier of the element that activated the event. /// Affects All that have a native representation. pub fn setUnmapCallback(self: *Initializer, callback: ?OnUnmapFn) Initializer { const Handler = CallbackHandler(Self, OnUnmapFn, "UNMAP_CB"); Handler.setCallback(self.ref, callback); return self.*; } }; pub fn setStrAttribute(self: *Self, attribute: [:0]const u8, arg: [:0]const u8) void { interop.setStrAttribute(self, attribute, .{}, arg); } pub fn getStrAttribute(self: *Self, attribute: [:0]const u8) [:0]const u8 { return interop.getStrAttribute(self, attribute, .{}); } pub fn setIntAttribute(self: *Self, attribute: [:0]const u8, arg: i32) void { interop.setIntAttribute(self, attribute, .{}, arg); } pub fn getIntAttribute(self: *Self, attribute: [:0]const u8) i32 { return interop.getIntAttribute(self, attribute, .{}); } pub fn setBoolAttribute(self: *Self, attribute: [:0]const u8, arg: bool) void { interop.setBoolAttribute(self, attribute, .{}, arg); } pub fn getBoolAttribute(self: *Self, attribute: [:0]const u8) bool { return interop.getBoolAttribute(self, attribute, .{}); } pub fn getPtrAttribute(self: *Self, comptime T: type, attribute: [:0]const u8) ?*T { return interop.getPtrAttribute(T, self, attribute, .{}); } pub fn setPtrAttribute(self: *Self, comptime T: type, attribute: [:0]const u8, value: ?*T) void { interop.setPtrAttribute(T, self, attribute, .{}, value); } pub fn setHandle(self: *Self, arg: [:0]const u8) void { interop.setHandle(self, arg); } pub fn fromHandleName(handle_name: [:0]const u8) ?*Self { return interop.fromHandleName(Self, handle_name); } /// /// Creates an interface element given its class name and parameters. /// After creation the element still needs to be attached to a container and mapped to the native system so it can be visible. pub fn init() Initializer { var handle = interop.create(Self); if (handle) |valid| { return .{ .ref = @ptrCast(*Self, valid), }; } else { return .{ .ref = undefined, .last_error = Error.NotInitialized }; } } /// /// Destroys an interface element and all its children. /// Only dialogs, timers, popup menus and images should be normally destroyed, but detached elements can also be destroyed. pub fn deinit(self: *Self) void { interop.destroy(self); } /// /// Creates (maps) the native interface objects corresponding to the given IUP interface elements. /// It will also called recursively to create the native element of all the children in the element's tree. /// The element must be already attached to a mapped container, except the dialog. A child can only be mapped if its parent is already mapped. /// This function is automatically called before the dialog is shown in IupShow, IupShowXY or IupPopup. /// If the element is a dialog then the abstract layout will be updated even if the dialog is already mapped. If the dialog is visible the elements will be immediately repositioned. Calling IupMap for an already mapped dialog is the same as only calling IupRefresh for the dialog. /// Calling IupMap for an already mapped element that is not a dialog does nothing. /// If you add new elements to an already mapped dialog you must call IupMap for that elements. And then call IupRefresh to update the dialog layout. /// If the WID attribute of an element is NULL, it means the element was not already mapped. Some containers do not have a native element associated, like VBOX and HBOX. In this case their WID is a fake value (void*)(-1). /// It is useful for the application to call IupMap when the value of the WID attribute must be known, i.e. the native element must exist, before a dialog is made visible. /// The MAP_CB callback is called at the end of the IupMap function, after all processing, so it can also be used to create other things that depend on the WID attribute. But notice that for non dialog elements it will be called before the dialog layout has been updated, so the element current size will still be 0x0 (since 3.14). pub fn map(self: *Self) !void { try interop.map(self); } /// /// pub fn getDialog(self: *Self) ?*iup.Dialog { return interop.getDialog(self); } /// /// Returns the the child element that has the NAME attribute equals to the given value on the same dialog hierarchy. /// Works also for children of a menu that is associated with a dialog. pub fn getDialogChild(self: *Self, byName: [:0]const u8) ?Element { return interop.getDialogChild(self, byName); } /// /// Updates the size and layout of all controls in the same dialog. /// To be used after changing size attributes, or attributes that affect the size of the control. Can be used for any element inside a dialog, but the layout of the dialog and all controls will be updated. It can change the layout of all the controls inside the dialog because of the dynamic layout positioning. pub fn refresh(self: *Self) void { Impl(Self).refresh(self); } pub fn getDirectory(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "DIRECTORY", .{}); } pub fn setDirectory(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "DIRECTORY", .{}, arg); } pub fn getNoOverwritePrompt(self: *Self) bool { return interop.getBoolAttribute(self, "NOOVERWRITEPROMPT", .{}); } pub fn setNoOverwritePrompt(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "NOOVERWRITEPROMPT", .{}, arg); } /// /// TITLE: text of the parameter, used as label. /// For all parameters. pub fn getTitle(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "TITLE", .{}); } /// /// TITLE: text of the parameter, used as label. /// For all parameters. pub fn setTitle(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "TITLE", .{}, arg); } /// /// MULTILINE: can be Yes or No. /// Defines if the edit box can have more than one line. /// For 'm' parameter. pub fn getMultiline(self: *Self) bool { return interop.getBoolAttribute(self, "MULTILINE", .{}); } /// /// MULTILINE: can be Yes or No. /// Defines if the edit box can have more than one line. /// For 'm' parameter. pub fn setMultiline(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "MULTILINE", .{}, arg); } pub fn getFilter(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "FILTER", .{}); } pub fn setFilter(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "FILTER", .{}, arg); } /// /// TIP: text of the tip. /// For all parameters. pub fn getTip(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "TIP", .{}); } /// /// TIP: text of the tip. /// For all parameters. pub fn setTip(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "TIP", .{}, arg); } pub fn getMax(self: *Self) f64 { return interop.getDoubleAttribute(self, "MAX", .{}); } pub fn setMax(self: *Self, arg: f64) void { interop.setDoubleAttribute(self, "MAX", .{}, arg); } /// /// BUTTON1, BUTTON2, BUTTON3: button titles. /// Default is "OK/Cancel/Help" for regular IupGetParam, and "Apply/Reset/Help" /// when IupParamBox is directly used. /// For 'u' parameter. pub fn getButton1(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "BUTTON1", .{}); } /// /// BUTTON1, BUTTON2, BUTTON3: button titles. /// Default is "OK/Cancel/Help" for regular IupGetParam, and "Apply/Reset/Help" /// when IupParamBox is directly used. /// For 'u' parameter. pub fn setButton1(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "BUTTON1", .{}, arg); } pub fn getButton2(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "BUTTON2", .{}); } pub fn setButton2(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "BUTTON2", .{}, arg); } /// /// MASK: mask for the edit box input. /// For 's' and 'm' parameters. pub fn getMask(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "MASK", .{}); } /// /// MASK: mask for the edit box input. /// For 's' and 'm' parameters. pub fn setMask(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "MASK", .{}, arg); } pub fn getButton3(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "BUTTON3", .{}); } pub fn setButton3(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "BUTTON3", .{}, arg); } /// /// TYPE: can be BOOLEAN ('b'), LIST ('l'), OPTIONS ('o'), REAL ('A', 'a', 'R', /// 'r'), STRING ('m', 's'), INTEGER ('i'), DATE ('d'), FILE ('f'), COLOR /// ('c'), SEPARATOR ('t'), BUTTONNAMES ('u'), PARAMBOX ('x') and HANDLE ('h'). /// And describe the type of the parameter. /// For all parameters. pub fn getType(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "TYPE", .{}); } /// /// TYPE: can be BOOLEAN ('b'), LIST ('l'), OPTIONS ('o'), REAL ('A', 'a', 'R', /// 'r'), STRING ('m', 's'), INTEGER ('i'), DATE ('d'), FILE ('f'), COLOR /// ('c'), SEPARATOR ('t'), BUTTONNAMES ('u'), PARAMBOX ('x') and HANDLE ('h'). /// And describe the type of the parameter. /// For all parameters. pub fn setType(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "TYPE", .{}, arg); } /// /// VALUE - the value of the parameter. /// IupGetFloat and IupGetInt can also be used. /// For the current parameter inside the callback contains the new value that /// will be applied to the control, to get the old value use the VALUE /// attribute for the CONTROL returned Ihandle*. pub fn getValue(self: *Self) [:0]const u8 { return interop.getStrAttribute(self, "VALUE", .{}); } /// /// VALUE - the value of the parameter. /// IupGetFloat and IupGetInt can also be used. /// For the current parameter inside the callback contains the new value that /// will be applied to the control, to get the old value use the VALUE /// attribute for the CONTROL returned Ihandle*. pub fn setValue(self: *Self, arg: [:0]const u8) void { interop.setStrAttribute(self, "VALUE", .{}, arg); } /// /// DIALOGTYPE, FILTER, DIRECTORY, NOCHANGEDIR, NOOVERWRITEPROMPT: used for the /// FILE parameter dialog. /// See IupFileDlg. /// For 'f' parameter. pub fn getDialogType(self: *Self) ?DialogType { var ret = interop.getStrAttribute(self, "DIALOGTYPE", .{}); if (std.ascii.eqlIgnoreCase("SAVE", ret)) return .Save; if (std.ascii.eqlIgnoreCase("DIR", ret)) return .Dir; if (std.ascii.eqlIgnoreCase("OPEN", ret)) return .Open; return null; } /// /// DIALOGTYPE, FILTER, DIRECTORY, NOCHANGEDIR, NOOVERWRITEPROMPT: used for the /// FILE parameter dialog. /// See IupFileDlg. /// For 'f' parameter. pub fn setDialogType(self: *Self, arg: ?DialogType) void { if (arg) |value| switch (value) { .Save => interop.setStrAttribute(self, "DIALOGTYPE", .{}, "SAVE"), .Dir => interop.setStrAttribute(self, "DIALOGTYPE", .{}, "DIR"), .Open => interop.setStrAttribute(self, "DIALOGTYPE", .{}, "OPEN"), } else { interop.clearAttribute(self, "DIALOGTYPE", .{}); } } pub fn getNoChangeDir(self: *Self) bool { return interop.getBoolAttribute(self, "NOCHANGEDIR", .{}); } pub fn setNoChangeDir(self: *Self, arg: bool) void { interop.setBoolAttribute(self, "NOCHANGEDIR", .{}, arg); } pub fn getMin(self: *Self) f64 { return interop.getDoubleAttribute(self, "MIN", .{}); } pub fn setMin(self: *Self, arg: f64) void { interop.setDoubleAttribute(self, "MIN", .{}, arg); } pub fn getStep(self: *Self) f64 { return interop.getDoubleAttribute(self, "STEP", .{}); } pub fn setStep(self: *Self, arg: f64) void { interop.setDoubleAttribute(self, "STEP", .{}, arg); } /// /// EXPANDWEIGHT (non inheritable) (at children only): If a child defines the /// expand weight, then it is used to multiply the free space used for expansion. /// (since 3.1) pub fn getExpandWeight(self: *Self) f64 { return interop.getDoubleAttribute(self, "EXPANDWEIGHT", .{}); } /// /// EXPANDWEIGHT (non inheritable) (at children only): If a child defines the /// expand weight, then it is used to multiply the free space used for expansion. /// (since 3.1) pub fn setExpandWeight(self: *Self, arg: f64) void { interop.setDoubleAttribute(self, "EXPANDWEIGHT", .{}, arg); } /// /// FLOATING (non inheritable) (at children only): If a child has FLOATING=YES /// then its size and position will be ignored by the layout processing. /// Default: "NO". /// (since 3.0) pub fn getFloating(self: *Self) ?Floating { var ret = interop.getStrAttribute(self, "FLOATING", .{}); if (std.ascii.eqlIgnoreCase("YES", ret)) return .Yes; if (std.ascii.eqlIgnoreCase("IGNORE", ret)) return .Ignore; if (std.ascii.eqlIgnoreCase("NO", ret)) return .No; return null; } /// /// FLOATING (non inheritable) (at children only): If a child has FLOATING=YES /// then its size and position will be ignored by the layout processing. /// Default: "NO". /// (since 3.0) pub fn setFloating(self: *Self, arg: ?Floating) void { if (arg) |value| switch (value) { .Yes => interop.setStrAttribute(self, "FLOATING", .{}, "YES"), .Ignore => interop.setStrAttribute(self, "FLOATING", .{}, "IGNORE"), .No => interop.setStrAttribute(self, "FLOATING", .{}, "NO"), } else { interop.clearAttribute(self, "FLOATING", .{}); } } /// /// TABIMAGEn (non inheritable): image name to be used in the respective tab. /// Use IupSetHandle or IupSetAttributeHandle to associate an image to a name. /// n starts at 0. /// See also IupImage. /// In Motif, the image is shown only if TABTITLEn is NULL. /// In Windows and Motif set the BGCOLOR attribute before setting the image. /// When set after map will update the TABIMAGE attribute on the respective /// child (since 3.10). /// (since 3.0). /// TABIMAGE (non inheritable) (at children only): Same as TABIMAGEn but set in /// each child. /// Works only if set before the child is added to the tabs. pub fn getTabImage(self: *Self, index: i32) ?iup.Element { if (interop.getHandleAttribute(self, "TABIMAGE", .{index})) |handle| { return iup.Element.fromHandle(handle); } else { return null; } } /// /// TABIMAGEn (non inheritable): image name to be used in the respective tab. /// Use IupSetHandle or IupSetAttributeHandle to associate an image to a name. /// n starts at 0. /// See also IupImage. /// In Motif, the image is shown only if TABTITLEn is NULL. /// In Windows and Motif set the BGCOLOR attribute before setting the image. /// When set after map will update the TABIMAGE attribute on the respective /// child (since 3.10). /// (since 3.0). /// TABIMAGE (non inheritable) (at children only): Same as TABIMAGEn but set in /// each child. /// Works only if set before the child is added to the tabs. pub fn setTabImage(self: *Self, index: i32, arg: anytype) !void { try interop.validateHandle(.Image, arg); interop.setHandleAttribute(self, "TABIMAGE", .{index}, arg); } pub fn setTabImageHandleName(self: *Self, index: i32, arg: [:0]const u8) void { interop.setStrAttribute(self, "TABIMAGE", .{index}, arg); } /// /// TABTITLEn (non inheritable): Contains the text to be shown in the /// respective tab title. /// n starts at 0. /// If this value is NULL, it will remain empty. /// The "&" character can be used to define a mnemonic, the next character will /// be used as key. /// Use "&&" to show the "&" character instead on defining a mnemonic. /// The button can be activated from any control in the dialog using the /// "Alt+key" combination. /// (mnemonic support since 3.3). /// When set after map will update the TABTITLE attribute on the respective /// child (since 3.10). /// (since 3.0). /// TABTITLE (non inheritable) (at children only): Same as TABTITLEn but set in /// each child. /// Works only if set before the child is added to the tabs. pub fn getTabTitle(self: *Self, index: i32) [:0]const u8 { return interop.getStrAttribute(self, "TABTITLE", .{index}); } /// /// TABTITLEn (non inheritable): Contains the text to be shown in the /// respective tab title. /// n starts at 0. /// If this value is NULL, it will remain empty. /// The "&" character can be used to define a mnemonic, the next character will /// be used as key. /// Use "&&" to show the "&" character instead on defining a mnemonic. /// The button can be activated from any control in the dialog using the /// "Alt+key" combination. /// (mnemonic support since 3.3). /// When set after map will update the TABTITLE attribute on the respective /// child (since 3.10). /// (since 3.0). /// TABTITLE (non inheritable) (at children only): Same as TABTITLEn but set in /// each child. /// Works only if set before the child is added to the tabs. pub fn setTabTitle(self: *Self, index: i32, arg: [:0]const u8) void { interop.setStrAttribute(self, "TABTITLE", .{index}, arg); } pub fn setLDestroyCallback(self: *Self, callback: ?OnLDestroyFn) void { const Handler = CallbackHandler(Self, OnLDestroyFn, "LDESTROY_CB"); Handler.setCallback(self, callback); } /// /// DESTROY_CB DESTROY_CB Called right before an element is destroyed. /// Callback int function(Ihandle *ih); [in C] ih:destroy_cb() -> (ret: number) /// [in Lua] ih: identifier of the element that activated the event. /// Notes If the dialog is visible then it is hidden before it is destroyed. /// The callback will be called right after it is hidden. /// The callback will be called before all other destroy procedures. /// For instance, if the element has children then it is called before the /// children are destroyed. /// For language binding implementations use the callback name "LDESTROY_CB" to /// release memory allocated by the binding for the element. /// Also the callback will be called before the language callback. /// Affects All. pub fn setDestroyCallback(self: *Self, callback: ?OnDestroyFn) void { const Handler = CallbackHandler(Self, OnDestroyFn, "DESTROY_CB"); Handler.setCallback(self, callback); } /// /// MAP_CB MAP_CB Called right after an element is mapped and its attributes /// updated in IupMap. /// When the element is a dialog, it is called after the layout is updated. /// For all other elements is called before the layout is updated, so the /// element current size will still be 0x0 during MAP_CB (since 3.14). /// Callback int function(Ihandle *ih); [in C] ih:map_cb() -> (ret: number) [in /// Lua] ih: identifier of the element that activated the event. /// Affects All that have a native representation. pub fn setMapCallback(self: *Self, callback: ?OnMapFn) void { const Handler = CallbackHandler(Self, OnMapFn, "MAP_CB"); Handler.setCallback(self, callback); } pub fn setPostMessageCallback(self: *Self, callback: ?OnPostMessageFn) void { const Handler = CallbackHandler(Self, OnPostMessageFn, "POSTMESSAGE_CB"); Handler.setCallback(self, callback); } /// /// UNMAP_CB UNMAP_CB Called right before an element is unmapped. /// Callback int function(Ihandle *ih); [in C] ih:unmap_cb() -> (ret: number) /// [in Lua] ih: identifier of the element that activated the event. /// Affects All that have a native representation. pub fn setUnmapCallback(self: *Self, callback: ?OnUnmapFn) void { const Handler = CallbackHandler(Self, OnUnmapFn, "UNMAP_CB"); Handler.setCallback(self, callback); } };
src/elements/param.zig
pub fn isMath(cp: u21) bool { if (cp < 0x2b or cp > 0x1eef1) return false; return switch (cp) { 0x2b => true, 0x3c...0x3e => true, 0x5e => true, 0x7c => true, 0x7e => true, 0xac => true, 0xb1 => true, 0xd7 => true, 0xf7 => true, 0x3d0...0x3d2 => true, 0x3d5 => true, 0x3f0...0x3f1 => true, 0x3f4...0x3f5 => true, 0x3f6 => true, 0x606...0x608 => true, 0x2016 => true, 0x2032...0x2034 => true, 0x2040 => true, 0x2044 => true, 0x2052 => true, 0x2061...0x2064 => true, 0x207a...0x207c => true, 0x207d => true, 0x207e => true, 0x208a...0x208c => true, 0x208d => true, 0x208e => true, 0x20d0...0x20dc => true, 0x20e1 => true, 0x20e5...0x20e6 => true, 0x20eb...0x20ef => true, 0x2102 => true, 0x2107 => true, 0x210a...0x2113 => true, 0x2115 => true, 0x2118 => true, 0x2119...0x211d => true, 0x2124 => true, 0x2128 => true, 0x2129 => true, 0x212c...0x212d => true, 0x212f...0x2131 => true, 0x2133...0x2134 => true, 0x2135...0x2138 => true, 0x213c...0x213f => true, 0x2140...0x2144 => true, 0x2145...0x2149 => true, 0x214b => true, 0x2190...0x2194 => true, 0x2195...0x2199 => true, 0x219a...0x219b => true, 0x219c...0x219f => true, 0x21a0 => true, 0x21a1...0x21a2 => true, 0x21a3 => true, 0x21a4...0x21a5 => true, 0x21a6 => true, 0x21a7 => true, 0x21a9...0x21ad => true, 0x21ae => true, 0x21b0...0x21b1 => true, 0x21b6...0x21b7 => true, 0x21bc...0x21cd => true, 0x21ce...0x21cf => true, 0x21d0...0x21d1 => true, 0x21d2 => true, 0x21d3 => true, 0x21d4 => true, 0x21d5...0x21db => true, 0x21dd => true, 0x21e4...0x21e5 => true, 0x21f4...0x22ff => true, 0x2308 => true, 0x2309 => true, 0x230a => true, 0x230b => true, 0x2320...0x2321 => true, 0x237c => true, 0x239b...0x23b3 => true, 0x23b4...0x23b5 => true, 0x23b7 => true, 0x23d0 => true, 0x23dc...0x23e1 => true, 0x23e2 => true, 0x25a0...0x25a1 => true, 0x25ae...0x25b6 => true, 0x25b7 => true, 0x25bc...0x25c0 => true, 0x25c1 => true, 0x25c6...0x25c7 => true, 0x25ca...0x25cb => true, 0x25cf...0x25d3 => true, 0x25e2 => true, 0x25e4 => true, 0x25e7...0x25ec => true, 0x25f8...0x25ff => true, 0x2605...0x2606 => true, 0x2640 => true, 0x2642 => true, 0x2660...0x2663 => true, 0x266d...0x266e => true, 0x266f => true, 0x27c0...0x27c4 => true, 0x27c5 => true, 0x27c6 => true, 0x27c7...0x27e5 => true, 0x27e6 => true, 0x27e7 => true, 0x27e8 => true, 0x27e9 => true, 0x27ea => true, 0x27eb => true, 0x27ec => true, 0x27ed => true, 0x27ee => true, 0x27ef => true, 0x27f0...0x27ff => true, 0x2900...0x2982 => true, 0x2983 => true, 0x2984 => true, 0x2985 => true, 0x2986 => true, 0x2987 => true, 0x2988 => true, 0x2989 => true, 0x298a => true, 0x298b => true, 0x298c => true, 0x298d => true, 0x298e => true, 0x298f => true, 0x2990 => true, 0x2991 => true, 0x2992 => true, 0x2993 => true, 0x2994 => true, 0x2995 => true, 0x2996 => true, 0x2997 => true, 0x2998 => true, 0x2999...0x29d7 => true, 0x29d8 => true, 0x29d9 => true, 0x29da => true, 0x29db => true, 0x29dc...0x29fb => true, 0x29fc => true, 0x29fd => true, 0x29fe...0x2aff => true, 0x2b30...0x2b44 => true, 0x2b47...0x2b4c => true, 0xfb29 => true, 0xfe61 => true, 0xfe62 => true, 0xfe63 => true, 0xfe64...0xfe66 => true, 0xfe68 => true, 0xff0b => true, 0xff1c...0xff1e => true, 0xff3c => true, 0xff3e => true, 0xff5c => true, 0xff5e => true, 0xffe2 => true, 0xffe9...0xffec => true, 0x1d400...0x1d454 => true, 0x1d456...0x1d49c => true, 0x1d49e...0x1d49f => true, 0x1d4a2 => true, 0x1d4a5...0x1d4a6 => true, 0x1d4a9...0x1d4ac => true, 0x1d4ae...0x1d4b9 => true, 0x1d4bb => true, 0x1d4bd...0x1d4c3 => true, 0x1d4c5...0x1d505 => true, 0x1d507...0x1d50a => true, 0x1d50d...0x1d514 => true, 0x1d516...0x1d51c => true, 0x1d51e...0x1d539 => true, 0x1d53b...0x1d53e => true, 0x1d540...0x1d544 => true, 0x1d546 => true, 0x1d54a...0x1d550 => true, 0x1d552...0x1d6a5 => true, 0x1d6a8...0x1d6c0 => true, 0x1d6c1 => true, 0x1d6c2...0x1d6da => true, 0x1d6db => true, 0x1d6dc...0x1d6fa => true, 0x1d6fb => true, 0x1d6fc...0x1d714 => true, 0x1d715 => true, 0x1d716...0x1d734 => true, 0x1d735 => true, 0x1d736...0x1d74e => true, 0x1d74f => true, 0x1d750...0x1d76e => true, 0x1d76f => true, 0x1d770...0x1d788 => true, 0x1d789 => true, 0x1d78a...0x1d7a8 => true, 0x1d7a9 => true, 0x1d7aa...0x1d7c2 => true, 0x1d7c3 => true, 0x1d7c4...0x1d7cb => true, 0x1d7ce...0x1d7ff => true, 0x1ee00...0x1ee03 => true, 0x1ee05...0x1ee1f => true, 0x1ee21...0x1ee22 => true, 0x1ee24 => true, 0x1ee27 => true, 0x1ee29...0x1ee32 => true, 0x1ee34...0x1ee37 => true, 0x1ee39 => true, 0x1ee3b => true, 0x1ee42 => true, 0x1ee47 => true, 0x1ee49 => true, 0x1ee4b => true, 0x1ee4d...0x1ee4f => true, 0x1ee51...0x1ee52 => true, 0x1ee54 => true, 0x1ee57 => true, 0x1ee59 => true, 0x1ee5b => true, 0x1ee5d => true, 0x1ee5f => true, 0x1ee61...0x1ee62 => true, 0x1ee64 => true, 0x1ee67...0x1ee6a => true, 0x1ee6c...0x1ee72 => true, 0x1ee74...0x1ee77 => true, 0x1ee79...0x1ee7c => true, 0x1ee7e => true, 0x1ee80...0x1ee89 => true, 0x1ee8b...0x1ee9b => true, 0x1eea1...0x1eea3 => true, 0x1eea5...0x1eea9 => true, 0x1eeab...0x1eebb => true, 0x1eef0...0x1eef1 => true, else => false, }; } pub fn isAlphabetic(cp: u21) bool { if (cp < 0x41 or cp > 0x3134a) return false; return switch (cp) { 0x41...0x5a => true, 0x61...0x7a => true, 0xaa => true, 0xb5 => true, 0xba => true, 0xc0...0xd6 => true, 0xd8...0xf6 => true, 0xf8...0x1ba => true, 0x1bb => true, 0x1bc...0x1bf => true, 0x1c0...0x1c3 => true, 0x1c4...0x293 => true, 0x294 => true, 0x295...0x2af => true, 0x2b0...0x2c1 => true, 0x2c6...0x2d1 => true, 0x2e0...0x2e4 => true, 0x2ec => true, 0x2ee => true, 0x345 => true, 0x370...0x373 => true, 0x374 => true, 0x376...0x377 => true, 0x37a => true, 0x37b...0x37d => true, 0x37f => true, 0x386 => true, 0x388...0x38a => true, 0x38c => true, 0x38e...0x3a1 => true, 0x3a3...0x3f5 => true, 0x3f7...0x481 => true, 0x48a...0x52f => true, 0x531...0x556 => true, 0x559 => true, 0x560...0x588 => true, 0x5b0...0x5bd => true, 0x5bf => true, 0x5c1...0x5c2 => true, 0x5c4...0x5c5 => true, 0x5c7 => true, 0x5d0...0x5ea => true, 0x5ef...0x5f2 => true, 0x610...0x61a => true, 0x620...0x63f => true, 0x640 => true, 0x641...0x64a => true, 0x64b...0x657 => true, 0x659...0x65f => true, 0x66e...0x66f => true, 0x670 => true, 0x671...0x6d3 => true, 0x6d5 => true, 0x6d6...0x6dc => true, 0x6e1...0x6e4 => true, 0x6e5...0x6e6 => true, 0x6e7...0x6e8 => true, 0x6ed => true, 0x6ee...0x6ef => true, 0x6fa...0x6fc => true, 0x6ff => true, 0x710 => true, 0x711 => true, 0x712...0x72f => true, 0x730...0x73f => true, 0x74d...0x7a5 => true, 0x7a6...0x7b0 => true, 0x7b1 => true, 0x7ca...0x7ea => true, 0x7f4...0x7f5 => true, 0x7fa => true, 0x800...0x815 => true, 0x816...0x817 => true, 0x81a => true, 0x81b...0x823 => true, 0x824 => true, 0x825...0x827 => true, 0x828 => true, 0x829...0x82c => true, 0x840...0x858 => true, 0x860...0x86a => true, 0x870...0x887 => true, 0x889...0x88e => true, 0x8a0...0x8c8 => true, 0x8c9 => true, 0x8d4...0x8df => true, 0x8e3...0x8e9 => true, 0x8f0...0x902 => true, 0x903 => true, 0x904...0x939 => true, 0x93a => true, 0x93b => true, 0x93d => true, 0x93e...0x940 => true, 0x941...0x948 => true, 0x949...0x94c => true, 0x94e...0x94f => true, 0x950 => true, 0x955...0x957 => true, 0x958...0x961 => true, 0x962...0x963 => true, 0x971 => true, 0x972...0x980 => true, 0x981 => true, 0x982...0x983 => true, 0x985...0x98c => true, 0x98f...0x990 => true, 0x993...0x9a8 => true, 0x9aa...0x9b0 => true, 0x9b2 => true, 0x9b6...0x9b9 => true, 0x9bd => true, 0x9be...0x9c0 => true, 0x9c1...0x9c4 => true, 0x9c7...0x9c8 => true, 0x9cb...0x9cc => true, 0x9ce => true, 0x9d7 => true, 0x9dc...0x9dd => true, 0x9df...0x9e1 => true, 0x9e2...0x9e3 => true, 0x9f0...0x9f1 => true, 0x9fc => true, 0xa01...0xa02 => true, 0xa03 => true, 0xa05...0xa0a => true, 0xa0f...0xa10 => true, 0xa13...0xa28 => true, 0xa2a...0xa30 => true, 0xa32...0xa33 => true, 0xa35...0xa36 => true, 0xa38...0xa39 => true, 0xa3e...0xa40 => true, 0xa41...0xa42 => true, 0xa47...0xa48 => true, 0xa4b...0xa4c => true, 0xa51 => true, 0xa59...0xa5c => true, 0xa5e => true, 0xa70...0xa71 => true, 0xa72...0xa74 => true, 0xa75 => true, 0xa81...0xa82 => true, 0xa83 => true, 0xa85...0xa8d => true, 0xa8f...0xa91 => true, 0xa93...0xaa8 => true, 0xaaa...0xab0 => true, 0xab2...0xab3 => true, 0xab5...0xab9 => true, 0xabd => true, 0xabe...0xac0 => true, 0xac1...0xac5 => true, 0xac7...0xac8 => true, 0xac9 => true, 0xacb...0xacc => true, 0xad0 => true, 0xae0...0xae1 => true, 0xae2...0xae3 => true, 0xaf9 => true, 0xafa...0xafc => true, 0xb01 => true, 0xb02...0xb03 => true, 0xb05...0xb0c => true, 0xb0f...0xb10 => true, 0xb13...0xb28 => true, 0xb2a...0xb30 => true, 0xb32...0xb33 => true, 0xb35...0xb39 => true, 0xb3d => true, 0xb3e => true, 0xb3f => true, 0xb40 => true, 0xb41...0xb44 => true, 0xb47...0xb48 => true, 0xb4b...0xb4c => true, 0xb56 => true, 0xb57 => true, 0xb5c...0xb5d => true, 0xb5f...0xb61 => true, 0xb62...0xb63 => true, 0xb71 => true, 0xb82 => true, 0xb83 => true, 0xb85...0xb8a => true, 0xb8e...0xb90 => true, 0xb92...0xb95 => true, 0xb99...0xb9a => true, 0xb9c => true, 0xb9e...0xb9f => true, 0xba3...0xba4 => true, 0xba8...0xbaa => true, 0xbae...0xbb9 => true, 0xbbe...0xbbf => true, 0xbc0 => true, 0xbc1...0xbc2 => true, 0xbc6...0xbc8 => true, 0xbca...0xbcc => true, 0xbd0 => true, 0xbd7 => true, 0xc00 => true, 0xc01...0xc03 => true, 0xc05...0xc0c => true, 0xc0e...0xc10 => true, 0xc12...0xc28 => true, 0xc2a...0xc39 => true, 0xc3d => true, 0xc3e...0xc40 => true, 0xc41...0xc44 => true, 0xc46...0xc48 => true, 0xc4a...0xc4c => true, 0xc55...0xc56 => true, 0xc58...0xc5a => true, 0xc5d => true, 0xc60...0xc61 => true, 0xc62...0xc63 => true, 0xc80 => true, 0xc81 => true, 0xc82...0xc83 => true, 0xc85...0xc8c => true, 0xc8e...0xc90 => true, 0xc92...0xca8 => true, 0xcaa...0xcb3 => true, 0xcb5...0xcb9 => true, 0xcbd => true, 0xcbe => true, 0xcbf => true, 0xcc0...0xcc4 => true, 0xcc6 => true, 0xcc7...0xcc8 => true, 0xcca...0xccb => true, 0xccc => true, 0xcd5...0xcd6 => true, 0xcdd...0xcde => true, 0xce0...0xce1 => true, 0xce2...0xce3 => true, 0xcf1...0xcf2 => true, 0xd00...0xd01 => true, 0xd02...0xd03 => true, 0xd04...0xd0c => true, 0xd0e...0xd10 => true, 0xd12...0xd3a => true, 0xd3d => true, 0xd3e...0xd40 => true, 0xd41...0xd44 => true, 0xd46...0xd48 => true, 0xd4a...0xd4c => true, 0xd4e => true, 0xd54...0xd56 => true, 0xd57 => true, 0xd5f...0xd61 => true, 0xd62...0xd63 => true, 0xd7a...0xd7f => true, 0xd81 => true, 0xd82...0xd83 => true, 0xd85...0xd96 => true, 0xd9a...0xdb1 => true, 0xdb3...0xdbb => true, 0xdbd => true, 0xdc0...0xdc6 => true, 0xdcf...0xdd1 => true, 0xdd2...0xdd4 => true, 0xdd6 => true, 0xdd8...0xddf => true, 0xdf2...0xdf3 => true, 0xe01...0xe30 => true, 0xe31 => true, 0xe32...0xe33 => true, 0xe34...0xe3a => true, 0xe40...0xe45 => true, 0xe46 => true, 0xe4d => true, 0xe81...0xe82 => true, 0xe84 => true, 0xe86...0xe8a => true, 0xe8c...0xea3 => true, 0xea5 => true, 0xea7...0xeb0 => true, 0xeb1 => true, 0xeb2...0xeb3 => true, 0xeb4...0xeb9 => true, 0xebb...0xebc => true, 0xebd => true, 0xec0...0xec4 => true, 0xec6 => true, 0xecd => true, 0xedc...0xedf => true, 0xf00 => true, 0xf40...0xf47 => true, 0xf49...0xf6c => true, 0xf71...0xf7e => true, 0xf7f => true, 0xf80...0xf81 => true, 0xf88...0xf8c => true, 0xf8d...0xf97 => true, 0xf99...0xfbc => true, 0x1000...0x102a => true, 0x102b...0x102c => true, 0x102d...0x1030 => true, 0x1031 => true, 0x1032...0x1036 => true, 0x1038 => true, 0x103b...0x103c => true, 0x103d...0x103e => true, 0x103f => true, 0x1050...0x1055 => true, 0x1056...0x1057 => true, 0x1058...0x1059 => true, 0x105a...0x105d => true, 0x105e...0x1060 => true, 0x1061 => true, 0x1062...0x1064 => true, 0x1065...0x1066 => true, 0x1067...0x106d => true, 0x106e...0x1070 => true, 0x1071...0x1074 => true, 0x1075...0x1081 => true, 0x1082 => true, 0x1083...0x1084 => true, 0x1085...0x1086 => true, 0x1087...0x108c => true, 0x108d => true, 0x108e => true, 0x108f => true, 0x109a...0x109c => true, 0x109d => true, 0x10a0...0x10c5 => true, 0x10c7 => true, 0x10cd => true, 0x10d0...0x10fa => true, 0x10fc => true, 0x10fd...0x10ff => true, 0x1100...0x1248 => true, 0x124a...0x124d => true, 0x1250...0x1256 => true, 0x1258 => true, 0x125a...0x125d => true, 0x1260...0x1288 => true, 0x128a...0x128d => true, 0x1290...0x12b0 => true, 0x12b2...0x12b5 => true, 0x12b8...0x12be => true, 0x12c0 => true, 0x12c2...0x12c5 => true, 0x12c8...0x12d6 => true, 0x12d8...0x1310 => true, 0x1312...0x1315 => true, 0x1318...0x135a => true, 0x1380...0x138f => true, 0x13a0...0x13f5 => true, 0x13f8...0x13fd => true, 0x1401...0x166c => true, 0x166f...0x167f => true, 0x1681...0x169a => true, 0x16a0...0x16ea => true, 0x16ee...0x16f0 => true, 0x16f1...0x16f8 => true, 0x1700...0x1711 => true, 0x1712...0x1713 => true, 0x171f...0x1731 => true, 0x1732...0x1733 => true, 0x1740...0x1751 => true, 0x1752...0x1753 => true, 0x1760...0x176c => true, 0x176e...0x1770 => true, 0x1772...0x1773 => true, 0x1780...0x17b3 => true, 0x17b6 => true, 0x17b7...0x17bd => true, 0x17be...0x17c5 => true, 0x17c6 => true, 0x17c7...0x17c8 => true, 0x17d7 => true, 0x17dc => true, 0x1820...0x1842 => true, 0x1843 => true, 0x1844...0x1878 => true, 0x1880...0x1884 => true, 0x1885...0x1886 => true, 0x1887...0x18a8 => true, 0x18a9 => true, 0x18aa => true, 0x18b0...0x18f5 => true, 0x1900...0x191e => true, 0x1920...0x1922 => true, 0x1923...0x1926 => true, 0x1927...0x1928 => true, 0x1929...0x192b => true, 0x1930...0x1931 => true, 0x1932 => true, 0x1933...0x1938 => true, 0x1950...0x196d => true, 0x1970...0x1974 => true, 0x1980...0x19ab => true, 0x19b0...0x19c9 => true, 0x1a00...0x1a16 => true, 0x1a17...0x1a18 => true, 0x1a19...0x1a1a => true, 0x1a1b => true, 0x1a20...0x1a54 => true, 0x1a55 => true, 0x1a56 => true, 0x1a57 => true, 0x1a58...0x1a5e => true, 0x1a61 => true, 0x1a62 => true, 0x1a63...0x1a64 => true, 0x1a65...0x1a6c => true, 0x1a6d...0x1a72 => true, 0x1a73...0x1a74 => true, 0x1aa7 => true, 0x1abf...0x1ac0 => true, 0x1acc...0x1ace => true, 0x1b00...0x1b03 => true, 0x1b04 => true, 0x1b05...0x1b33 => true, 0x1b35 => true, 0x1b36...0x1b3a => true, 0x1b3b => true, 0x1b3c => true, 0x1b3d...0x1b41 => true, 0x1b42 => true, 0x1b43 => true, 0x1b45...0x1b4c => true, 0x1b80...0x1b81 => true, 0x1b82 => true, 0x1b83...0x1ba0 => true, 0x1ba1 => true, 0x1ba2...0x1ba5 => true, 0x1ba6...0x1ba7 => true, 0x1ba8...0x1ba9 => true, 0x1bac...0x1bad => true, 0x1bae...0x1baf => true, 0x1bba...0x1be5 => true, 0x1be7 => true, 0x1be8...0x1be9 => true, 0x1bea...0x1bec => true, 0x1bed => true, 0x1bee => true, 0x1bef...0x1bf1 => true, 0x1c00...0x1c23 => true, 0x1c24...0x1c2b => true, 0x1c2c...0x1c33 => true, 0x1c34...0x1c35 => true, 0x1c36 => true, 0x1c4d...0x1c4f => true, 0x1c5a...0x1c77 => true, 0x1c78...0x1c7d => true, 0x1c80...0x1c88 => true, 0x1c90...0x1cba => true, 0x1cbd...0x1cbf => true, 0x1ce9...0x1cec => true, 0x1cee...0x1cf3 => true, 0x1cf5...0x1cf6 => true, 0x1cfa => true, 0x1d00...0x1d2b => true, 0x1d2c...0x1d6a => true, 0x1d6b...0x1d77 => true, 0x1d78 => true, 0x1d79...0x1d9a => true, 0x1d9b...0x1dbf => true, 0x1de7...0x1df4 => true, 0x1e00...0x1f15 => true, 0x1f18...0x1f1d => true, 0x1f20...0x1f45 => true, 0x1f48...0x1f4d => true, 0x1f50...0x1f57 => true, 0x1f59 => true, 0x1f5b => true, 0x1f5d => true, 0x1f5f...0x1f7d => true, 0x1f80...0x1fb4 => true, 0x1fb6...0x1fbc => true, 0x1fbe => true, 0x1fc2...0x1fc4 => true, 0x1fc6...0x1fcc => true, 0x1fd0...0x1fd3 => true, 0x1fd6...0x1fdb => true, 0x1fe0...0x1fec => true, 0x1ff2...0x1ff4 => true, 0x1ff6...0x1ffc => true, 0x2071 => true, 0x207f => true, 0x2090...0x209c => true, 0x2102 => true, 0x2107 => true, 0x210a...0x2113 => true, 0x2115 => true, 0x2119...0x211d => true, 0x2124 => true, 0x2126 => true, 0x2128 => true, 0x212a...0x212d => true, 0x212f...0x2134 => true, 0x2135...0x2138 => true, 0x2139 => true, 0x213c...0x213f => true, 0x2145...0x2149 => true, 0x214e => true, 0x2160...0x2182 => true, 0x2183...0x2184 => true, 0x2185...0x2188 => true, 0x24b6...0x24e9 => true, 0x2c00...0x2c7b => true, 0x2c7c...0x2c7d => true, 0x2c7e...0x2ce4 => true, 0x2ceb...0x2cee => true, 0x2cf2...0x2cf3 => true, 0x2d00...0x2d25 => true, 0x2d27 => true, 0x2d2d => true, 0x2d30...0x2d67 => true, 0x2d6f => true, 0x2d80...0x2d96 => true, 0x2da0...0x2da6 => true, 0x2da8...0x2dae => true, 0x2db0...0x2db6 => true, 0x2db8...0x2dbe => true, 0x2dc0...0x2dc6 => true, 0x2dc8...0x2dce => true, 0x2dd0...0x2dd6 => true, 0x2dd8...0x2dde => true, 0x2de0...0x2dff => true, 0x2e2f => true, 0x3005 => true, 0x3006 => true, 0x3007 => true, 0x3021...0x3029 => true, 0x3031...0x3035 => true, 0x3038...0x303a => true, 0x303b => true, 0x303c => true, 0x3041...0x3096 => true, 0x309d...0x309e => true, 0x309f => true, 0x30a1...0x30fa => true, 0x30fc...0x30fe => true, 0x30ff => true, 0x3105...0x312f => true, 0x3131...0x318e => true, 0x31a0...0x31bf => true, 0x31f0...0x31ff => true, 0x3400...0x4dbf => true, 0x4e00...0xa014 => true, 0xa015 => true, 0xa016...0xa48c => true, 0xa4d0...0xa4f7 => true, 0xa4f8...0xa4fd => true, 0xa500...0xa60b => true, 0xa60c => true, 0xa610...0xa61f => true, 0xa62a...0xa62b => true, 0xa640...0xa66d => true, 0xa66e => true, 0xa674...0xa67b => true, 0xa67f => true, 0xa680...0xa69b => true, 0xa69c...0xa69d => true, 0xa69e...0xa69f => true, 0xa6a0...0xa6e5 => true, 0xa6e6...0xa6ef => true, 0xa717...0xa71f => true, 0xa722...0xa76f => true, 0xa770 => true, 0xa771...0xa787 => true, 0xa788 => true, 0xa78b...0xa78e => true, 0xa78f => true, 0xa790...0xa7ca => true, 0xa7d0...0xa7d1 => true, 0xa7d3 => true, 0xa7d5...0xa7d9 => true, 0xa7f2...0xa7f4 => true, 0xa7f5...0xa7f6 => true, 0xa7f7 => true, 0xa7f8...0xa7f9 => true, 0xa7fa => true, 0xa7fb...0xa801 => true, 0xa802 => true, 0xa803...0xa805 => true, 0xa807...0xa80a => true, 0xa80b => true, 0xa80c...0xa822 => true, 0xa823...0xa824 => true, 0xa825...0xa826 => true, 0xa827 => true, 0xa840...0xa873 => true, 0xa880...0xa881 => true, 0xa882...0xa8b3 => true, 0xa8b4...0xa8c3 => true, 0xa8c5 => true, 0xa8f2...0xa8f7 => true, 0xa8fb => true, 0xa8fd...0xa8fe => true, 0xa8ff => true, 0xa90a...0xa925 => true, 0xa926...0xa92a => true, 0xa930...0xa946 => true, 0xa947...0xa951 => true, 0xa952 => true, 0xa960...0xa97c => true, 0xa980...0xa982 => true, 0xa983 => true, 0xa984...0xa9b2 => true, 0xa9b4...0xa9b5 => true, 0xa9b6...0xa9b9 => true, 0xa9ba...0xa9bb => true, 0xa9bc...0xa9bd => true, 0xa9be...0xa9bf => true, 0xa9cf => true, 0xa9e0...0xa9e4 => true, 0xa9e5 => true, 0xa9e6 => true, 0xa9e7...0xa9ef => true, 0xa9fa...0xa9fe => true, 0xaa00...0xaa28 => true, 0xaa29...0xaa2e => true, 0xaa2f...0xaa30 => true, 0xaa31...0xaa32 => true, 0xaa33...0xaa34 => true, 0xaa35...0xaa36 => true, 0xaa40...0xaa42 => true, 0xaa43 => true, 0xaa44...0xaa4b => true, 0xaa4c => true, 0xaa4d => true, 0xaa60...0xaa6f => true, 0xaa70 => true, 0xaa71...0xaa76 => true, 0xaa7a => true, 0xaa7b => true, 0xaa7c => true, 0xaa7d => true, 0xaa7e...0xaaaf => true, 0xaab0 => true, 0xaab1 => true, 0xaab2...0xaab4 => true, 0xaab5...0xaab6 => true, 0xaab7...0xaab8 => true, 0xaab9...0xaabd => true, 0xaabe => true, 0xaac0 => true, 0xaac2 => true, 0xaadb...0xaadc => true, 0xaadd => true, 0xaae0...0xaaea => true, 0xaaeb => true, 0xaaec...0xaaed => true, 0xaaee...0xaaef => true, 0xaaf2 => true, 0xaaf3...0xaaf4 => true, 0xaaf5 => true, 0xab01...0xab06 => true, 0xab09...0xab0e => true, 0xab11...0xab16 => true, 0xab20...0xab26 => true, 0xab28...0xab2e => true, 0xab30...0xab5a => true, 0xab5c...0xab5f => true, 0xab60...0xab68 => true, 0xab69 => true, 0xab70...0xabbf => true, 0xabc0...0xabe2 => true, 0xabe3...0xabe4 => true, 0xabe5 => true, 0xabe6...0xabe7 => true, 0xabe8 => true, 0xabe9...0xabea => true, 0xac00...0xd7a3 => true, 0xd7b0...0xd7c6 => true, 0xd7cb...0xd7fb => true, 0xf900...0xfa6d => true, 0xfa70...0xfad9 => true, 0xfb00...0xfb06 => true, 0xfb13...0xfb17 => true, 0xfb1d => true, 0xfb1e => true, 0xfb1f...0xfb28 => true, 0xfb2a...0xfb36 => true, 0xfb38...0xfb3c => true, 0xfb3e => true, 0xfb40...0xfb41 => true, 0xfb43...0xfb44 => true, 0xfb46...0xfbb1 => true, 0xfbd3...0xfd3d => true, 0xfd50...0xfd8f => true, 0xfd92...0xfdc7 => true, 0xfdf0...0xfdfb => true, 0xfe70...0xfe74 => true, 0xfe76...0xfefc => true, 0xff21...0xff3a => true, 0xff41...0xff5a => true, 0xff66...0xff6f => true, 0xff70 => true, 0xff71...0xff9d => true, 0xff9e...0xff9f => true, 0xffa0...0xffbe => true, 0xffc2...0xffc7 => true, 0xffca...0xffcf => true, 0xffd2...0xffd7 => true, 0xffda...0xffdc => true, 0x10000...0x1000b => true, 0x1000d...0x10026 => true, 0x10028...0x1003a => true, 0x1003c...0x1003d => true, 0x1003f...0x1004d => true, 0x10050...0x1005d => true, 0x10080...0x100fa => true, 0x10140...0x10174 => true, 0x10280...0x1029c => true, 0x102a0...0x102d0 => true, 0x10300...0x1031f => true, 0x1032d...0x10340 => true, 0x10341 => true, 0x10342...0x10349 => true, 0x1034a => true, 0x10350...0x10375 => true, 0x10376...0x1037a => true, 0x10380...0x1039d => true, 0x103a0...0x103c3 => true, 0x103c8...0x103cf => true, 0x103d1...0x103d5 => true, 0x10400...0x1044f => true, 0x10450...0x1049d => true, 0x104b0...0x104d3 => true, 0x104d8...0x104fb => true, 0x10500...0x10527 => true, 0x10530...0x10563 => true, 0x10570...0x1057a => true, 0x1057c...0x1058a => true, 0x1058c...0x10592 => true, 0x10594...0x10595 => true, 0x10597...0x105a1 => true, 0x105a3...0x105b1 => true, 0x105b3...0x105b9 => true, 0x105bb...0x105bc => true, 0x10600...0x10736 => true, 0x10740...0x10755 => true, 0x10760...0x10767 => true, 0x10780...0x10785 => true, 0x10787...0x107b0 => true, 0x107b2...0x107ba => true, 0x10800...0x10805 => true, 0x10808 => true, 0x1080a...0x10835 => true, 0x10837...0x10838 => true, 0x1083c => true, 0x1083f...0x10855 => true, 0x10860...0x10876 => true, 0x10880...0x1089e => true, 0x108e0...0x108f2 => true, 0x108f4...0x108f5 => true, 0x10900...0x10915 => true, 0x10920...0x10939 => true, 0x10980...0x109b7 => true, 0x109be...0x109bf => true, 0x10a00 => true, 0x10a01...0x10a03 => true, 0x10a05...0x10a06 => true, 0x10a0c...0x10a0f => true, 0x10a10...0x10a13 => true, 0x10a15...0x10a17 => true, 0x10a19...0x10a35 => true, 0x10a60...0x10a7c => true, 0x10a80...0x10a9c => true, 0x10ac0...0x10ac7 => true, 0x10ac9...0x10ae4 => true, 0x10b00...0x10b35 => true, 0x10b40...0x10b55 => true, 0x10b60...0x10b72 => true, 0x10b80...0x10b91 => true, 0x10c00...0x10c48 => true, 0x10c80...0x10cb2 => true, 0x10cc0...0x10cf2 => true, 0x10d00...0x10d23 => true, 0x10d24...0x10d27 => true, 0x10e80...0x10ea9 => true, 0x10eab...0x10eac => true, 0x10eb0...0x10eb1 => true, 0x10f00...0x10f1c => true, 0x10f27 => true, 0x10f30...0x10f45 => true, 0x10f70...0x10f81 => true, 0x10fb0...0x10fc4 => true, 0x10fe0...0x10ff6 => true, 0x11000 => true, 0x11001 => true, 0x11002 => true, 0x11003...0x11037 => true, 0x11038...0x11045 => true, 0x11071...0x11072 => true, 0x11073...0x11074 => true, 0x11075 => true, 0x11082 => true, 0x11083...0x110af => true, 0x110b0...0x110b2 => true, 0x110b3...0x110b6 => true, 0x110b7...0x110b8 => true, 0x110c2 => true, 0x110d0...0x110e8 => true, 0x11100...0x11102 => true, 0x11103...0x11126 => true, 0x11127...0x1112b => true, 0x1112c => true, 0x1112d...0x11132 => true, 0x11144 => true, 0x11145...0x11146 => true, 0x11147 => true, 0x11150...0x11172 => true, 0x11176 => true, 0x11180...0x11181 => true, 0x11182 => true, 0x11183...0x111b2 => true, 0x111b3...0x111b5 => true, 0x111b6...0x111be => true, 0x111bf => true, 0x111c1...0x111c4 => true, 0x111ce => true, 0x111cf => true, 0x111da => true, 0x111dc => true, 0x11200...0x11211 => true, 0x11213...0x1122b => true, 0x1122c...0x1122e => true, 0x1122f...0x11231 => true, 0x11232...0x11233 => true, 0x11234 => true, 0x11237 => true, 0x1123e => true, 0x11280...0x11286 => true, 0x11288 => true, 0x1128a...0x1128d => true, 0x1128f...0x1129d => true, 0x1129f...0x112a8 => true, 0x112b0...0x112de => true, 0x112df => true, 0x112e0...0x112e2 => true, 0x112e3...0x112e8 => true, 0x11300...0x11301 => true, 0x11302...0x11303 => true, 0x11305...0x1130c => true, 0x1130f...0x11310 => true, 0x11313...0x11328 => true, 0x1132a...0x11330 => true, 0x11332...0x11333 => true, 0x11335...0x11339 => true, 0x1133d => true, 0x1133e...0x1133f => true, 0x11340 => true, 0x11341...0x11344 => true, 0x11347...0x11348 => true, 0x1134b...0x1134c => true, 0x11350 => true, 0x11357 => true, 0x1135d...0x11361 => true, 0x11362...0x11363 => true, 0x11400...0x11434 => true, 0x11435...0x11437 => true, 0x11438...0x1143f => true, 0x11440...0x11441 => true, 0x11443...0x11444 => true, 0x11445 => true, 0x11447...0x1144a => true, 0x1145f...0x11461 => true, 0x11480...0x114af => true, 0x114b0...0x114b2 => true, 0x114b3...0x114b8 => true, 0x114b9 => true, 0x114ba => true, 0x114bb...0x114be => true, 0x114bf...0x114c0 => true, 0x114c1 => true, 0x114c4...0x114c5 => true, 0x114c7 => true, 0x11580...0x115ae => true, 0x115af...0x115b1 => true, 0x115b2...0x115b5 => true, 0x115b8...0x115bb => true, 0x115bc...0x115bd => true, 0x115be => true, 0x115d8...0x115db => true, 0x115dc...0x115dd => true, 0x11600...0x1162f => true, 0x11630...0x11632 => true, 0x11633...0x1163a => true, 0x1163b...0x1163c => true, 0x1163d => true, 0x1163e => true, 0x11640 => true, 0x11644 => true, 0x11680...0x116aa => true, 0x116ab => true, 0x116ac => true, 0x116ad => true, 0x116ae...0x116af => true, 0x116b0...0x116b5 => true, 0x116b8 => true, 0x11700...0x1171a => true, 0x1171d...0x1171f => true, 0x11720...0x11721 => true, 0x11722...0x11725 => true, 0x11726 => true, 0x11727...0x1172a => true, 0x11740...0x11746 => true, 0x11800...0x1182b => true, 0x1182c...0x1182e => true, 0x1182f...0x11837 => true, 0x11838 => true, 0x118a0...0x118df => true, 0x118ff...0x11906 => true, 0x11909 => true, 0x1190c...0x11913 => true, 0x11915...0x11916 => true, 0x11918...0x1192f => true, 0x11930...0x11935 => true, 0x11937...0x11938 => true, 0x1193b...0x1193c => true, 0x1193f => true, 0x11940 => true, 0x11941 => true, 0x11942 => true, 0x119a0...0x119a7 => true, 0x119aa...0x119d0 => true, 0x119d1...0x119d3 => true, 0x119d4...0x119d7 => true, 0x119da...0x119db => true, 0x119dc...0x119df => true, 0x119e1 => true, 0x119e3 => true, 0x119e4 => true, 0x11a00 => true, 0x11a01...0x11a0a => true, 0x11a0b...0x11a32 => true, 0x11a35...0x11a38 => true, 0x11a39 => true, 0x11a3a => true, 0x11a3b...0x11a3e => true, 0x11a50 => true, 0x11a51...0x11a56 => true, 0x11a57...0x11a58 => true, 0x11a59...0x11a5b => true, 0x11a5c...0x11a89 => true, 0x11a8a...0x11a96 => true, 0x11a97 => true, 0x11a9d => true, 0x11ab0...0x11af8 => true, 0x11c00...0x11c08 => true, 0x11c0a...0x11c2e => true, 0x11c2f => true, 0x11c30...0x11c36 => true, 0x11c38...0x11c3d => true, 0x11c3e => true, 0x11c40 => true, 0x11c72...0x11c8f => true, 0x11c92...0x11ca7 => true, 0x11ca9 => true, 0x11caa...0x11cb0 => true, 0x11cb1 => true, 0x11cb2...0x11cb3 => true, 0x11cb4 => true, 0x11cb5...0x11cb6 => true, 0x11d00...0x11d06 => true, 0x11d08...0x11d09 => true, 0x11d0b...0x11d30 => true, 0x11d31...0x11d36 => true, 0x11d3a => true, 0x11d3c...0x11d3d => true, 0x11d3f...0x11d41 => true, 0x11d43 => true, 0x11d46 => true, 0x11d47 => true, 0x11d60...0x11d65 => true, 0x11d67...0x11d68 => true, 0x11d6a...0x11d89 => true, 0x11d8a...0x11d8e => true, 0x11d90...0x11d91 => true, 0x11d93...0x11d94 => true, 0x11d95 => true, 0x11d96 => true, 0x11d98 => true, 0x11ee0...0x11ef2 => true, 0x11ef3...0x11ef4 => true, 0x11ef5...0x11ef6 => true, 0x11fb0 => true, 0x12000...0x12399 => true, 0x12400...0x1246e => true, 0x12480...0x12543 => true, 0x12f90...0x12ff0 => true, 0x13000...0x1342e => true, 0x14400...0x14646 => true, 0x16800...0x16a38 => true, 0x16a40...0x16a5e => true, 0x16a70...0x16abe => true, 0x16ad0...0x16aed => true, 0x16b00...0x16b2f => true, 0x16b40...0x16b43 => true, 0x16b63...0x16b77 => true, 0x16b7d...0x16b8f => true, 0x16e40...0x16e7f => true, 0x16f00...0x16f4a => true, 0x16f4f => true, 0x16f50 => true, 0x16f51...0x16f87 => true, 0x16f8f...0x16f92 => true, 0x16f93...0x16f9f => true, 0x16fe0...0x16fe1 => true, 0x16fe3 => true, 0x16ff0...0x16ff1 => true, 0x17000...0x187f7 => true, 0x18800...0x18cd5 => true, 0x18d00...0x18d08 => true, 0x1aff0...0x1aff3 => true, 0x1aff5...0x1affb => true, 0x1affd...0x1affe => true, 0x1b000...0x1b122 => true, 0x1b150...0x1b152 => true, 0x1b164...0x1b167 => true, 0x1b170...0x1b2fb => true, 0x1bc00...0x1bc6a => true, 0x1bc70...0x1bc7c => true, 0x1bc80...0x1bc88 => true, 0x1bc90...0x1bc99 => true, 0x1bc9e => true, 0x1d400...0x1d454 => true, 0x1d456...0x1d49c => true, 0x1d49e...0x1d49f => true, 0x1d4a2 => true, 0x1d4a5...0x1d4a6 => true, 0x1d4a9...0x1d4ac => true, 0x1d4ae...0x1d4b9 => true, 0x1d4bb => true, 0x1d4bd...0x1d4c3 => true, 0x1d4c5...0x1d505 => true, 0x1d507...0x1d50a => true, 0x1d50d...0x1d514 => true, 0x1d516...0x1d51c => true, 0x1d51e...0x1d539 => true, 0x1d53b...0x1d53e => true, 0x1d540...0x1d544 => true, 0x1d546 => true, 0x1d54a...0x1d550 => true, 0x1d552...0x1d6a5 => true, 0x1d6a8...0x1d6c0 => true, 0x1d6c2...0x1d6da => true, 0x1d6dc...0x1d6fa => true, 0x1d6fc...0x1d714 => true, 0x1d716...0x1d734 => true, 0x1d736...0x1d74e => true, 0x1d750...0x1d76e => true, 0x1d770...0x1d788 => true, 0x1d78a...0x1d7a8 => true, 0x1d7aa...0x1d7c2 => true, 0x1d7c4...0x1d7cb => true, 0x1df00...0x1df09 => true, 0x1df0a => true, 0x1df0b...0x1df1e => true, 0x1e000...0x1e006 => true, 0x1e008...0x1e018 => true, 0x1e01b...0x1e021 => true, 0x1e023...0x1e024 => true, 0x1e026...0x1e02a => true, 0x1e100...0x1e12c => true, 0x1e137...0x1e13d => true, 0x1e14e => true, 0x1e290...0x1e2ad => true, 0x1e2c0...0x1e2eb => true, 0x1e7e0...0x1e7e6 => true, 0x1e7e8...0x1e7eb => true, 0x1e7ed...0x1e7ee => true, 0x1e7f0...0x1e7fe => true, 0x1e800...0x1e8c4 => true, 0x1e900...0x1e943 => true, 0x1e947 => true, 0x1e94b => true, 0x1ee00...0x1ee03 => true, 0x1ee05...0x1ee1f => true, 0x1ee21...0x1ee22 => true, 0x1ee24 => true, 0x1ee27 => true, 0x1ee29...0x1ee32 => true, 0x1ee34...0x1ee37 => true, 0x1ee39 => true, 0x1ee3b => true, 0x1ee42 => true, 0x1ee47 => true, 0x1ee49 => true, 0x1ee4b => true, 0x1ee4d...0x1ee4f => true, 0x1ee51...0x1ee52 => true, 0x1ee54 => true, 0x1ee57 => true, 0x1ee59 => true, 0x1ee5b => true, 0x1ee5d => true, 0x1ee5f => true, 0x1ee61...0x1ee62 => true, 0x1ee64 => true, 0x1ee67...0x1ee6a => true, 0x1ee6c...0x1ee72 => true, 0x1ee74...0x1ee77 => true, 0x1ee79...0x1ee7c => true, 0x1ee7e => true, 0x1ee80...0x1ee89 => true, 0x1ee8b...0x1ee9b => true, 0x1eea1...0x1eea3 => true, 0x1eea5...0x1eea9 => true, 0x1eeab...0x1eebb => true, 0x1f130...0x1f149 => true, 0x1f150...0x1f169 => true, 0x1f170...0x1f189 => true, 0x20000...0x2a6df => true, 0x2a700...0x2b738 => true, 0x2b740...0x2b81d => true, 0x2b820...0x2cea1 => true, 0x2ceb0...0x2ebe0 => true, 0x2f800...0x2fa1d => true, 0x30000...0x3134a => true, else => false, }; } pub fn isLowercase(cp: u21) bool { if (cp < 0x61 or cp > 0x1e943) return false; return switch (cp) { 0x61...0x7a => true, 0xaa => true, 0xb5 => true, 0xba => true, 0xdf...0xf6 => true, 0xf8...0xff => true, 0x101 => true, 0x103 => true, 0x105 => true, 0x107 => true, 0x109 => true, 0x10b => true, 0x10d => true, 0x10f => true, 0x111 => true, 0x113 => true, 0x115 => true, 0x117 => true, 0x119 => true, 0x11b => true, 0x11d => true, 0x11f => true, 0x121 => true, 0x123 => true, 0x125 => true, 0x127 => true, 0x129 => true, 0x12b => true, 0x12d => true, 0x12f => true, 0x131 => true, 0x133 => true, 0x135 => true, 0x137...0x138 => true, 0x13a => true, 0x13c => true, 0x13e => true, 0x140 => true, 0x142 => true, 0x144 => true, 0x146 => true, 0x148...0x149 => true, 0x14b => true, 0x14d => true, 0x14f => true, 0x151 => true, 0x153 => true, 0x155 => true, 0x157 => true, 0x159 => true, 0x15b => true, 0x15d => true, 0x15f => true, 0x161 => true, 0x163 => true, 0x165 => true, 0x167 => true, 0x169 => true, 0x16b => true, 0x16d => true, 0x16f => true, 0x171 => true, 0x173 => true, 0x175 => true, 0x177 => true, 0x17a => true, 0x17c => true, 0x17e...0x180 => true, 0x183 => true, 0x185 => true, 0x188 => true, 0x18c...0x18d => true, 0x192 => true, 0x195 => true, 0x199...0x19b => true, 0x19e => true, 0x1a1 => true, 0x1a3 => true, 0x1a5 => true, 0x1a8 => true, 0x1aa...0x1ab => true, 0x1ad => true, 0x1b0 => true, 0x1b4 => true, 0x1b6 => true, 0x1b9...0x1ba => true, 0x1bd...0x1bf => true, 0x1c6 => true, 0x1c9 => true, 0x1cc => true, 0x1ce => true, 0x1d0 => true, 0x1d2 => true, 0x1d4 => true, 0x1d6 => true, 0x1d8 => true, 0x1da => true, 0x1dc...0x1dd => true, 0x1df => true, 0x1e1 => true, 0x1e3 => true, 0x1e5 => true, 0x1e7 => true, 0x1e9 => true, 0x1eb => true, 0x1ed => true, 0x1ef...0x1f0 => true, 0x1f3 => true, 0x1f5 => true, 0x1f9 => true, 0x1fb => true, 0x1fd => true, 0x1ff => true, 0x201 => true, 0x203 => true, 0x205 => true, 0x207 => true, 0x209 => true, 0x20b => true, 0x20d => true, 0x20f => true, 0x211 => true, 0x213 => true, 0x215 => true, 0x217 => true, 0x219 => true, 0x21b => true, 0x21d => true, 0x21f => true, 0x221 => true, 0x223 => true, 0x225 => true, 0x227 => true, 0x229 => true, 0x22b => true, 0x22d => true, 0x22f => true, 0x231 => true, 0x233...0x239 => true, 0x23c => true, 0x23f...0x240 => true, 0x242 => true, 0x247 => true, 0x249 => true, 0x24b => true, 0x24d => true, 0x24f...0x293 => true, 0x295...0x2af => true, 0x2b0...0x2b8 => true, 0x2c0...0x2c1 => true, 0x2e0...0x2e4 => true, 0x345 => true, 0x371 => true, 0x373 => true, 0x377 => true, 0x37a => true, 0x37b...0x37d => true, 0x390 => true, 0x3ac...0x3ce => true, 0x3d0...0x3d1 => true, 0x3d5...0x3d7 => true, 0x3d9 => true, 0x3db => true, 0x3dd => true, 0x3df => true, 0x3e1 => true, 0x3e3 => true, 0x3e5 => true, 0x3e7 => true, 0x3e9 => true, 0x3eb => true, 0x3ed => true, 0x3ef...0x3f3 => true, 0x3f5 => true, 0x3f8 => true, 0x3fb...0x3fc => true, 0x430...0x45f => true, 0x461 => true, 0x463 => true, 0x465 => true, 0x467 => true, 0x469 => true, 0x46b => true, 0x46d => true, 0x46f => true, 0x471 => true, 0x473 => true, 0x475 => true, 0x477 => true, 0x479 => true, 0x47b => true, 0x47d => true, 0x47f => true, 0x481 => true, 0x48b => true, 0x48d => true, 0x48f => true, 0x491 => true, 0x493 => true, 0x495 => true, 0x497 => true, 0x499 => true, 0x49b => true, 0x49d => true, 0x49f => true, 0x4a1 => true, 0x4a3 => true, 0x4a5 => true, 0x4a7 => true, 0x4a9 => true, 0x4ab => true, 0x4ad => true, 0x4af => true, 0x4b1 => true, 0x4b3 => true, 0x4b5 => true, 0x4b7 => true, 0x4b9 => true, 0x4bb => true, 0x4bd => true, 0x4bf => true, 0x4c2 => true, 0x4c4 => true, 0x4c6 => true, 0x4c8 => true, 0x4ca => true, 0x4cc => true, 0x4ce...0x4cf => true, 0x4d1 => true, 0x4d3 => true, 0x4d5 => true, 0x4d7 => true, 0x4d9 => true, 0x4db => true, 0x4dd => true, 0x4df => true, 0x4e1 => true, 0x4e3 => true, 0x4e5 => true, 0x4e7 => true, 0x4e9 => true, 0x4eb => true, 0x4ed => true, 0x4ef => true, 0x4f1 => true, 0x4f3 => true, 0x4f5 => true, 0x4f7 => true, 0x4f9 => true, 0x4fb => true, 0x4fd => true, 0x4ff => true, 0x501 => true, 0x503 => true, 0x505 => true, 0x507 => true, 0x509 => true, 0x50b => true, 0x50d => true, 0x50f => true, 0x511 => true, 0x513 => true, 0x515 => true, 0x517 => true, 0x519 => true, 0x51b => true, 0x51d => true, 0x51f => true, 0x521 => true, 0x523 => true, 0x525 => true, 0x527 => true, 0x529 => true, 0x52b => true, 0x52d => true, 0x52f => true, 0x560...0x588 => true, 0x10d0...0x10fa => true, 0x10fd...0x10ff => true, 0x13f8...0x13fd => true, 0x1c80...0x1c88 => true, 0x1d00...0x1d2b => true, 0x1d2c...0x1d6a => true, 0x1d6b...0x1d77 => true, 0x1d78 => true, 0x1d79...0x1d9a => true, 0x1d9b...0x1dbf => true, 0x1e01 => true, 0x1e03 => true, 0x1e05 => true, 0x1e07 => true, 0x1e09 => true, 0x1e0b => true, 0x1e0d => true, 0x1e0f => true, 0x1e11 => true, 0x1e13 => true, 0x1e15 => true, 0x1e17 => true, 0x1e19 => true, 0x1e1b => true, 0x1e1d => true, 0x1e1f => true, 0x1e21 => true, 0x1e23 => true, 0x1e25 => true, 0x1e27 => true, 0x1e29 => true, 0x1e2b => true, 0x1e2d => true, 0x1e2f => true, 0x1e31 => true, 0x1e33 => true, 0x1e35 => true, 0x1e37 => true, 0x1e39 => true, 0x1e3b => true, 0x1e3d => true, 0x1e3f => true, 0x1e41 => true, 0x1e43 => true, 0x1e45 => true, 0x1e47 => true, 0x1e49 => true, 0x1e4b => true, 0x1e4d => true, 0x1e4f => true, 0x1e51 => true, 0x1e53 => true, 0x1e55 => true, 0x1e57 => true, 0x1e59 => true, 0x1e5b => true, 0x1e5d => true, 0x1e5f => true, 0x1e61 => true, 0x1e63 => true, 0x1e65 => true, 0x1e67 => true, 0x1e69 => true, 0x1e6b => true, 0x1e6d => true, 0x1e6f => true, 0x1e71 => true, 0x1e73 => true, 0x1e75 => true, 0x1e77 => true, 0x1e79 => true, 0x1e7b => true, 0x1e7d => true, 0x1e7f => true, 0x1e81 => true, 0x1e83 => true, 0x1e85 => true, 0x1e87 => true, 0x1e89 => true, 0x1e8b => true, 0x1e8d => true, 0x1e8f => true, 0x1e91 => true, 0x1e93 => true, 0x1e95...0x1e9d => true, 0x1e9f => true, 0x1ea1 => true, 0x1ea3 => true, 0x1ea5 => true, 0x1ea7 => true, 0x1ea9 => true, 0x1eab => true, 0x1ead => true, 0x1eaf => true, 0x1eb1 => true, 0x1eb3 => true, 0x1eb5 => true, 0x1eb7 => true, 0x1eb9 => true, 0x1ebb => true, 0x1ebd => true, 0x1ebf => true, 0x1ec1 => true, 0x1ec3 => true, 0x1ec5 => true, 0x1ec7 => true, 0x1ec9 => true, 0x1ecb => true, 0x1ecd => true, 0x1ecf => true, 0x1ed1 => true, 0x1ed3 => true, 0x1ed5 => true, 0x1ed7 => true, 0x1ed9 => true, 0x1edb => true, 0x1edd => true, 0x1edf => true, 0x1ee1 => true, 0x1ee3 => true, 0x1ee5 => true, 0x1ee7 => true, 0x1ee9 => true, 0x1eeb => true, 0x1eed => true, 0x1eef => true, 0x1ef1 => true, 0x1ef3 => true, 0x1ef5 => true, 0x1ef7 => true, 0x1ef9 => true, 0x1efb => true, 0x1efd => true, 0x1eff...0x1f07 => true, 0x1f10...0x1f15 => true, 0x1f20...0x1f27 => true, 0x1f30...0x1f37 => true, 0x1f40...0x1f45 => true, 0x1f50...0x1f57 => true, 0x1f60...0x1f67 => true, 0x1f70...0x1f7d => true, 0x1f80...0x1f87 => true, 0x1f90...0x1f97 => true, 0x1fa0...0x1fa7 => true, 0x1fb0...0x1fb4 => true, 0x1fb6...0x1fb7 => true, 0x1fbe => true, 0x1fc2...0x1fc4 => true, 0x1fc6...0x1fc7 => true, 0x1fd0...0x1fd3 => true, 0x1fd6...0x1fd7 => true, 0x1fe0...0x1fe7 => true, 0x1ff2...0x1ff4 => true, 0x1ff6...0x1ff7 => true, 0x2071 => true, 0x207f => true, 0x2090...0x209c => true, 0x210a => true, 0x210e...0x210f => true, 0x2113 => true, 0x212f => true, 0x2134 => true, 0x2139 => true, 0x213c...0x213d => true, 0x2146...0x2149 => true, 0x214e => true, 0x2170...0x217f => true, 0x2184 => true, 0x24d0...0x24e9 => true, 0x2c30...0x2c5f => true, 0x2c61 => true, 0x2c65...0x2c66 => true, 0x2c68 => true, 0x2c6a => true, 0x2c6c => true, 0x2c71 => true, 0x2c73...0x2c74 => true, 0x2c76...0x2c7b => true, 0x2c7c...0x2c7d => true, 0x2c81 => true, 0x2c83 => true, 0x2c85 => true, 0x2c87 => true, 0x2c89 => true, 0x2c8b => true, 0x2c8d => true, 0x2c8f => true, 0x2c91 => true, 0x2c93 => true, 0x2c95 => true, 0x2c97 => true, 0x2c99 => true, 0x2c9b => true, 0x2c9d => true, 0x2c9f => true, 0x2ca1 => true, 0x2ca3 => true, 0x2ca5 => true, 0x2ca7 => true, 0x2ca9 => true, 0x2cab => true, 0x2cad => true, 0x2caf => true, 0x2cb1 => true, 0x2cb3 => true, 0x2cb5 => true, 0x2cb7 => true, 0x2cb9 => true, 0x2cbb => true, 0x2cbd => true, 0x2cbf => true, 0x2cc1 => true, 0x2cc3 => true, 0x2cc5 => true, 0x2cc7 => true, 0x2cc9 => true, 0x2ccb => true, 0x2ccd => true, 0x2ccf => true, 0x2cd1 => true, 0x2cd3 => true, 0x2cd5 => true, 0x2cd7 => true, 0x2cd9 => true, 0x2cdb => true, 0x2cdd => true, 0x2cdf => true, 0x2ce1 => true, 0x2ce3...0x2ce4 => true, 0x2cec => true, 0x2cee => true, 0x2cf3 => true, 0x2d00...0x2d25 => true, 0x2d27 => true, 0x2d2d => true, 0xa641 => true, 0xa643 => true, 0xa645 => true, 0xa647 => true, 0xa649 => true, 0xa64b => true, 0xa64d => true, 0xa64f => true, 0xa651 => true, 0xa653 => true, 0xa655 => true, 0xa657 => true, 0xa659 => true, 0xa65b => true, 0xa65d => true, 0xa65f => true, 0xa661 => true, 0xa663 => true, 0xa665 => true, 0xa667 => true, 0xa669 => true, 0xa66b => true, 0xa66d => true, 0xa681 => true, 0xa683 => true, 0xa685 => true, 0xa687 => true, 0xa689 => true, 0xa68b => true, 0xa68d => true, 0xa68f => true, 0xa691 => true, 0xa693 => true, 0xa695 => true, 0xa697 => true, 0xa699 => true, 0xa69b => true, 0xa69c...0xa69d => true, 0xa723 => true, 0xa725 => true, 0xa727 => true, 0xa729 => true, 0xa72b => true, 0xa72d => true, 0xa72f...0xa731 => true, 0xa733 => true, 0xa735 => true, 0xa737 => true, 0xa739 => true, 0xa73b => true, 0xa73d => true, 0xa73f => true, 0xa741 => true, 0xa743 => true, 0xa745 => true, 0xa747 => true, 0xa749 => true, 0xa74b => true, 0xa74d => true, 0xa74f => true, 0xa751 => true, 0xa753 => true, 0xa755 => true, 0xa757 => true, 0xa759 => true, 0xa75b => true, 0xa75d => true, 0xa75f => true, 0xa761 => true, 0xa763 => true, 0xa765 => true, 0xa767 => true, 0xa769 => true, 0xa76b => true, 0xa76d => true, 0xa76f => true, 0xa770 => true, 0xa771...0xa778 => true, 0xa77a => true, 0xa77c => true, 0xa77f => true, 0xa781 => true, 0xa783 => true, 0xa785 => true, 0xa787 => true, 0xa78c => true, 0xa78e => true, 0xa791 => true, 0xa793...0xa795 => true, 0xa797 => true, 0xa799 => true, 0xa79b => true, 0xa79d => true, 0xa79f => true, 0xa7a1 => true, 0xa7a3 => true, 0xa7a5 => true, 0xa7a7 => true, 0xa7a9 => true, 0xa7af => true, 0xa7b5 => true, 0xa7b7 => true, 0xa7b9 => true, 0xa7bb => true, 0xa7bd => true, 0xa7bf => true, 0xa7c1 => true, 0xa7c3 => true, 0xa7c8 => true, 0xa7ca => true, 0xa7d1 => true, 0xa7d3 => true, 0xa7d5 => true, 0xa7d7 => true, 0xa7d9 => true, 0xa7f6 => true, 0xa7f8...0xa7f9 => true, 0xa7fa => true, 0xab30...0xab5a => true, 0xab5c...0xab5f => true, 0xab60...0xab68 => true, 0xab70...0xabbf => true, 0xfb00...0xfb06 => true, 0xfb13...0xfb17 => true, 0xff41...0xff5a => true, 0x10428...0x1044f => true, 0x104d8...0x104fb => true, 0x10597...0x105a1 => true, 0x105a3...0x105b1 => true, 0x105b3...0x105b9 => true, 0x105bb...0x105bc => true, 0x10780 => true, 0x10783...0x10785 => true, 0x10787...0x107b0 => true, 0x107b2...0x107ba => true, 0x10cc0...0x10cf2 => true, 0x118c0...0x118df => true, 0x16e60...0x16e7f => true, 0x1d41a...0x1d433 => true, 0x1d44e...0x1d454 => true, 0x1d456...0x1d467 => true, 0x1d482...0x1d49b => true, 0x1d4b6...0x1d4b9 => true, 0x1d4bb => true, 0x1d4bd...0x1d4c3 => true, 0x1d4c5...0x1d4cf => true, 0x1d4ea...0x1d503 => true, 0x1d51e...0x1d537 => true, 0x1d552...0x1d56b => true, 0x1d586...0x1d59f => true, 0x1d5ba...0x1d5d3 => true, 0x1d5ee...0x1d607 => true, 0x1d622...0x1d63b => true, 0x1d656...0x1d66f => true, 0x1d68a...0x1d6a5 => true, 0x1d6c2...0x1d6da => true, 0x1d6dc...0x1d6e1 => true, 0x1d6fc...0x1d714 => true, 0x1d716...0x1d71b => true, 0x1d736...0x1d74e => true, 0x1d750...0x1d755 => true, 0x1d770...0x1d788 => true, 0x1d78a...0x1d78f => true, 0x1d7aa...0x1d7c2 => true, 0x1d7c4...0x1d7c9 => true, 0x1d7cb => true, 0x1df00...0x1df09 => true, 0x1df0b...0x1df1e => true, 0x1e922...0x1e943 => true, else => false, }; } pub fn isUppercase(cp: u21) bool { if (cp < 0x41 or cp > 0x1f189) return false; return switch (cp) { 0x41...0x5a => true, 0xc0...0xd6 => true, 0xd8...0xde => true, 0x100 => true, 0x102 => true, 0x104 => true, 0x106 => true, 0x108 => true, 0x10a => true, 0x10c => true, 0x10e => true, 0x110 => true, 0x112 => true, 0x114 => true, 0x116 => true, 0x118 => true, 0x11a => true, 0x11c => true, 0x11e => true, 0x120 => true, 0x122 => true, 0x124 => true, 0x126 => true, 0x128 => true, 0x12a => true, 0x12c => true, 0x12e => true, 0x130 => true, 0x132 => true, 0x134 => true, 0x136 => true, 0x139 => true, 0x13b => true, 0x13d => true, 0x13f => true, 0x141 => true, 0x143 => true, 0x145 => true, 0x147 => true, 0x14a => true, 0x14c => true, 0x14e => true, 0x150 => true, 0x152 => true, 0x154 => true, 0x156 => true, 0x158 => true, 0x15a => true, 0x15c => true, 0x15e => true, 0x160 => true, 0x162 => true, 0x164 => true, 0x166 => true, 0x168 => true, 0x16a => true, 0x16c => true, 0x16e => true, 0x170 => true, 0x172 => true, 0x174 => true, 0x176 => true, 0x178...0x179 => true, 0x17b => true, 0x17d => true, 0x181...0x182 => true, 0x184 => true, 0x186...0x187 => true, 0x189...0x18b => true, 0x18e...0x191 => true, 0x193...0x194 => true, 0x196...0x198 => true, 0x19c...0x19d => true, 0x19f...0x1a0 => true, 0x1a2 => true, 0x1a4 => true, 0x1a6...0x1a7 => true, 0x1a9 => true, 0x1ac => true, 0x1ae...0x1af => true, 0x1b1...0x1b3 => true, 0x1b5 => true, 0x1b7...0x1b8 => true, 0x1bc => true, 0x1c4 => true, 0x1c7 => true, 0x1ca => true, 0x1cd => true, 0x1cf => true, 0x1d1 => true, 0x1d3 => true, 0x1d5 => true, 0x1d7 => true, 0x1d9 => true, 0x1db => true, 0x1de => true, 0x1e0 => true, 0x1e2 => true, 0x1e4 => true, 0x1e6 => true, 0x1e8 => true, 0x1ea => true, 0x1ec => true, 0x1ee => true, 0x1f1 => true, 0x1f4 => true, 0x1f6...0x1f8 => true, 0x1fa => true, 0x1fc => true, 0x1fe => true, 0x200 => true, 0x202 => true, 0x204 => true, 0x206 => true, 0x208 => true, 0x20a => true, 0x20c => true, 0x20e => true, 0x210 => true, 0x212 => true, 0x214 => true, 0x216 => true, 0x218 => true, 0x21a => true, 0x21c => true, 0x21e => true, 0x220 => true, 0x222 => true, 0x224 => true, 0x226 => true, 0x228 => true, 0x22a => true, 0x22c => true, 0x22e => true, 0x230 => true, 0x232 => true, 0x23a...0x23b => true, 0x23d...0x23e => true, 0x241 => true, 0x243...0x246 => true, 0x248 => true, 0x24a => true, 0x24c => true, 0x24e => true, 0x370 => true, 0x372 => true, 0x376 => true, 0x37f => true, 0x386 => true, 0x388...0x38a => true, 0x38c => true, 0x38e...0x38f => true, 0x391...0x3a1 => true, 0x3a3...0x3ab => true, 0x3cf => true, 0x3d2...0x3d4 => true, 0x3d8 => true, 0x3da => true, 0x3dc => true, 0x3de => true, 0x3e0 => true, 0x3e2 => true, 0x3e4 => true, 0x3e6 => true, 0x3e8 => true, 0x3ea => true, 0x3ec => true, 0x3ee => true, 0x3f4 => true, 0x3f7 => true, 0x3f9...0x3fa => true, 0x3fd...0x42f => true, 0x460 => true, 0x462 => true, 0x464 => true, 0x466 => true, 0x468 => true, 0x46a => true, 0x46c => true, 0x46e => true, 0x470 => true, 0x472 => true, 0x474 => true, 0x476 => true, 0x478 => true, 0x47a => true, 0x47c => true, 0x47e => true, 0x480 => true, 0x48a => true, 0x48c => true, 0x48e => true, 0x490 => true, 0x492 => true, 0x494 => true, 0x496 => true, 0x498 => true, 0x49a => true, 0x49c => true, 0x49e => true, 0x4a0 => true, 0x4a2 => true, 0x4a4 => true, 0x4a6 => true, 0x4a8 => true, 0x4aa => true, 0x4ac => true, 0x4ae => true, 0x4b0 => true, 0x4b2 => true, 0x4b4 => true, 0x4b6 => true, 0x4b8 => true, 0x4ba => true, 0x4bc => true, 0x4be => true, 0x4c0...0x4c1 => true, 0x4c3 => true, 0x4c5 => true, 0x4c7 => true, 0x4c9 => true, 0x4cb => true, 0x4cd => true, 0x4d0 => true, 0x4d2 => true, 0x4d4 => true, 0x4d6 => true, 0x4d8 => true, 0x4da => true, 0x4dc => true, 0x4de => true, 0x4e0 => true, 0x4e2 => true, 0x4e4 => true, 0x4e6 => true, 0x4e8 => true, 0x4ea => true, 0x4ec => true, 0x4ee => true, 0x4f0 => true, 0x4f2 => true, 0x4f4 => true, 0x4f6 => true, 0x4f8 => true, 0x4fa => true, 0x4fc => true, 0x4fe => true, 0x500 => true, 0x502 => true, 0x504 => true, 0x506 => true, 0x508 => true, 0x50a => true, 0x50c => true, 0x50e => true, 0x510 => true, 0x512 => true, 0x514 => true, 0x516 => true, 0x518 => true, 0x51a => true, 0x51c => true, 0x51e => true, 0x520 => true, 0x522 => true, 0x524 => true, 0x526 => true, 0x528 => true, 0x52a => true, 0x52c => true, 0x52e => true, 0x531...0x556 => true, 0x10a0...0x10c5 => true, 0x10c7 => true, 0x10cd => true, 0x13a0...0x13f5 => true, 0x1c90...0x1cba => true, 0x1cbd...0x1cbf => true, 0x1e00 => true, 0x1e02 => true, 0x1e04 => true, 0x1e06 => true, 0x1e08 => true, 0x1e0a => true, 0x1e0c => true, 0x1e0e => true, 0x1e10 => true, 0x1e12 => true, 0x1e14 => true, 0x1e16 => true, 0x1e18 => true, 0x1e1a => true, 0x1e1c => true, 0x1e1e => true, 0x1e20 => true, 0x1e22 => true, 0x1e24 => true, 0x1e26 => true, 0x1e28 => true, 0x1e2a => true, 0x1e2c => true, 0x1e2e => true, 0x1e30 => true, 0x1e32 => true, 0x1e34 => true, 0x1e36 => true, 0x1e38 => true, 0x1e3a => true, 0x1e3c => true, 0x1e3e => true, 0x1e40 => true, 0x1e42 => true, 0x1e44 => true, 0x1e46 => true, 0x1e48 => true, 0x1e4a => true, 0x1e4c => true, 0x1e4e => true, 0x1e50 => true, 0x1e52 => true, 0x1e54 => true, 0x1e56 => true, 0x1e58 => true, 0x1e5a => true, 0x1e5c => true, 0x1e5e => true, 0x1e60 => true, 0x1e62 => true, 0x1e64 => true, 0x1e66 => true, 0x1e68 => true, 0x1e6a => true, 0x1e6c => true, 0x1e6e => true, 0x1e70 => true, 0x1e72 => true, 0x1e74 => true, 0x1e76 => true, 0x1e78 => true, 0x1e7a => true, 0x1e7c => true, 0x1e7e => true, 0x1e80 => true, 0x1e82 => true, 0x1e84 => true, 0x1e86 => true, 0x1e88 => true, 0x1e8a => true, 0x1e8c => true, 0x1e8e => true, 0x1e90 => true, 0x1e92 => true, 0x1e94 => true, 0x1e9e => true, 0x1ea0 => true, 0x1ea2 => true, 0x1ea4 => true, 0x1ea6 => true, 0x1ea8 => true, 0x1eaa => true, 0x1eac => true, 0x1eae => true, 0x1eb0 => true, 0x1eb2 => true, 0x1eb4 => true, 0x1eb6 => true, 0x1eb8 => true, 0x1eba => true, 0x1ebc => true, 0x1ebe => true, 0x1ec0 => true, 0x1ec2 => true, 0x1ec4 => true, 0x1ec6 => true, 0x1ec8 => true, 0x1eca => true, 0x1ecc => true, 0x1ece => true, 0x1ed0 => true, 0x1ed2 => true, 0x1ed4 => true, 0x1ed6 => true, 0x1ed8 => true, 0x1eda => true, 0x1edc => true, 0x1ede => true, 0x1ee0 => true, 0x1ee2 => true, 0x1ee4 => true, 0x1ee6 => true, 0x1ee8 => true, 0x1eea => true, 0x1eec => true, 0x1eee => true, 0x1ef0 => true, 0x1ef2 => true, 0x1ef4 => true, 0x1ef6 => true, 0x1ef8 => true, 0x1efa => true, 0x1efc => true, 0x1efe => true, 0x1f08...0x1f0f => true, 0x1f18...0x1f1d => true, 0x1f28...0x1f2f => true, 0x1f38...0x1f3f => true, 0x1f48...0x1f4d => true, 0x1f59 => true, 0x1f5b => true, 0x1f5d => true, 0x1f5f => true, 0x1f68...0x1f6f => true, 0x1fb8...0x1fbb => true, 0x1fc8...0x1fcb => true, 0x1fd8...0x1fdb => true, 0x1fe8...0x1fec => true, 0x1ff8...0x1ffb => true, 0x2102 => true, 0x2107 => true, 0x210b...0x210d => true, 0x2110...0x2112 => true, 0x2115 => true, 0x2119...0x211d => true, 0x2124 => true, 0x2126 => true, 0x2128 => true, 0x212a...0x212d => true, 0x2130...0x2133 => true, 0x213e...0x213f => true, 0x2145 => true, 0x2160...0x216f => true, 0x2183 => true, 0x24b6...0x24cf => true, 0x2c00...0x2c2f => true, 0x2c60 => true, 0x2c62...0x2c64 => true, 0x2c67 => true, 0x2c69 => true, 0x2c6b => true, 0x2c6d...0x2c70 => true, 0x2c72 => true, 0x2c75 => true, 0x2c7e...0x2c80 => true, 0x2c82 => true, 0x2c84 => true, 0x2c86 => true, 0x2c88 => true, 0x2c8a => true, 0x2c8c => true, 0x2c8e => true, 0x2c90 => true, 0x2c92 => true, 0x2c94 => true, 0x2c96 => true, 0x2c98 => true, 0x2c9a => true, 0x2c9c => true, 0x2c9e => true, 0x2ca0 => true, 0x2ca2 => true, 0x2ca4 => true, 0x2ca6 => true, 0x2ca8 => true, 0x2caa => true, 0x2cac => true, 0x2cae => true, 0x2cb0 => true, 0x2cb2 => true, 0x2cb4 => true, 0x2cb6 => true, 0x2cb8 => true, 0x2cba => true, 0x2cbc => true, 0x2cbe => true, 0x2cc0 => true, 0x2cc2 => true, 0x2cc4 => true, 0x2cc6 => true, 0x2cc8 => true, 0x2cca => true, 0x2ccc => true, 0x2cce => true, 0x2cd0 => true, 0x2cd2 => true, 0x2cd4 => true, 0x2cd6 => true, 0x2cd8 => true, 0x2cda => true, 0x2cdc => true, 0x2cde => true, 0x2ce0 => true, 0x2ce2 => true, 0x2ceb => true, 0x2ced => true, 0x2cf2 => true, 0xa640 => true, 0xa642 => true, 0xa644 => true, 0xa646 => true, 0xa648 => true, 0xa64a => true, 0xa64c => true, 0xa64e => true, 0xa650 => true, 0xa652 => true, 0xa654 => true, 0xa656 => true, 0xa658 => true, 0xa65a => true, 0xa65c => true, 0xa65e => true, 0xa660 => true, 0xa662 => true, 0xa664 => true, 0xa666 => true, 0xa668 => true, 0xa66a => true, 0xa66c => true, 0xa680 => true, 0xa682 => true, 0xa684 => true, 0xa686 => true, 0xa688 => true, 0xa68a => true, 0xa68c => true, 0xa68e => true, 0xa690 => true, 0xa692 => true, 0xa694 => true, 0xa696 => true, 0xa698 => true, 0xa69a => true, 0xa722 => true, 0xa724 => true, 0xa726 => true, 0xa728 => true, 0xa72a => true, 0xa72c => true, 0xa72e => true, 0xa732 => true, 0xa734 => true, 0xa736 => true, 0xa738 => true, 0xa73a => true, 0xa73c => true, 0xa73e => true, 0xa740 => true, 0xa742 => true, 0xa744 => true, 0xa746 => true, 0xa748 => true, 0xa74a => true, 0xa74c => true, 0xa74e => true, 0xa750 => true, 0xa752 => true, 0xa754 => true, 0xa756 => true, 0xa758 => true, 0xa75a => true, 0xa75c => true, 0xa75e => true, 0xa760 => true, 0xa762 => true, 0xa764 => true, 0xa766 => true, 0xa768 => true, 0xa76a => true, 0xa76c => true, 0xa76e => true, 0xa779 => true, 0xa77b => true, 0xa77d...0xa77e => true, 0xa780 => true, 0xa782 => true, 0xa784 => true, 0xa786 => true, 0xa78b => true, 0xa78d => true, 0xa790 => true, 0xa792 => true, 0xa796 => true, 0xa798 => true, 0xa79a => true, 0xa79c => true, 0xa79e => true, 0xa7a0 => true, 0xa7a2 => true, 0xa7a4 => true, 0xa7a6 => true, 0xa7a8 => true, 0xa7aa...0xa7ae => true, 0xa7b0...0xa7b4 => true, 0xa7b6 => true, 0xa7b8 => true, 0xa7ba => true, 0xa7bc => true, 0xa7be => true, 0xa7c0 => true, 0xa7c2 => true, 0xa7c4...0xa7c7 => true, 0xa7c9 => true, 0xa7d0 => true, 0xa7d6 => true, 0xa7d8 => true, 0xa7f5 => true, 0xff21...0xff3a => true, 0x10400...0x10427 => true, 0x104b0...0x104d3 => true, 0x10570...0x1057a => true, 0x1057c...0x1058a => true, 0x1058c...0x10592 => true, 0x10594...0x10595 => true, 0x10c80...0x10cb2 => true, 0x118a0...0x118bf => true, 0x16e40...0x16e5f => true, 0x1d400...0x1d419 => true, 0x1d434...0x1d44d => true, 0x1d468...0x1d481 => true, 0x1d49c => true, 0x1d49e...0x1d49f => true, 0x1d4a2 => true, 0x1d4a5...0x1d4a6 => true, 0x1d4a9...0x1d4ac => true, 0x1d4ae...0x1d4b5 => true, 0x1d4d0...0x1d4e9 => true, 0x1d504...0x1d505 => true, 0x1d507...0x1d50a => true, 0x1d50d...0x1d514 => true, 0x1d516...0x1d51c => true, 0x1d538...0x1d539 => true, 0x1d53b...0x1d53e => true, 0x1d540...0x1d544 => true, 0x1d546 => true, 0x1d54a...0x1d550 => true, 0x1d56c...0x1d585 => true, 0x1d5a0...0x1d5b9 => true, 0x1d5d4...0x1d5ed => true, 0x1d608...0x1d621 => true, 0x1d63c...0x1d655 => true, 0x1d670...0x1d689 => true, 0x1d6a8...0x1d6c0 => true, 0x1d6e2...0x1d6fa => true, 0x1d71c...0x1d734 => true, 0x1d756...0x1d76e => true, 0x1d790...0x1d7a8 => true, 0x1d7ca => true, 0x1e900...0x1e921 => true, 0x1f130...0x1f149 => true, 0x1f150...0x1f169 => true, 0x1f170...0x1f189 => true, else => false, }; } pub fn isCased(cp: u21) bool { if (cp < 0x41 or cp > 0x1f189) return false; return switch (cp) { 0x41...0x5a => true, 0x61...0x7a => true, 0xaa => true, 0xb5 => true, 0xba => true, 0xc0...0xd6 => true, 0xd8...0xf6 => true, 0xf8...0x1ba => true, 0x1bc...0x1bf => true, 0x1c4...0x293 => true, 0x295...0x2af => true, 0x2b0...0x2b8 => true, 0x2c0...0x2c1 => true, 0x2e0...0x2e4 => true, 0x345 => true, 0x370...0x373 => true, 0x376...0x377 => true, 0x37a => true, 0x37b...0x37d => true, 0x37f => true, 0x386 => true, 0x388...0x38a => true, 0x38c => true, 0x38e...0x3a1 => true, 0x3a3...0x3f5 => true, 0x3f7...0x481 => true, 0x48a...0x52f => true, 0x531...0x556 => true, 0x560...0x588 => true, 0x10a0...0x10c5 => true, 0x10c7 => true, 0x10cd => true, 0x10d0...0x10fa => true, 0x10fd...0x10ff => true, 0x13a0...0x13f5 => true, 0x13f8...0x13fd => true, 0x1c80...0x1c88 => true, 0x1c90...0x1cba => true, 0x1cbd...0x1cbf => true, 0x1d00...0x1d2b => true, 0x1d2c...0x1d6a => true, 0x1d6b...0x1d77 => true, 0x1d78 => true, 0x1d79...0x1d9a => true, 0x1d9b...0x1dbf => true, 0x1e00...0x1f15 => true, 0x1f18...0x1f1d => true, 0x1f20...0x1f45 => true, 0x1f48...0x1f4d => true, 0x1f50...0x1f57 => true, 0x1f59 => true, 0x1f5b => true, 0x1f5d => true, 0x1f5f...0x1f7d => true, 0x1f80...0x1fb4 => true, 0x1fb6...0x1fbc => true, 0x1fbe => true, 0x1fc2...0x1fc4 => true, 0x1fc6...0x1fcc => true, 0x1fd0...0x1fd3 => true, 0x1fd6...0x1fdb => true, 0x1fe0...0x1fec => true, 0x1ff2...0x1ff4 => true, 0x1ff6...0x1ffc => true, 0x2071 => true, 0x207f => true, 0x2090...0x209c => true, 0x2102 => true, 0x2107 => true, 0x210a...0x2113 => true, 0x2115 => true, 0x2119...0x211d => true, 0x2124 => true, 0x2126 => true, 0x2128 => true, 0x212a...0x212d => true, 0x212f...0x2134 => true, 0x2139 => true, 0x213c...0x213f => true, 0x2145...0x2149 => true, 0x214e => true, 0x2160...0x217f => true, 0x2183...0x2184 => true, 0x24b6...0x24e9 => true, 0x2c00...0x2c7b => true, 0x2c7c...0x2c7d => true, 0x2c7e...0x2ce4 => true, 0x2ceb...0x2cee => true, 0x2cf2...0x2cf3 => true, 0x2d00...0x2d25 => true, 0x2d27 => true, 0x2d2d => true, 0xa640...0xa66d => true, 0xa680...0xa69b => true, 0xa69c...0xa69d => true, 0xa722...0xa76f => true, 0xa770 => true, 0xa771...0xa787 => true, 0xa78b...0xa78e => true, 0xa790...0xa7ca => true, 0xa7d0...0xa7d1 => true, 0xa7d3 => true, 0xa7d5...0xa7d9 => true, 0xa7f5...0xa7f6 => true, 0xa7f8...0xa7f9 => true, 0xa7fa => true, 0xab30...0xab5a => true, 0xab5c...0xab5f => true, 0xab60...0xab68 => true, 0xab70...0xabbf => true, 0xfb00...0xfb06 => true, 0xfb13...0xfb17 => true, 0xff21...0xff3a => true, 0xff41...0xff5a => true, 0x10400...0x1044f => true, 0x104b0...0x104d3 => true, 0x104d8...0x104fb => true, 0x10570...0x1057a => true, 0x1057c...0x1058a => true, 0x1058c...0x10592 => true, 0x10594...0x10595 => true, 0x10597...0x105a1 => true, 0x105a3...0x105b1 => true, 0x105b3...0x105b9 => true, 0x105bb...0x105bc => true, 0x10780 => true, 0x10783...0x10785 => true, 0x10787...0x107b0 => true, 0x107b2...0x107ba => true, 0x10c80...0x10cb2 => true, 0x10cc0...0x10cf2 => true, 0x118a0...0x118df => true, 0x16e40...0x16e7f => true, 0x1d400...0x1d454 => true, 0x1d456...0x1d49c => true, 0x1d49e...0x1d49f => true, 0x1d4a2 => true, 0x1d4a5...0x1d4a6 => true, 0x1d4a9...0x1d4ac => true, 0x1d4ae...0x1d4b9 => true, 0x1d4bb => true, 0x1d4bd...0x1d4c3 => true, 0x1d4c5...0x1d505 => true, 0x1d507...0x1d50a => true, 0x1d50d...0x1d514 => true, 0x1d516...0x1d51c => true, 0x1d51e...0x1d539 => true, 0x1d53b...0x1d53e => true, 0x1d540...0x1d544 => true, 0x1d546 => true, 0x1d54a...0x1d550 => true, 0x1d552...0x1d6a5 => true, 0x1d6a8...0x1d6c0 => true, 0x1d6c2...0x1d6da => true, 0x1d6dc...0x1d6fa => true, 0x1d6fc...0x1d714 => true, 0x1d716...0x1d734 => true, 0x1d736...0x1d74e => true, 0x1d750...0x1d76e => true, 0x1d770...0x1d788 => true, 0x1d78a...0x1d7a8 => true, 0x1d7aa...0x1d7c2 => true, 0x1d7c4...0x1d7cb => true, 0x1df00...0x1df09 => true, 0x1df0b...0x1df1e => true, 0x1e900...0x1e943 => true, 0x1f130...0x1f149 => true, 0x1f150...0x1f169 => true, 0x1f170...0x1f189 => true, else => false, }; } pub fn isCaseIgnorable(cp: u21) bool { if (cp < 0x27 or cp > 0xe01ef) return false; return switch (cp) { 0x27 => true, 0x2e => true, 0x3a => true, 0x5e => true, 0x60 => true, 0xa8 => true, 0xad => true, 0xaf => true, 0xb4 => true, 0xb7 => true, 0xb8 => true, 0x2b0...0x2c1 => true, 0x2c2...0x2c5 => true, 0x2c6...0x2d1 => true, 0x2d2...0x2df => true, 0x2e0...0x2e4 => true, 0x2e5...0x2eb => true, 0x2ec => true, 0x2ed => true, 0x2ee => true, 0x2ef...0x2ff => true, 0x300...0x36f => true, 0x374 => true, 0x375 => true, 0x37a => true, 0x384...0x385 => true, 0x387 => true, 0x483...0x487 => true, 0x488...0x489 => true, 0x559 => true, 0x55f => true, 0x591...0x5bd => true, 0x5bf => true, 0x5c1...0x5c2 => true, 0x5c4...0x5c5 => true, 0x5c7 => true, 0x5f4 => true, 0x600...0x605 => true, 0x610...0x61a => true, 0x61c => true, 0x640 => true, 0x64b...0x65f => true, 0x670 => true, 0x6d6...0x6dc => true, 0x6dd => true, 0x6df...0x6e4 => true, 0x6e5...0x6e6 => true, 0x6e7...0x6e8 => true, 0x6ea...0x6ed => true, 0x70f => true, 0x711 => true, 0x730...0x74a => true, 0x7a6...0x7b0 => true, 0x7eb...0x7f3 => true, 0x7f4...0x7f5 => true, 0x7fa => true, 0x7fd => true, 0x816...0x819 => true, 0x81a => true, 0x81b...0x823 => true, 0x824 => true, 0x825...0x827 => true, 0x828 => true, 0x829...0x82d => true, 0x859...0x85b => true, 0x888 => true, 0x890...0x891 => true, 0x898...0x89f => true, 0x8c9 => true, 0x8ca...0x8e1 => true, 0x8e2 => true, 0x8e3...0x902 => true, 0x93a => true, 0x93c => true, 0x941...0x948 => true, 0x94d => true, 0x951...0x957 => true, 0x962...0x963 => true, 0x971 => true, 0x981 => true, 0x9bc => true, 0x9c1...0x9c4 => true, 0x9cd => true, 0x9e2...0x9e3 => true, 0x9fe => true, 0xa01...0xa02 => true, 0xa3c => true, 0xa41...0xa42 => true, 0xa47...0xa48 => true, 0xa4b...0xa4d => true, 0xa51 => true, 0xa70...0xa71 => true, 0xa75 => true, 0xa81...0xa82 => true, 0xabc => true, 0xac1...0xac5 => true, 0xac7...0xac8 => true, 0xacd => true, 0xae2...0xae3 => true, 0xafa...0xaff => true, 0xb01 => true, 0xb3c => true, 0xb3f => true, 0xb41...0xb44 => true, 0xb4d => true, 0xb55...0xb56 => true, 0xb62...0xb63 => true, 0xb82 => true, 0xbc0 => true, 0xbcd => true, 0xc00 => true, 0xc04 => true, 0xc3c => true, 0xc3e...0xc40 => true, 0xc46...0xc48 => true, 0xc4a...0xc4d => true, 0xc55...0xc56 => true, 0xc62...0xc63 => true, 0xc81 => true, 0xcbc => true, 0xcbf => true, 0xcc6 => true, 0xccc...0xccd => true, 0xce2...0xce3 => true, 0xd00...0xd01 => true, 0xd3b...0xd3c => true, 0xd41...0xd44 => true, 0xd4d => true, 0xd62...0xd63 => true, 0xd81 => true, 0xdca => true, 0xdd2...0xdd4 => true, 0xdd6 => true, 0xe31 => true, 0xe34...0xe3a => true, 0xe46 => true, 0xe47...0xe4e => true, 0xeb1 => true, 0xeb4...0xebc => true, 0xec6 => true, 0xec8...0xecd => true, 0xf18...0xf19 => true, 0xf35 => true, 0xf37 => true, 0xf39 => true, 0xf71...0xf7e => true, 0xf80...0xf84 => true, 0xf86...0xf87 => true, 0xf8d...0xf97 => true, 0xf99...0xfbc => true, 0xfc6 => true, 0x102d...0x1030 => true, 0x1032...0x1037 => true, 0x1039...0x103a => true, 0x103d...0x103e => true, 0x1058...0x1059 => true, 0x105e...0x1060 => true, 0x1071...0x1074 => true, 0x1082 => true, 0x1085...0x1086 => true, 0x108d => true, 0x109d => true, 0x10fc => true, 0x135d...0x135f => true, 0x1712...0x1714 => true, 0x1732...0x1733 => true, 0x1752...0x1753 => true, 0x1772...0x1773 => true, 0x17b4...0x17b5 => true, 0x17b7...0x17bd => true, 0x17c6 => true, 0x17c9...0x17d3 => true, 0x17d7 => true, 0x17dd => true, 0x180b...0x180d => true, 0x180e => true, 0x180f => true, 0x1843 => true, 0x1885...0x1886 => true, 0x18a9 => true, 0x1920...0x1922 => true, 0x1927...0x1928 => true, 0x1932 => true, 0x1939...0x193b => true, 0x1a17...0x1a18 => true, 0x1a1b => true, 0x1a56 => true, 0x1a58...0x1a5e => true, 0x1a60 => true, 0x1a62 => true, 0x1a65...0x1a6c => true, 0x1a73...0x1a7c => true, 0x1a7f => true, 0x1aa7 => true, 0x1ab0...0x1abd => true, 0x1abe => true, 0x1abf...0x1ace => true, 0x1b00...0x1b03 => true, 0x1b34 => true, 0x1b36...0x1b3a => true, 0x1b3c => true, 0x1b42 => true, 0x1b6b...0x1b73 => true, 0x1b80...0x1b81 => true, 0x1ba2...0x1ba5 => true, 0x1ba8...0x1ba9 => true, 0x1bab...0x1bad => true, 0x1be6 => true, 0x1be8...0x1be9 => true, 0x1bed => true, 0x1bef...0x1bf1 => true, 0x1c2c...0x1c33 => true, 0x1c36...0x1c37 => true, 0x1c78...0x1c7d => true, 0x1cd0...0x1cd2 => true, 0x1cd4...0x1ce0 => true, 0x1ce2...0x1ce8 => true, 0x1ced => true, 0x1cf4 => true, 0x1cf8...0x1cf9 => true, 0x1d2c...0x1d6a => true, 0x1d78 => true, 0x1d9b...0x1dbf => true, 0x1dc0...0x1dff => true, 0x1fbd => true, 0x1fbf...0x1fc1 => true, 0x1fcd...0x1fcf => true, 0x1fdd...0x1fdf => true, 0x1fed...0x1fef => true, 0x1ffd...0x1ffe => true, 0x200b...0x200f => true, 0x2018 => true, 0x2019 => true, 0x2024 => true, 0x2027 => true, 0x202a...0x202e => true, 0x2060...0x2064 => true, 0x2066...0x206f => true, 0x2071 => true, 0x207f => true, 0x2090...0x209c => true, 0x20d0...0x20dc => true, 0x20dd...0x20e0 => true, 0x20e1 => true, 0x20e2...0x20e4 => true, 0x20e5...0x20f0 => true, 0x2c7c...0x2c7d => true, 0x2cef...0x2cf1 => true, 0x2d6f => true, 0x2d7f => true, 0x2de0...0x2dff => true, 0x2e2f => true, 0x3005 => true, 0x302a...0x302d => true, 0x3031...0x3035 => true, 0x303b => true, 0x3099...0x309a => true, 0x309b...0x309c => true, 0x309d...0x309e => true, 0x30fc...0x30fe => true, 0xa015 => true, 0xa4f8...0xa4fd => true, 0xa60c => true, 0xa66f => true, 0xa670...0xa672 => true, 0xa674...0xa67d => true, 0xa67f => true, 0xa69c...0xa69d => true, 0xa69e...0xa69f => true, 0xa6f0...0xa6f1 => true, 0xa700...0xa716 => true, 0xa717...0xa71f => true, 0xa720...0xa721 => true, 0xa770 => true, 0xa788 => true, 0xa789...0xa78a => true, 0xa7f2...0xa7f4 => true, 0xa7f8...0xa7f9 => true, 0xa802 => true, 0xa806 => true, 0xa80b => true, 0xa825...0xa826 => true, 0xa82c => true, 0xa8c4...0xa8c5 => true, 0xa8e0...0xa8f1 => true, 0xa8ff => true, 0xa926...0xa92d => true, 0xa947...0xa951 => true, 0xa980...0xa982 => true, 0xa9b3 => true, 0xa9b6...0xa9b9 => true, 0xa9bc...0xa9bd => true, 0xa9cf => true, 0xa9e5 => true, 0xa9e6 => true, 0xaa29...0xaa2e => true, 0xaa31...0xaa32 => true, 0xaa35...0xaa36 => true, 0xaa43 => true, 0xaa4c => true, 0xaa70 => true, 0xaa7c => true, 0xaab0 => true, 0xaab2...0xaab4 => true, 0xaab7...0xaab8 => true, 0xaabe...0xaabf => true, 0xaac1 => true, 0xaadd => true, 0xaaec...0xaaed => true, 0xaaf3...0xaaf4 => true, 0xaaf6 => true, 0xab5b => true, 0xab5c...0xab5f => true, 0xab69 => true, 0xab6a...0xab6b => true, 0xabe5 => true, 0xabe8 => true, 0xabed => true, 0xfb1e => true, 0xfbb2...0xfbc2 => true, 0xfe00...0xfe0f => true, 0xfe13 => true, 0xfe20...0xfe2f => true, 0xfe52 => true, 0xfe55 => true, 0xfeff => true, 0xff07 => true, 0xff0e => true, 0xff1a => true, 0xff3e => true, 0xff40 => true, 0xff70 => true, 0xff9e...0xff9f => true, 0xffe3 => true, 0xfff9...0xfffb => true, 0x101fd => true, 0x102e0 => true, 0x10376...0x1037a => true, 0x10780...0x10785 => true, 0x10787...0x107b0 => true, 0x107b2...0x107ba => true, 0x10a01...0x10a03 => true, 0x10a05...0x10a06 => true, 0x10a0c...0x10a0f => true, 0x10a38...0x10a3a => true, 0x10a3f => true, 0x10ae5...0x10ae6 => true, 0x10d24...0x10d27 => true, 0x10eab...0x10eac => true, 0x10f46...0x10f50 => true, 0x10f82...0x10f85 => true, 0x11001 => true, 0x11038...0x11046 => true, 0x11070 => true, 0x11073...0x11074 => true, 0x1107f...0x11081 => true, 0x110b3...0x110b6 => true, 0x110b9...0x110ba => true, 0x110bd => true, 0x110c2 => true, 0x110cd => true, 0x11100...0x11102 => true, 0x11127...0x1112b => true, 0x1112d...0x11134 => true, 0x11173 => true, 0x11180...0x11181 => true, 0x111b6...0x111be => true, 0x111c9...0x111cc => true, 0x111cf => true, 0x1122f...0x11231 => true, 0x11234 => true, 0x11236...0x11237 => true, 0x1123e => true, 0x112df => true, 0x112e3...0x112ea => true, 0x11300...0x11301 => true, 0x1133b...0x1133c => true, 0x11340 => true, 0x11366...0x1136c => true, 0x11370...0x11374 => true, 0x11438...0x1143f => true, 0x11442...0x11444 => true, 0x11446 => true, 0x1145e => true, 0x114b3...0x114b8 => true, 0x114ba => true, 0x114bf...0x114c0 => true, 0x114c2...0x114c3 => true, 0x115b2...0x115b5 => true, 0x115bc...0x115bd => true, 0x115bf...0x115c0 => true, 0x115dc...0x115dd => true, 0x11633...0x1163a => true, 0x1163d => true, 0x1163f...0x11640 => true, 0x116ab => true, 0x116ad => true, 0x116b0...0x116b5 => true, 0x116b7 => true, 0x1171d...0x1171f => true, 0x11722...0x11725 => true, 0x11727...0x1172b => true, 0x1182f...0x11837 => true, 0x11839...0x1183a => true, 0x1193b...0x1193c => true, 0x1193e => true, 0x11943 => true, 0x119d4...0x119d7 => true, 0x119da...0x119db => true, 0x119e0 => true, 0x11a01...0x11a0a => true, 0x11a33...0x11a38 => true, 0x11a3b...0x11a3e => true, 0x11a47 => true, 0x11a51...0x11a56 => true, 0x11a59...0x11a5b => true, 0x11a8a...0x11a96 => true, 0x11a98...0x11a99 => true, 0x11c30...0x11c36 => true, 0x11c38...0x11c3d => true, 0x11c3f => true, 0x11c92...0x11ca7 => true, 0x11caa...0x11cb0 => true, 0x11cb2...0x11cb3 => true, 0x11cb5...0x11cb6 => true, 0x11d31...0x11d36 => true, 0x11d3a => true, 0x11d3c...0x11d3d => true, 0x11d3f...0x11d45 => true, 0x11d47 => true, 0x11d90...0x11d91 => true, 0x11d95 => true, 0x11d97 => true, 0x11ef3...0x11ef4 => true, 0x13430...0x13438 => true, 0x16af0...0x16af4 => true, 0x16b30...0x16b36 => true, 0x16b40...0x16b43 => true, 0x16f4f => true, 0x16f8f...0x16f92 => true, 0x16f93...0x16f9f => true, 0x16fe0...0x16fe1 => true, 0x16fe3 => true, 0x16fe4 => true, 0x1aff0...0x1aff3 => true, 0x1aff5...0x1affb => true, 0x1affd...0x1affe => true, 0x1bc9d...0x1bc9e => true, 0x1bca0...0x1bca3 => true, 0x1cf00...0x1cf2d => true, 0x1cf30...0x1cf46 => true, 0x1d167...0x1d169 => true, 0x1d173...0x1d17a => true, 0x1d17b...0x1d182 => true, 0x1d185...0x1d18b => true, 0x1d1aa...0x1d1ad => true, 0x1d242...0x1d244 => true, 0x1da00...0x1da36 => true, 0x1da3b...0x1da6c => true, 0x1da75 => true, 0x1da84 => true, 0x1da9b...0x1da9f => true, 0x1daa1...0x1daaf => true, 0x1e000...0x1e006 => true, 0x1e008...0x1e018 => true, 0x1e01b...0x1e021 => true, 0x1e023...0x1e024 => true, 0x1e026...0x1e02a => true, 0x1e130...0x1e136 => true, 0x1e137...0x1e13d => true, 0x1e2ae => true, 0x1e2ec...0x1e2ef => true, 0x1e8d0...0x1e8d6 => true, 0x1e944...0x1e94a => true, 0x1e94b => true, 0x1f3fb...0x1f3ff => true, 0xe0001 => true, 0xe0020...0xe007f => true, 0xe0100...0xe01ef => true, else => false, }; } pub fn isChangesWhenLowercased(cp: u21) bool { if (cp < 0x41 or cp > 0x1e921) return false; return switch (cp) { 0x41...0x5a => true, 0xc0...0xd6 => true, 0xd8...0xde => true, 0x100 => true, 0x102 => true, 0x104 => true, 0x106 => true, 0x108 => true, 0x10a => true, 0x10c => true, 0x10e => true, 0x110 => true, 0x112 => true, 0x114 => true, 0x116 => true, 0x118 => true, 0x11a => true, 0x11c => true, 0x11e => true, 0x120 => true, 0x122 => true, 0x124 => true, 0x126 => true, 0x128 => true, 0x12a => true, 0x12c => true, 0x12e => true, 0x130 => true, 0x132 => true, 0x134 => true, 0x136 => true, 0x139 => true, 0x13b => true, 0x13d => true, 0x13f => true, 0x141 => true, 0x143 => true, 0x145 => true, 0x147 => true, 0x14a => true, 0x14c => true, 0x14e => true, 0x150 => true, 0x152 => true, 0x154 => true, 0x156 => true, 0x158 => true, 0x15a => true, 0x15c => true, 0x15e => true, 0x160 => true, 0x162 => true, 0x164 => true, 0x166 => true, 0x168 => true, 0x16a => true, 0x16c => true, 0x16e => true, 0x170 => true, 0x172 => true, 0x174 => true, 0x176 => true, 0x178...0x179 => true, 0x17b => true, 0x17d => true, 0x181...0x182 => true, 0x184 => true, 0x186...0x187 => true, 0x189...0x18b => true, 0x18e...0x191 => true, 0x193...0x194 => true, 0x196...0x198 => true, 0x19c...0x19d => true, 0x19f...0x1a0 => true, 0x1a2 => true, 0x1a4 => true, 0x1a6...0x1a7 => true, 0x1a9 => true, 0x1ac => true, 0x1ae...0x1af => true, 0x1b1...0x1b3 => true, 0x1b5 => true, 0x1b7...0x1b8 => true, 0x1bc => true, 0x1c4...0x1c5 => true, 0x1c7...0x1c8 => true, 0x1ca...0x1cb => true, 0x1cd => true, 0x1cf => true, 0x1d1 => true, 0x1d3 => true, 0x1d5 => true, 0x1d7 => true, 0x1d9 => true, 0x1db => true, 0x1de => true, 0x1e0 => true, 0x1e2 => true, 0x1e4 => true, 0x1e6 => true, 0x1e8 => true, 0x1ea => true, 0x1ec => true, 0x1ee => true, 0x1f1...0x1f2 => true, 0x1f4 => true, 0x1f6...0x1f8 => true, 0x1fa => true, 0x1fc => true, 0x1fe => true, 0x200 => true, 0x202 => true, 0x204 => true, 0x206 => true, 0x208 => true, 0x20a => true, 0x20c => true, 0x20e => true, 0x210 => true, 0x212 => true, 0x214 => true, 0x216 => true, 0x218 => true, 0x21a => true, 0x21c => true, 0x21e => true, 0x220 => true, 0x222 => true, 0x224 => true, 0x226 => true, 0x228 => true, 0x22a => true, 0x22c => true, 0x22e => true, 0x230 => true, 0x232 => true, 0x23a...0x23b => true, 0x23d...0x23e => true, 0x241 => true, 0x243...0x246 => true, 0x248 => true, 0x24a => true, 0x24c => true, 0x24e => true, 0x370 => true, 0x372 => true, 0x376 => true, 0x37f => true, 0x386 => true, 0x388...0x38a => true, 0x38c => true, 0x38e...0x38f => true, 0x391...0x3a1 => true, 0x3a3...0x3ab => true, 0x3cf => true, 0x3d8 => true, 0x3da => true, 0x3dc => true, 0x3de => true, 0x3e0 => true, 0x3e2 => true, 0x3e4 => true, 0x3e6 => true, 0x3e8 => true, 0x3ea => true, 0x3ec => true, 0x3ee => true, 0x3f4 => true, 0x3f7 => true, 0x3f9...0x3fa => true, 0x3fd...0x42f => true, 0x460 => true, 0x462 => true, 0x464 => true, 0x466 => true, 0x468 => true, 0x46a => true, 0x46c => true, 0x46e => true, 0x470 => true, 0x472 => true, 0x474 => true, 0x476 => true, 0x478 => true, 0x47a => true, 0x47c => true, 0x47e => true, 0x480 => true, 0x48a => true, 0x48c => true, 0x48e => true, 0x490 => true, 0x492 => true, 0x494 => true, 0x496 => true, 0x498 => true, 0x49a => true, 0x49c => true, 0x49e => true, 0x4a0 => true, 0x4a2 => true, 0x4a4 => true, 0x4a6 => true, 0x4a8 => true, 0x4aa => true, 0x4ac => true, 0x4ae => true, 0x4b0 => true, 0x4b2 => true, 0x4b4 => true, 0x4b6 => true, 0x4b8 => true, 0x4ba => true, 0x4bc => true, 0x4be => true, 0x4c0...0x4c1 => true, 0x4c3 => true, 0x4c5 => true, 0x4c7 => true, 0x4c9 => true, 0x4cb => true, 0x4cd => true, 0x4d0 => true, 0x4d2 => true, 0x4d4 => true, 0x4d6 => true, 0x4d8 => true, 0x4da => true, 0x4dc => true, 0x4de => true, 0x4e0 => true, 0x4e2 => true, 0x4e4 => true, 0x4e6 => true, 0x4e8 => true, 0x4ea => true, 0x4ec => true, 0x4ee => true, 0x4f0 => true, 0x4f2 => true, 0x4f4 => true, 0x4f6 => true, 0x4f8 => true, 0x4fa => true, 0x4fc => true, 0x4fe => true, 0x500 => true, 0x502 => true, 0x504 => true, 0x506 => true, 0x508 => true, 0x50a => true, 0x50c => true, 0x50e => true, 0x510 => true, 0x512 => true, 0x514 => true, 0x516 => true, 0x518 => true, 0x51a => true, 0x51c => true, 0x51e => true, 0x520 => true, 0x522 => true, 0x524 => true, 0x526 => true, 0x528 => true, 0x52a => true, 0x52c => true, 0x52e => true, 0x531...0x556 => true, 0x10a0...0x10c5 => true, 0x10c7 => true, 0x10cd => true, 0x13a0...0x13f5 => true, 0x1c90...0x1cba => true, 0x1cbd...0x1cbf => true, 0x1e00 => true, 0x1e02 => true, 0x1e04 => true, 0x1e06 => true, 0x1e08 => true, 0x1e0a => true, 0x1e0c => true, 0x1e0e => true, 0x1e10 => true, 0x1e12 => true, 0x1e14 => true, 0x1e16 => true, 0x1e18 => true, 0x1e1a => true, 0x1e1c => true, 0x1e1e => true, 0x1e20 => true, 0x1e22 => true, 0x1e24 => true, 0x1e26 => true, 0x1e28 => true, 0x1e2a => true, 0x1e2c => true, 0x1e2e => true, 0x1e30 => true, 0x1e32 => true, 0x1e34 => true, 0x1e36 => true, 0x1e38 => true, 0x1e3a => true, 0x1e3c => true, 0x1e3e => true, 0x1e40 => true, 0x1e42 => true, 0x1e44 => true, 0x1e46 => true, 0x1e48 => true, 0x1e4a => true, 0x1e4c => true, 0x1e4e => true, 0x1e50 => true, 0x1e52 => true, 0x1e54 => true, 0x1e56 => true, 0x1e58 => true, 0x1e5a => true, 0x1e5c => true, 0x1e5e => true, 0x1e60 => true, 0x1e62 => true, 0x1e64 => true, 0x1e66 => true, 0x1e68 => true, 0x1e6a => true, 0x1e6c => true, 0x1e6e => true, 0x1e70 => true, 0x1e72 => true, 0x1e74 => true, 0x1e76 => true, 0x1e78 => true, 0x1e7a => true, 0x1e7c => true, 0x1e7e => true, 0x1e80 => true, 0x1e82 => true, 0x1e84 => true, 0x1e86 => true, 0x1e88 => true, 0x1e8a => true, 0x1e8c => true, 0x1e8e => true, 0x1e90 => true, 0x1e92 => true, 0x1e94 => true, 0x1e9e => true, 0x1ea0 => true, 0x1ea2 => true, 0x1ea4 => true, 0x1ea6 => true, 0x1ea8 => true, 0x1eaa => true, 0x1eac => true, 0x1eae => true, 0x1eb0 => true, 0x1eb2 => true, 0x1eb4 => true, 0x1eb6 => true, 0x1eb8 => true, 0x1eba => true, 0x1ebc => true, 0x1ebe => true, 0x1ec0 => true, 0x1ec2 => true, 0x1ec4 => true, 0x1ec6 => true, 0x1ec8 => true, 0x1eca => true, 0x1ecc => true, 0x1ece => true, 0x1ed0 => true, 0x1ed2 => true, 0x1ed4 => true, 0x1ed6 => true, 0x1ed8 => true, 0x1eda => true, 0x1edc => true, 0x1ede => true, 0x1ee0 => true, 0x1ee2 => true, 0x1ee4 => true, 0x1ee6 => true, 0x1ee8 => true, 0x1eea => true, 0x1eec => true, 0x1eee => true, 0x1ef0 => true, 0x1ef2 => true, 0x1ef4 => true, 0x1ef6 => true, 0x1ef8 => true, 0x1efa => true, 0x1efc => true, 0x1efe => true, 0x1f08...0x1f0f => true, 0x1f18...0x1f1d => true, 0x1f28...0x1f2f => true, 0x1f38...0x1f3f => true, 0x1f48...0x1f4d => true, 0x1f59 => true, 0x1f5b => true, 0x1f5d => true, 0x1f5f => true, 0x1f68...0x1f6f => true, 0x1f88...0x1f8f => true, 0x1f98...0x1f9f => true, 0x1fa8...0x1faf => true, 0x1fb8...0x1fbc => true, 0x1fc8...0x1fcc => true, 0x1fd8...0x1fdb => true, 0x1fe8...0x1fec => true, 0x1ff8...0x1ffc => true, 0x2126 => true, 0x212a...0x212b => true, 0x2132 => true, 0x2160...0x216f => true, 0x2183 => true, 0x24b6...0x24cf => true, 0x2c00...0x2c2f => true, 0x2c60 => true, 0x2c62...0x2c64 => true, 0x2c67 => true, 0x2c69 => true, 0x2c6b => true, 0x2c6d...0x2c70 => true, 0x2c72 => true, 0x2c75 => true, 0x2c7e...0x2c80 => true, 0x2c82 => true, 0x2c84 => true, 0x2c86 => true, 0x2c88 => true, 0x2c8a => true, 0x2c8c => true, 0x2c8e => true, 0x2c90 => true, 0x2c92 => true, 0x2c94 => true, 0x2c96 => true, 0x2c98 => true, 0x2c9a => true, 0x2c9c => true, 0x2c9e => true, 0x2ca0 => true, 0x2ca2 => true, 0x2ca4 => true, 0x2ca6 => true, 0x2ca8 => true, 0x2caa => true, 0x2cac => true, 0x2cae => true, 0x2cb0 => true, 0x2cb2 => true, 0x2cb4 => true, 0x2cb6 => true, 0x2cb8 => true, 0x2cba => true, 0x2cbc => true, 0x2cbe => true, 0x2cc0 => true, 0x2cc2 => true, 0x2cc4 => true, 0x2cc6 => true, 0x2cc8 => true, 0x2cca => true, 0x2ccc => true, 0x2cce => true, 0x2cd0 => true, 0x2cd2 => true, 0x2cd4 => true, 0x2cd6 => true, 0x2cd8 => true, 0x2cda => true, 0x2cdc => true, 0x2cde => true, 0x2ce0 => true, 0x2ce2 => true, 0x2ceb => true, 0x2ced => true, 0x2cf2 => true, 0xa640 => true, 0xa642 => true, 0xa644 => true, 0xa646 => true, 0xa648 => true, 0xa64a => true, 0xa64c => true, 0xa64e => true, 0xa650 => true, 0xa652 => true, 0xa654 => true, 0xa656 => true, 0xa658 => true, 0xa65a => true, 0xa65c => true, 0xa65e => true, 0xa660 => true, 0xa662 => true, 0xa664 => true, 0xa666 => true, 0xa668 => true, 0xa66a => true, 0xa66c => true, 0xa680 => true, 0xa682 => true, 0xa684 => true, 0xa686 => true, 0xa688 => true, 0xa68a => true, 0xa68c => true, 0xa68e => true, 0xa690 => true, 0xa692 => true, 0xa694 => true, 0xa696 => true, 0xa698 => true, 0xa69a => true, 0xa722 => true, 0xa724 => true, 0xa726 => true, 0xa728 => true, 0xa72a => true, 0xa72c => true, 0xa72e => true, 0xa732 => true, 0xa734 => true, 0xa736 => true, 0xa738 => true, 0xa73a => true, 0xa73c => true, 0xa73e => true, 0xa740 => true, 0xa742 => true, 0xa744 => true, 0xa746 => true, 0xa748 => true, 0xa74a => true, 0xa74c => true, 0xa74e => true, 0xa750 => true, 0xa752 => true, 0xa754 => true, 0xa756 => true, 0xa758 => true, 0xa75a => true, 0xa75c => true, 0xa75e => true, 0xa760 => true, 0xa762 => true, 0xa764 => true, 0xa766 => true, 0xa768 => true, 0xa76a => true, 0xa76c => true, 0xa76e => true, 0xa779 => true, 0xa77b => true, 0xa77d...0xa77e => true, 0xa780 => true, 0xa782 => true, 0xa784 => true, 0xa786 => true, 0xa78b => true, 0xa78d => true, 0xa790 => true, 0xa792 => true, 0xa796 => true, 0xa798 => true, 0xa79a => true, 0xa79c => true, 0xa79e => true, 0xa7a0 => true, 0xa7a2 => true, 0xa7a4 => true, 0xa7a6 => true, 0xa7a8 => true, 0xa7aa...0xa7ae => true, 0xa7b0...0xa7b4 => true, 0xa7b6 => true, 0xa7b8 => true, 0xa7ba => true, 0xa7bc => true, 0xa7be => true, 0xa7c0 => true, 0xa7c2 => true, 0xa7c4...0xa7c7 => true, 0xa7c9 => true, 0xa7d0 => true, 0xa7d6 => true, 0xa7d8 => true, 0xa7f5 => true, 0xff21...0xff3a => true, 0x10400...0x10427 => true, 0x104b0...0x104d3 => true, 0x10570...0x1057a => true, 0x1057c...0x1058a => true, 0x1058c...0x10592 => true, 0x10594...0x10595 => true, 0x10c80...0x10cb2 => true, 0x118a0...0x118bf => true, 0x16e40...0x16e5f => true, 0x1e900...0x1e921 => true, else => false, }; } pub fn isChangesWhenUppercased(cp: u21) bool { if (cp < 0x61 or cp > 0x1e943) return false; return switch (cp) { 0x61...0x7a => true, 0xb5 => true, 0xdf...0xf6 => true, 0xf8...0xff => true, 0x101 => true, 0x103 => true, 0x105 => true, 0x107 => true, 0x109 => true, 0x10b => true, 0x10d => true, 0x10f => true, 0x111 => true, 0x113 => true, 0x115 => true, 0x117 => true, 0x119 => true, 0x11b => true, 0x11d => true, 0x11f => true, 0x121 => true, 0x123 => true, 0x125 => true, 0x127 => true, 0x129 => true, 0x12b => true, 0x12d => true, 0x12f => true, 0x131 => true, 0x133 => true, 0x135 => true, 0x137 => true, 0x13a => true, 0x13c => true, 0x13e => true, 0x140 => true, 0x142 => true, 0x144 => true, 0x146 => true, 0x148...0x149 => true, 0x14b => true, 0x14d => true, 0x14f => true, 0x151 => true, 0x153 => true, 0x155 => true, 0x157 => true, 0x159 => true, 0x15b => true, 0x15d => true, 0x15f => true, 0x161 => true, 0x163 => true, 0x165 => true, 0x167 => true, 0x169 => true, 0x16b => true, 0x16d => true, 0x16f => true, 0x171 => true, 0x173 => true, 0x175 => true, 0x177 => true, 0x17a => true, 0x17c => true, 0x17e...0x180 => true, 0x183 => true, 0x185 => true, 0x188 => true, 0x18c => true, 0x192 => true, 0x195 => true, 0x199...0x19a => true, 0x19e => true, 0x1a1 => true, 0x1a3 => true, 0x1a5 => true, 0x1a8 => true, 0x1ad => true, 0x1b0 => true, 0x1b4 => true, 0x1b6 => true, 0x1b9 => true, 0x1bd => true, 0x1bf => true, 0x1c5...0x1c6 => true, 0x1c8...0x1c9 => true, 0x1cb...0x1cc => true, 0x1ce => true, 0x1d0 => true, 0x1d2 => true, 0x1d4 => true, 0x1d6 => true, 0x1d8 => true, 0x1da => true, 0x1dc...0x1dd => true, 0x1df => true, 0x1e1 => true, 0x1e3 => true, 0x1e5 => true, 0x1e7 => true, 0x1e9 => true, 0x1eb => true, 0x1ed => true, 0x1ef...0x1f0 => true, 0x1f2...0x1f3 => true, 0x1f5 => true, 0x1f9 => true, 0x1fb => true, 0x1fd => true, 0x1ff => true, 0x201 => true, 0x203 => true, 0x205 => true, 0x207 => true, 0x209 => true, 0x20b => true, 0x20d => true, 0x20f => true, 0x211 => true, 0x213 => true, 0x215 => true, 0x217 => true, 0x219 => true, 0x21b => true, 0x21d => true, 0x21f => true, 0x223 => true, 0x225 => true, 0x227 => true, 0x229 => true, 0x22b => true, 0x22d => true, 0x22f => true, 0x231 => true, 0x233 => true, 0x23c => true, 0x23f...0x240 => true, 0x242 => true, 0x247 => true, 0x249 => true, 0x24b => true, 0x24d => true, 0x24f...0x254 => true, 0x256...0x257 => true, 0x259 => true, 0x25b...0x25c => true, 0x260...0x261 => true, 0x263 => true, 0x265...0x266 => true, 0x268...0x26c => true, 0x26f => true, 0x271...0x272 => true, 0x275 => true, 0x27d => true, 0x280 => true, 0x282...0x283 => true, 0x287...0x28c => true, 0x292 => true, 0x29d...0x29e => true, 0x345 => true, 0x371 => true, 0x373 => true, 0x377 => true, 0x37b...0x37d => true, 0x390 => true, 0x3ac...0x3ce => true, 0x3d0...0x3d1 => true, 0x3d5...0x3d7 => true, 0x3d9 => true, 0x3db => true, 0x3dd => true, 0x3df => true, 0x3e1 => true, 0x3e3 => true, 0x3e5 => true, 0x3e7 => true, 0x3e9 => true, 0x3eb => true, 0x3ed => true, 0x3ef...0x3f3 => true, 0x3f5 => true, 0x3f8 => true, 0x3fb => true, 0x430...0x45f => true, 0x461 => true, 0x463 => true, 0x465 => true, 0x467 => true, 0x469 => true, 0x46b => true, 0x46d => true, 0x46f => true, 0x471 => true, 0x473 => true, 0x475 => true, 0x477 => true, 0x479 => true, 0x47b => true, 0x47d => true, 0x47f => true, 0x481 => true, 0x48b => true, 0x48d => true, 0x48f => true, 0x491 => true, 0x493 => true, 0x495 => true, 0x497 => true, 0x499 => true, 0x49b => true, 0x49d => true, 0x49f => true, 0x4a1 => true, 0x4a3 => true, 0x4a5 => true, 0x4a7 => true, 0x4a9 => true, 0x4ab => true, 0x4ad => true, 0x4af => true, 0x4b1 => true, 0x4b3 => true, 0x4b5 => true, 0x4b7 => true, 0x4b9 => true, 0x4bb => true, 0x4bd => true, 0x4bf => true, 0x4c2 => true, 0x4c4 => true, 0x4c6 => true, 0x4c8 => true, 0x4ca => true, 0x4cc => true, 0x4ce...0x4cf => true, 0x4d1 => true, 0x4d3 => true, 0x4d5 => true, 0x4d7 => true, 0x4d9 => true, 0x4db => true, 0x4dd => true, 0x4df => true, 0x4e1 => true, 0x4e3 => true, 0x4e5 => true, 0x4e7 => true, 0x4e9 => true, 0x4eb => true, 0x4ed => true, 0x4ef => true, 0x4f1 => true, 0x4f3 => true, 0x4f5 => true, 0x4f7 => true, 0x4f9 => true, 0x4fb => true, 0x4fd => true, 0x4ff => true, 0x501 => true, 0x503 => true, 0x505 => true, 0x507 => true, 0x509 => true, 0x50b => true, 0x50d => true, 0x50f => true, 0x511 => true, 0x513 => true, 0x515 => true, 0x517 => true, 0x519 => true, 0x51b => true, 0x51d => true, 0x51f => true, 0x521 => true, 0x523 => true, 0x525 => true, 0x527 => true, 0x529 => true, 0x52b => true, 0x52d => true, 0x52f => true, 0x561...0x587 => true, 0x10d0...0x10fa => true, 0x10fd...0x10ff => true, 0x13f8...0x13fd => true, 0x1c80...0x1c88 => true, 0x1d79 => true, 0x1d7d => true, 0x1d8e => true, 0x1e01 => true, 0x1e03 => true, 0x1e05 => true, 0x1e07 => true, 0x1e09 => true, 0x1e0b => true, 0x1e0d => true, 0x1e0f => true, 0x1e11 => true, 0x1e13 => true, 0x1e15 => true, 0x1e17 => true, 0x1e19 => true, 0x1e1b => true, 0x1e1d => true, 0x1e1f => true, 0x1e21 => true, 0x1e23 => true, 0x1e25 => true, 0x1e27 => true, 0x1e29 => true, 0x1e2b => true, 0x1e2d => true, 0x1e2f => true, 0x1e31 => true, 0x1e33 => true, 0x1e35 => true, 0x1e37 => true, 0x1e39 => true, 0x1e3b => true, 0x1e3d => true, 0x1e3f => true, 0x1e41 => true, 0x1e43 => true, 0x1e45 => true, 0x1e47 => true, 0x1e49 => true, 0x1e4b => true, 0x1e4d => true, 0x1e4f => true, 0x1e51 => true, 0x1e53 => true, 0x1e55 => true, 0x1e57 => true, 0x1e59 => true, 0x1e5b => true, 0x1e5d => true, 0x1e5f => true, 0x1e61 => true, 0x1e63 => true, 0x1e65 => true, 0x1e67 => true, 0x1e69 => true, 0x1e6b => true, 0x1e6d => true, 0x1e6f => true, 0x1e71 => true, 0x1e73 => true, 0x1e75 => true, 0x1e77 => true, 0x1e79 => true, 0x1e7b => true, 0x1e7d => true, 0x1e7f => true, 0x1e81 => true, 0x1e83 => true, 0x1e85 => true, 0x1e87 => true, 0x1e89 => true, 0x1e8b => true, 0x1e8d => true, 0x1e8f => true, 0x1e91 => true, 0x1e93 => true, 0x1e95...0x1e9b => true, 0x1ea1 => true, 0x1ea3 => true, 0x1ea5 => true, 0x1ea7 => true, 0x1ea9 => true, 0x1eab => true, 0x1ead => true, 0x1eaf => true, 0x1eb1 => true, 0x1eb3 => true, 0x1eb5 => true, 0x1eb7 => true, 0x1eb9 => true, 0x1ebb => true, 0x1ebd => true, 0x1ebf => true, 0x1ec1 => true, 0x1ec3 => true, 0x1ec5 => true, 0x1ec7 => true, 0x1ec9 => true, 0x1ecb => true, 0x1ecd => true, 0x1ecf => true, 0x1ed1 => true, 0x1ed3 => true, 0x1ed5 => true, 0x1ed7 => true, 0x1ed9 => true, 0x1edb => true, 0x1edd => true, 0x1edf => true, 0x1ee1 => true, 0x1ee3 => true, 0x1ee5 => true, 0x1ee7 => true, 0x1ee9 => true, 0x1eeb => true, 0x1eed => true, 0x1eef => true, 0x1ef1 => true, 0x1ef3 => true, 0x1ef5 => true, 0x1ef7 => true, 0x1ef9 => true, 0x1efb => true, 0x1efd => true, 0x1eff...0x1f07 => true, 0x1f10...0x1f15 => true, 0x1f20...0x1f27 => true, 0x1f30...0x1f37 => true, 0x1f40...0x1f45 => true, 0x1f50...0x1f57 => true, 0x1f60...0x1f67 => true, 0x1f70...0x1f7d => true, 0x1f80...0x1fb4 => true, 0x1fb6...0x1fb7 => true, 0x1fbc => true, 0x1fbe => true, 0x1fc2...0x1fc4 => true, 0x1fc6...0x1fc7 => true, 0x1fcc => true, 0x1fd0...0x1fd3 => true, 0x1fd6...0x1fd7 => true, 0x1fe0...0x1fe7 => true, 0x1ff2...0x1ff4 => true, 0x1ff6...0x1ff7 => true, 0x1ffc => true, 0x214e => true, 0x2170...0x217f => true, 0x2184 => true, 0x24d0...0x24e9 => true, 0x2c30...0x2c5f => true, 0x2c61 => true, 0x2c65...0x2c66 => true, 0x2c68 => true, 0x2c6a => true, 0x2c6c => true, 0x2c73 => true, 0x2c76 => true, 0x2c81 => true, 0x2c83 => true, 0x2c85 => true, 0x2c87 => true, 0x2c89 => true, 0x2c8b => true, 0x2c8d => true, 0x2c8f => true, 0x2c91 => true, 0x2c93 => true, 0x2c95 => true, 0x2c97 => true, 0x2c99 => true, 0x2c9b => true, 0x2c9d => true, 0x2c9f => true, 0x2ca1 => true, 0x2ca3 => true, 0x2ca5 => true, 0x2ca7 => true, 0x2ca9 => true, 0x2cab => true, 0x2cad => true, 0x2caf => true, 0x2cb1 => true, 0x2cb3 => true, 0x2cb5 => true, 0x2cb7 => true, 0x2cb9 => true, 0x2cbb => true, 0x2cbd => true, 0x2cbf => true, 0x2cc1 => true, 0x2cc3 => true, 0x2cc5 => true, 0x2cc7 => true, 0x2cc9 => true, 0x2ccb => true, 0x2ccd => true, 0x2ccf => true, 0x2cd1 => true, 0x2cd3 => true, 0x2cd5 => true, 0x2cd7 => true, 0x2cd9 => true, 0x2cdb => true, 0x2cdd => true, 0x2cdf => true, 0x2ce1 => true, 0x2ce3 => true, 0x2cec => true, 0x2cee => true, 0x2cf3 => true, 0x2d00...0x2d25 => true, 0x2d27 => true, 0x2d2d => true, 0xa641 => true, 0xa643 => true, 0xa645 => true, 0xa647 => true, 0xa649 => true, 0xa64b => true, 0xa64d => true, 0xa64f => true, 0xa651 => true, 0xa653 => true, 0xa655 => true, 0xa657 => true, 0xa659 => true, 0xa65b => true, 0xa65d => true, 0xa65f => true, 0xa661 => true, 0xa663 => true, 0xa665 => true, 0xa667 => true, 0xa669 => true, 0xa66b => true, 0xa66d => true, 0xa681 => true, 0xa683 => true, 0xa685 => true, 0xa687 => true, 0xa689 => true, 0xa68b => true, 0xa68d => true, 0xa68f => true, 0xa691 => true, 0xa693 => true, 0xa695 => true, 0xa697 => true, 0xa699 => true, 0xa69b => true, 0xa723 => true, 0xa725 => true, 0xa727 => true, 0xa729 => true, 0xa72b => true, 0xa72d => true, 0xa72f => true, 0xa733 => true, 0xa735 => true, 0xa737 => true, 0xa739 => true, 0xa73b => true, 0xa73d => true, 0xa73f => true, 0xa741 => true, 0xa743 => true, 0xa745 => true, 0xa747 => true, 0xa749 => true, 0xa74b => true, 0xa74d => true, 0xa74f => true, 0xa751 => true, 0xa753 => true, 0xa755 => true, 0xa757 => true, 0xa759 => true, 0xa75b => true, 0xa75d => true, 0xa75f => true, 0xa761 => true, 0xa763 => true, 0xa765 => true, 0xa767 => true, 0xa769 => true, 0xa76b => true, 0xa76d => true, 0xa76f => true, 0xa77a => true, 0xa77c => true, 0xa77f => true, 0xa781 => true, 0xa783 => true, 0xa785 => true, 0xa787 => true, 0xa78c => true, 0xa791 => true, 0xa793...0xa794 => true, 0xa797 => true, 0xa799 => true, 0xa79b => true, 0xa79d => true, 0xa79f => true, 0xa7a1 => true, 0xa7a3 => true, 0xa7a5 => true, 0xa7a7 => true, 0xa7a9 => true, 0xa7b5 => true, 0xa7b7 => true, 0xa7b9 => true, 0xa7bb => true, 0xa7bd => true, 0xa7bf => true, 0xa7c1 => true, 0xa7c3 => true, 0xa7c8 => true, 0xa7ca => true, 0xa7d1 => true, 0xa7d7 => true, 0xa7d9 => true, 0xa7f6 => true, 0xab53 => true, 0xab70...0xabbf => true, 0xfb00...0xfb06 => true, 0xfb13...0xfb17 => true, 0xff41...0xff5a => true, 0x10428...0x1044f => true, 0x104d8...0x104fb => true, 0x10597...0x105a1 => true, 0x105a3...0x105b1 => true, 0x105b3...0x105b9 => true, 0x105bb...0x105bc => true, 0x10cc0...0x10cf2 => true, 0x118c0...0x118df => true, 0x16e60...0x16e7f => true, 0x1e922...0x1e943 => true, else => false, }; } pub fn isChangesWhenTitlecased(cp: u21) bool { if (cp < 0x61 or cp > 0x1e943) return false; return switch (cp) { 0x61...0x7a => true, 0xb5 => true, 0xdf...0xf6 => true, 0xf8...0xff => true, 0x101 => true, 0x103 => true, 0x105 => true, 0x107 => true, 0x109 => true, 0x10b => true, 0x10d => true, 0x10f => true, 0x111 => true, 0x113 => true, 0x115 => true, 0x117 => true, 0x119 => true, 0x11b => true, 0x11d => true, 0x11f => true, 0x121 => true, 0x123 => true, 0x125 => true, 0x127 => true, 0x129 => true, 0x12b => true, 0x12d => true, 0x12f => true, 0x131 => true, 0x133 => true, 0x135 => true, 0x137 => true, 0x13a => true, 0x13c => true, 0x13e => true, 0x140 => true, 0x142 => true, 0x144 => true, 0x146 => true, 0x148...0x149 => true, 0x14b => true, 0x14d => true, 0x14f => true, 0x151 => true, 0x153 => true, 0x155 => true, 0x157 => true, 0x159 => true, 0x15b => true, 0x15d => true, 0x15f => true, 0x161 => true, 0x163 => true, 0x165 => true, 0x167 => true, 0x169 => true, 0x16b => true, 0x16d => true, 0x16f => true, 0x171 => true, 0x173 => true, 0x175 => true, 0x177 => true, 0x17a => true, 0x17c => true, 0x17e...0x180 => true, 0x183 => true, 0x185 => true, 0x188 => true, 0x18c => true, 0x192 => true, 0x195 => true, 0x199...0x19a => true, 0x19e => true, 0x1a1 => true, 0x1a3 => true, 0x1a5 => true, 0x1a8 => true, 0x1ad => true, 0x1b0 => true, 0x1b4 => true, 0x1b6 => true, 0x1b9 => true, 0x1bd => true, 0x1bf => true, 0x1c4 => true, 0x1c6...0x1c7 => true, 0x1c9...0x1ca => true, 0x1cc => true, 0x1ce => true, 0x1d0 => true, 0x1d2 => true, 0x1d4 => true, 0x1d6 => true, 0x1d8 => true, 0x1da => true, 0x1dc...0x1dd => true, 0x1df => true, 0x1e1 => true, 0x1e3 => true, 0x1e5 => true, 0x1e7 => true, 0x1e9 => true, 0x1eb => true, 0x1ed => true, 0x1ef...0x1f1 => true, 0x1f3 => true, 0x1f5 => true, 0x1f9 => true, 0x1fb => true, 0x1fd => true, 0x1ff => true, 0x201 => true, 0x203 => true, 0x205 => true, 0x207 => true, 0x209 => true, 0x20b => true, 0x20d => true, 0x20f => true, 0x211 => true, 0x213 => true, 0x215 => true, 0x217 => true, 0x219 => true, 0x21b => true, 0x21d => true, 0x21f => true, 0x223 => true, 0x225 => true, 0x227 => true, 0x229 => true, 0x22b => true, 0x22d => true, 0x22f => true, 0x231 => true, 0x233 => true, 0x23c => true, 0x23f...0x240 => true, 0x242 => true, 0x247 => true, 0x249 => true, 0x24b => true, 0x24d => true, 0x24f...0x254 => true, 0x256...0x257 => true, 0x259 => true, 0x25b...0x25c => true, 0x260...0x261 => true, 0x263 => true, 0x265...0x266 => true, 0x268...0x26c => true, 0x26f => true, 0x271...0x272 => true, 0x275 => true, 0x27d => true, 0x280 => true, 0x282...0x283 => true, 0x287...0x28c => true, 0x292 => true, 0x29d...0x29e => true, 0x345 => true, 0x371 => true, 0x373 => true, 0x377 => true, 0x37b...0x37d => true, 0x390 => true, 0x3ac...0x3ce => true, 0x3d0...0x3d1 => true, 0x3d5...0x3d7 => true, 0x3d9 => true, 0x3db => true, 0x3dd => true, 0x3df => true, 0x3e1 => true, 0x3e3 => true, 0x3e5 => true, 0x3e7 => true, 0x3e9 => true, 0x3eb => true, 0x3ed => true, 0x3ef...0x3f3 => true, 0x3f5 => true, 0x3f8 => true, 0x3fb => true, 0x430...0x45f => true, 0x461 => true, 0x463 => true, 0x465 => true, 0x467 => true, 0x469 => true, 0x46b => true, 0x46d => true, 0x46f => true, 0x471 => true, 0x473 => true, 0x475 => true, 0x477 => true, 0x479 => true, 0x47b => true, 0x47d => true, 0x47f => true, 0x481 => true, 0x48b => true, 0x48d => true, 0x48f => true, 0x491 => true, 0x493 => true, 0x495 => true, 0x497 => true, 0x499 => true, 0x49b => true, 0x49d => true, 0x49f => true, 0x4a1 => true, 0x4a3 => true, 0x4a5 => true, 0x4a7 => true, 0x4a9 => true, 0x4ab => true, 0x4ad => true, 0x4af => true, 0x4b1 => true, 0x4b3 => true, 0x4b5 => true, 0x4b7 => true, 0x4b9 => true, 0x4bb => true, 0x4bd => true, 0x4bf => true, 0x4c2 => true, 0x4c4 => true, 0x4c6 => true, 0x4c8 => true, 0x4ca => true, 0x4cc => true, 0x4ce...0x4cf => true, 0x4d1 => true, 0x4d3 => true, 0x4d5 => true, 0x4d7 => true, 0x4d9 => true, 0x4db => true, 0x4dd => true, 0x4df => true, 0x4e1 => true, 0x4e3 => true, 0x4e5 => true, 0x4e7 => true, 0x4e9 => true, 0x4eb => true, 0x4ed => true, 0x4ef => true, 0x4f1 => true, 0x4f3 => true, 0x4f5 => true, 0x4f7 => true, 0x4f9 => true, 0x4fb => true, 0x4fd => true, 0x4ff => true, 0x501 => true, 0x503 => true, 0x505 => true, 0x507 => true, 0x509 => true, 0x50b => true, 0x50d => true, 0x50f => true, 0x511 => true, 0x513 => true, 0x515 => true, 0x517 => true, 0x519 => true, 0x51b => true, 0x51d => true, 0x51f => true, 0x521 => true, 0x523 => true, 0x525 => true, 0x527 => true, 0x529 => true, 0x52b => true, 0x52d => true, 0x52f => true, 0x561...0x587 => true, 0x13f8...0x13fd => true, 0x1c80...0x1c88 => true, 0x1d79 => true, 0x1d7d => true, 0x1d8e => true, 0x1e01 => true, 0x1e03 => true, 0x1e05 => true, 0x1e07 => true, 0x1e09 => true, 0x1e0b => true, 0x1e0d => true, 0x1e0f => true, 0x1e11 => true, 0x1e13 => true, 0x1e15 => true, 0x1e17 => true, 0x1e19 => true, 0x1e1b => true, 0x1e1d => true, 0x1e1f => true, 0x1e21 => true, 0x1e23 => true, 0x1e25 => true, 0x1e27 => true, 0x1e29 => true, 0x1e2b => true, 0x1e2d => true, 0x1e2f => true, 0x1e31 => true, 0x1e33 => true, 0x1e35 => true, 0x1e37 => true, 0x1e39 => true, 0x1e3b => true, 0x1e3d => true, 0x1e3f => true, 0x1e41 => true, 0x1e43 => true, 0x1e45 => true, 0x1e47 => true, 0x1e49 => true, 0x1e4b => true, 0x1e4d => true, 0x1e4f => true, 0x1e51 => true, 0x1e53 => true, 0x1e55 => true, 0x1e57 => true, 0x1e59 => true, 0x1e5b => true, 0x1e5d => true, 0x1e5f => true, 0x1e61 => true, 0x1e63 => true, 0x1e65 => true, 0x1e67 => true, 0x1e69 => true, 0x1e6b => true, 0x1e6d => true, 0x1e6f => true, 0x1e71 => true, 0x1e73 => true, 0x1e75 => true, 0x1e77 => true, 0x1e79 => true, 0x1e7b => true, 0x1e7d => true, 0x1e7f => true, 0x1e81 => true, 0x1e83 => true, 0x1e85 => true, 0x1e87 => true, 0x1e89 => true, 0x1e8b => true, 0x1e8d => true, 0x1e8f => true, 0x1e91 => true, 0x1e93 => true, 0x1e95...0x1e9b => true, 0x1ea1 => true, 0x1ea3 => true, 0x1ea5 => true, 0x1ea7 => true, 0x1ea9 => true, 0x1eab => true, 0x1ead => true, 0x1eaf => true, 0x1eb1 => true, 0x1eb3 => true, 0x1eb5 => true, 0x1eb7 => true, 0x1eb9 => true, 0x1ebb => true, 0x1ebd => true, 0x1ebf => true, 0x1ec1 => true, 0x1ec3 => true, 0x1ec5 => true, 0x1ec7 => true, 0x1ec9 => true, 0x1ecb => true, 0x1ecd => true, 0x1ecf => true, 0x1ed1 => true, 0x1ed3 => true, 0x1ed5 => true, 0x1ed7 => true, 0x1ed9 => true, 0x1edb => true, 0x1edd => true, 0x1edf => true, 0x1ee1 => true, 0x1ee3 => true, 0x1ee5 => true, 0x1ee7 => true, 0x1ee9 => true, 0x1eeb => true, 0x1eed => true, 0x1eef => true, 0x1ef1 => true, 0x1ef3 => true, 0x1ef5 => true, 0x1ef7 => true, 0x1ef9 => true, 0x1efb => true, 0x1efd => true, 0x1eff...0x1f07 => true, 0x1f10...0x1f15 => true, 0x1f20...0x1f27 => true, 0x1f30...0x1f37 => true, 0x1f40...0x1f45 => true, 0x1f50...0x1f57 => true, 0x1f60...0x1f67 => true, 0x1f70...0x1f7d => true, 0x1f80...0x1f87 => true, 0x1f90...0x1f97 => true, 0x1fa0...0x1fa7 => true, 0x1fb0...0x1fb4 => true, 0x1fb6...0x1fb7 => true, 0x1fbe => true, 0x1fc2...0x1fc4 => true, 0x1fc6...0x1fc7 => true, 0x1fd0...0x1fd3 => true, 0x1fd6...0x1fd7 => true, 0x1fe0...0x1fe7 => true, 0x1ff2...0x1ff4 => true, 0x1ff6...0x1ff7 => true, 0x214e => true, 0x2170...0x217f => true, 0x2184 => true, 0x24d0...0x24e9 => true, 0x2c30...0x2c5f => true, 0x2c61 => true, 0x2c65...0x2c66 => true, 0x2c68 => true, 0x2c6a => true, 0x2c6c => true, 0x2c73 => true, 0x2c76 => true, 0x2c81 => true, 0x2c83 => true, 0x2c85 => true, 0x2c87 => true, 0x2c89 => true, 0x2c8b => true, 0x2c8d => true, 0x2c8f => true, 0x2c91 => true, 0x2c93 => true, 0x2c95 => true, 0x2c97 => true, 0x2c99 => true, 0x2c9b => true, 0x2c9d => true, 0x2c9f => true, 0x2ca1 => true, 0x2ca3 => true, 0x2ca5 => true, 0x2ca7 => true, 0x2ca9 => true, 0x2cab => true, 0x2cad => true, 0x2caf => true, 0x2cb1 => true, 0x2cb3 => true, 0x2cb5 => true, 0x2cb7 => true, 0x2cb9 => true, 0x2cbb => true, 0x2cbd => true, 0x2cbf => true, 0x2cc1 => true, 0x2cc3 => true, 0x2cc5 => true, 0x2cc7 => true, 0x2cc9 => true, 0x2ccb => true, 0x2ccd => true, 0x2ccf => true, 0x2cd1 => true, 0x2cd3 => true, 0x2cd5 => true, 0x2cd7 => true, 0x2cd9 => true, 0x2cdb => true, 0x2cdd => true, 0x2cdf => true, 0x2ce1 => true, 0x2ce3 => true, 0x2cec => true, 0x2cee => true, 0x2cf3 => true, 0x2d00...0x2d25 => true, 0x2d27 => true, 0x2d2d => true, 0xa641 => true, 0xa643 => true, 0xa645 => true, 0xa647 => true, 0xa649 => true, 0xa64b => true, 0xa64d => true, 0xa64f => true, 0xa651 => true, 0xa653 => true, 0xa655 => true, 0xa657 => true, 0xa659 => true, 0xa65b => true, 0xa65d => true, 0xa65f => true, 0xa661 => true, 0xa663 => true, 0xa665 => true, 0xa667 => true, 0xa669 => true, 0xa66b => true, 0xa66d => true, 0xa681 => true, 0xa683 => true, 0xa685 => true, 0xa687 => true, 0xa689 => true, 0xa68b => true, 0xa68d => true, 0xa68f => true, 0xa691 => true, 0xa693 => true, 0xa695 => true, 0xa697 => true, 0xa699 => true, 0xa69b => true, 0xa723 => true, 0xa725 => true, 0xa727 => true, 0xa729 => true, 0xa72b => true, 0xa72d => true, 0xa72f => true, 0xa733 => true, 0xa735 => true, 0xa737 => true, 0xa739 => true, 0xa73b => true, 0xa73d => true, 0xa73f => true, 0xa741 => true, 0xa743 => true, 0xa745 => true, 0xa747 => true, 0xa749 => true, 0xa74b => true, 0xa74d => true, 0xa74f => true, 0xa751 => true, 0xa753 => true, 0xa755 => true, 0xa757 => true, 0xa759 => true, 0xa75b => true, 0xa75d => true, 0xa75f => true, 0xa761 => true, 0xa763 => true, 0xa765 => true, 0xa767 => true, 0xa769 => true, 0xa76b => true, 0xa76d => true, 0xa76f => true, 0xa77a => true, 0xa77c => true, 0xa77f => true, 0xa781 => true, 0xa783 => true, 0xa785 => true, 0xa787 => true, 0xa78c => true, 0xa791 => true, 0xa793...0xa794 => true, 0xa797 => true, 0xa799 => true, 0xa79b => true, 0xa79d => true, 0xa79f => true, 0xa7a1 => true, 0xa7a3 => true, 0xa7a5 => true, 0xa7a7 => true, 0xa7a9 => true, 0xa7b5 => true, 0xa7b7 => true, 0xa7b9 => true, 0xa7bb => true, 0xa7bd => true, 0xa7bf => true, 0xa7c1 => true, 0xa7c3 => true, 0xa7c8 => true, 0xa7ca => true, 0xa7d1 => true, 0xa7d7 => true, 0xa7d9 => true, 0xa7f6 => true, 0xab53 => true, 0xab70...0xabbf => true, 0xfb00...0xfb06 => true, 0xfb13...0xfb17 => true, 0xff41...0xff5a => true, 0x10428...0x1044f => true, 0x104d8...0x104fb => true, 0x10597...0x105a1 => true, 0x105a3...0x105b1 => true, 0x105b3...0x105b9 => true, 0x105bb...0x105bc => true, 0x10cc0...0x10cf2 => true, 0x118c0...0x118df => true, 0x16e60...0x16e7f => true, 0x1e922...0x1e943 => true, else => false, }; } pub fn isChangesWhenCasefolded(cp: u21) bool { if (cp < 0x41 or cp > 0x1e921) return false; return switch (cp) { 0x41...0x5a => true, 0xb5 => true, 0xc0...0xd6 => true, 0xd8...0xdf => true, 0x100 => true, 0x102 => true, 0x104 => true, 0x106 => true, 0x108 => true, 0x10a => true, 0x10c => true, 0x10e => true, 0x110 => true, 0x112 => true, 0x114 => true, 0x116 => true, 0x118 => true, 0x11a => true, 0x11c => true, 0x11e => true, 0x120 => true, 0x122 => true, 0x124 => true, 0x126 => true, 0x128 => true, 0x12a => true, 0x12c => true, 0x12e => true, 0x130 => true, 0x132 => true, 0x134 => true, 0x136 => true, 0x139 => true, 0x13b => true, 0x13d => true, 0x13f => true, 0x141 => true, 0x143 => true, 0x145 => true, 0x147 => true, 0x149...0x14a => true, 0x14c => true, 0x14e => true, 0x150 => true, 0x152 => true, 0x154 => true, 0x156 => true, 0x158 => true, 0x15a => true, 0x15c => true, 0x15e => true, 0x160 => true, 0x162 => true, 0x164 => true, 0x166 => true, 0x168 => true, 0x16a => true, 0x16c => true, 0x16e => true, 0x170 => true, 0x172 => true, 0x174 => true, 0x176 => true, 0x178...0x179 => true, 0x17b => true, 0x17d => true, 0x17f => true, 0x181...0x182 => true, 0x184 => true, 0x186...0x187 => true, 0x189...0x18b => true, 0x18e...0x191 => true, 0x193...0x194 => true, 0x196...0x198 => true, 0x19c...0x19d => true, 0x19f...0x1a0 => true, 0x1a2 => true, 0x1a4 => true, 0x1a6...0x1a7 => true, 0x1a9 => true, 0x1ac => true, 0x1ae...0x1af => true, 0x1b1...0x1b3 => true, 0x1b5 => true, 0x1b7...0x1b8 => true, 0x1bc => true, 0x1c4...0x1c5 => true, 0x1c7...0x1c8 => true, 0x1ca...0x1cb => true, 0x1cd => true, 0x1cf => true, 0x1d1 => true, 0x1d3 => true, 0x1d5 => true, 0x1d7 => true, 0x1d9 => true, 0x1db => true, 0x1de => true, 0x1e0 => true, 0x1e2 => true, 0x1e4 => true, 0x1e6 => true, 0x1e8 => true, 0x1ea => true, 0x1ec => true, 0x1ee => true, 0x1f1...0x1f2 => true, 0x1f4 => true, 0x1f6...0x1f8 => true, 0x1fa => true, 0x1fc => true, 0x1fe => true, 0x200 => true, 0x202 => true, 0x204 => true, 0x206 => true, 0x208 => true, 0x20a => true, 0x20c => true, 0x20e => true, 0x210 => true, 0x212 => true, 0x214 => true, 0x216 => true, 0x218 => true, 0x21a => true, 0x21c => true, 0x21e => true, 0x220 => true, 0x222 => true, 0x224 => true, 0x226 => true, 0x228 => true, 0x22a => true, 0x22c => true, 0x22e => true, 0x230 => true, 0x232 => true, 0x23a...0x23b => true, 0x23d...0x23e => true, 0x241 => true, 0x243...0x246 => true, 0x248 => true, 0x24a => true, 0x24c => true, 0x24e => true, 0x345 => true, 0x370 => true, 0x372 => true, 0x376 => true, 0x37f => true, 0x386 => true, 0x388...0x38a => true, 0x38c => true, 0x38e...0x38f => true, 0x391...0x3a1 => true, 0x3a3...0x3ab => true, 0x3c2 => true, 0x3cf...0x3d1 => true, 0x3d5...0x3d6 => true, 0x3d8 => true, 0x3da => true, 0x3dc => true, 0x3de => true, 0x3e0 => true, 0x3e2 => true, 0x3e4 => true, 0x3e6 => true, 0x3e8 => true, 0x3ea => true, 0x3ec => true, 0x3ee => true, 0x3f0...0x3f1 => true, 0x3f4...0x3f5 => true, 0x3f7 => true, 0x3f9...0x3fa => true, 0x3fd...0x42f => true, 0x460 => true, 0x462 => true, 0x464 => true, 0x466 => true, 0x468 => true, 0x46a => true, 0x46c => true, 0x46e => true, 0x470 => true, 0x472 => true, 0x474 => true, 0x476 => true, 0x478 => true, 0x47a => true, 0x47c => true, 0x47e => true, 0x480 => true, 0x48a => true, 0x48c => true, 0x48e => true, 0x490 => true, 0x492 => true, 0x494 => true, 0x496 => true, 0x498 => true, 0x49a => true, 0x49c => true, 0x49e => true, 0x4a0 => true, 0x4a2 => true, 0x4a4 => true, 0x4a6 => true, 0x4a8 => true, 0x4aa => true, 0x4ac => true, 0x4ae => true, 0x4b0 => true, 0x4b2 => true, 0x4b4 => true, 0x4b6 => true, 0x4b8 => true, 0x4ba => true, 0x4bc => true, 0x4be => true, 0x4c0...0x4c1 => true, 0x4c3 => true, 0x4c5 => true, 0x4c7 => true, 0x4c9 => true, 0x4cb => true, 0x4cd => true, 0x4d0 => true, 0x4d2 => true, 0x4d4 => true, 0x4d6 => true, 0x4d8 => true, 0x4da => true, 0x4dc => true, 0x4de => true, 0x4e0 => true, 0x4e2 => true, 0x4e4 => true, 0x4e6 => true, 0x4e8 => true, 0x4ea => true, 0x4ec => true, 0x4ee => true, 0x4f0 => true, 0x4f2 => true, 0x4f4 => true, 0x4f6 => true, 0x4f8 => true, 0x4fa => true, 0x4fc => true, 0x4fe => true, 0x500 => true, 0x502 => true, 0x504 => true, 0x506 => true, 0x508 => true, 0x50a => true, 0x50c => true, 0x50e => true, 0x510 => true, 0x512 => true, 0x514 => true, 0x516 => true, 0x518 => true, 0x51a => true, 0x51c => true, 0x51e => true, 0x520 => true, 0x522 => true, 0x524 => true, 0x526 => true, 0x528 => true, 0x52a => true, 0x52c => true, 0x52e => true, 0x531...0x556 => true, 0x587 => true, 0x10a0...0x10c5 => true, 0x10c7 => true, 0x10cd => true, 0x13f8...0x13fd => true, 0x1c80...0x1c88 => true, 0x1c90...0x1cba => true, 0x1cbd...0x1cbf => true, 0x1e00 => true, 0x1e02 => true, 0x1e04 => true, 0x1e06 => true, 0x1e08 => true, 0x1e0a => true, 0x1e0c => true, 0x1e0e => true, 0x1e10 => true, 0x1e12 => true, 0x1e14 => true, 0x1e16 => true, 0x1e18 => true, 0x1e1a => true, 0x1e1c => true, 0x1e1e => true, 0x1e20 => true, 0x1e22 => true, 0x1e24 => true, 0x1e26 => true, 0x1e28 => true, 0x1e2a => true, 0x1e2c => true, 0x1e2e => true, 0x1e30 => true, 0x1e32 => true, 0x1e34 => true, 0x1e36 => true, 0x1e38 => true, 0x1e3a => true, 0x1e3c => true, 0x1e3e => true, 0x1e40 => true, 0x1e42 => true, 0x1e44 => true, 0x1e46 => true, 0x1e48 => true, 0x1e4a => true, 0x1e4c => true, 0x1e4e => true, 0x1e50 => true, 0x1e52 => true, 0x1e54 => true, 0x1e56 => true, 0x1e58 => true, 0x1e5a => true, 0x1e5c => true, 0x1e5e => true, 0x1e60 => true, 0x1e62 => true, 0x1e64 => true, 0x1e66 => true, 0x1e68 => true, 0x1e6a => true, 0x1e6c => true, 0x1e6e => true, 0x1e70 => true, 0x1e72 => true, 0x1e74 => true, 0x1e76 => true, 0x1e78 => true, 0x1e7a => true, 0x1e7c => true, 0x1e7e => true, 0x1e80 => true, 0x1e82 => true, 0x1e84 => true, 0x1e86 => true, 0x1e88 => true, 0x1e8a => true, 0x1e8c => true, 0x1e8e => true, 0x1e90 => true, 0x1e92 => true, 0x1e94 => true, 0x1e9a...0x1e9b => true, 0x1e9e => true, 0x1ea0 => true, 0x1ea2 => true, 0x1ea4 => true, 0x1ea6 => true, 0x1ea8 => true, 0x1eaa => true, 0x1eac => true, 0x1eae => true, 0x1eb0 => true, 0x1eb2 => true, 0x1eb4 => true, 0x1eb6 => true, 0x1eb8 => true, 0x1eba => true, 0x1ebc => true, 0x1ebe => true, 0x1ec0 => true, 0x1ec2 => true, 0x1ec4 => true, 0x1ec6 => true, 0x1ec8 => true, 0x1eca => true, 0x1ecc => true, 0x1ece => true, 0x1ed0 => true, 0x1ed2 => true, 0x1ed4 => true, 0x1ed6 => true, 0x1ed8 => true, 0x1eda => true, 0x1edc => true, 0x1ede => true, 0x1ee0 => true, 0x1ee2 => true, 0x1ee4 => true, 0x1ee6 => true, 0x1ee8 => true, 0x1eea => true, 0x1eec => true, 0x1eee => true, 0x1ef0 => true, 0x1ef2 => true, 0x1ef4 => true, 0x1ef6 => true, 0x1ef8 => true, 0x1efa => true, 0x1efc => true, 0x1efe => true, 0x1f08...0x1f0f => true, 0x1f18...0x1f1d => true, 0x1f28...0x1f2f => true, 0x1f38...0x1f3f => true, 0x1f48...0x1f4d => true, 0x1f59 => true, 0x1f5b => true, 0x1f5d => true, 0x1f5f => true, 0x1f68...0x1f6f => true, 0x1f80...0x1faf => true, 0x1fb2...0x1fb4 => true, 0x1fb7...0x1fbc => true, 0x1fc2...0x1fc4 => true, 0x1fc7...0x1fcc => true, 0x1fd8...0x1fdb => true, 0x1fe8...0x1fec => true, 0x1ff2...0x1ff4 => true, 0x1ff7...0x1ffc => true, 0x2126 => true, 0x212a...0x212b => true, 0x2132 => true, 0x2160...0x216f => true, 0x2183 => true, 0x24b6...0x24cf => true, 0x2c00...0x2c2f => true, 0x2c60 => true, 0x2c62...0x2c64 => true, 0x2c67 => true, 0x2c69 => true, 0x2c6b => true, 0x2c6d...0x2c70 => true, 0x2c72 => true, 0x2c75 => true, 0x2c7e...0x2c80 => true, 0x2c82 => true, 0x2c84 => true, 0x2c86 => true, 0x2c88 => true, 0x2c8a => true, 0x2c8c => true, 0x2c8e => true, 0x2c90 => true, 0x2c92 => true, 0x2c94 => true, 0x2c96 => true, 0x2c98 => true, 0x2c9a => true, 0x2c9c => true, 0x2c9e => true, 0x2ca0 => true, 0x2ca2 => true, 0x2ca4 => true, 0x2ca6 => true, 0x2ca8 => true, 0x2caa => true, 0x2cac => true, 0x2cae => true, 0x2cb0 => true, 0x2cb2 => true, 0x2cb4 => true, 0x2cb6 => true, 0x2cb8 => true, 0x2cba => true, 0x2cbc => true, 0x2cbe => true, 0x2cc0 => true, 0x2cc2 => true, 0x2cc4 => true, 0x2cc6 => true, 0x2cc8 => true, 0x2cca => true, 0x2ccc => true, 0x2cce => true, 0x2cd0 => true, 0x2cd2 => true, 0x2cd4 => true, 0x2cd6 => true, 0x2cd8 => true, 0x2cda => true, 0x2cdc => true, 0x2cde => true, 0x2ce0 => true, 0x2ce2 => true, 0x2ceb => true, 0x2ced => true, 0x2cf2 => true, 0xa640 => true, 0xa642 => true, 0xa644 => true, 0xa646 => true, 0xa648 => true, 0xa64a => true, 0xa64c => true, 0xa64e => true, 0xa650 => true, 0xa652 => true, 0xa654 => true, 0xa656 => true, 0xa658 => true, 0xa65a => true, 0xa65c => true, 0xa65e => true, 0xa660 => true, 0xa662 => true, 0xa664 => true, 0xa666 => true, 0xa668 => true, 0xa66a => true, 0xa66c => true, 0xa680 => true, 0xa682 => true, 0xa684 => true, 0xa686 => true, 0xa688 => true, 0xa68a => true, 0xa68c => true, 0xa68e => true, 0xa690 => true, 0xa692 => true, 0xa694 => true, 0xa696 => true, 0xa698 => true, 0xa69a => true, 0xa722 => true, 0xa724 => true, 0xa726 => true, 0xa728 => true, 0xa72a => true, 0xa72c => true, 0xa72e => true, 0xa732 => true, 0xa734 => true, 0xa736 => true, 0xa738 => true, 0xa73a => true, 0xa73c => true, 0xa73e => true, 0xa740 => true, 0xa742 => true, 0xa744 => true, 0xa746 => true, 0xa748 => true, 0xa74a => true, 0xa74c => true, 0xa74e => true, 0xa750 => true, 0xa752 => true, 0xa754 => true, 0xa756 => true, 0xa758 => true, 0xa75a => true, 0xa75c => true, 0xa75e => true, 0xa760 => true, 0xa762 => true, 0xa764 => true, 0xa766 => true, 0xa768 => true, 0xa76a => true, 0xa76c => true, 0xa76e => true, 0xa779 => true, 0xa77b => true, 0xa77d...0xa77e => true, 0xa780 => true, 0xa782 => true, 0xa784 => true, 0xa786 => true, 0xa78b => true, 0xa78d => true, 0xa790 => true, 0xa792 => true, 0xa796 => true, 0xa798 => true, 0xa79a => true, 0xa79c => true, 0xa79e => true, 0xa7a0 => true, 0xa7a2 => true, 0xa7a4 => true, 0xa7a6 => true, 0xa7a8 => true, 0xa7aa...0xa7ae => true, 0xa7b0...0xa7b4 => true, 0xa7b6 => true, 0xa7b8 => true, 0xa7ba => true, 0xa7bc => true, 0xa7be => true, 0xa7c0 => true, 0xa7c2 => true, 0xa7c4...0xa7c7 => true, 0xa7c9 => true, 0xa7d0 => true, 0xa7d6 => true, 0xa7d8 => true, 0xa7f5 => true, 0xab70...0xabbf => true, 0xfb00...0xfb06 => true, 0xfb13...0xfb17 => true, 0xff21...0xff3a => true, 0x10400...0x10427 => true, 0x104b0...0x104d3 => true, 0x10570...0x1057a => true, 0x1057c...0x1058a => true, 0x1058c...0x10592 => true, 0x10594...0x10595 => true, 0x10c80...0x10cb2 => true, 0x118a0...0x118bf => true, 0x16e40...0x16e5f => true, 0x1e900...0x1e921 => true, else => false, }; } pub fn isChangesWhenCasemapped(cp: u21) bool { if (cp < 0x41 or cp > 0x1e943) return false; return switch (cp) { 0x41...0x5a => true, 0x61...0x7a => true, 0xb5 => true, 0xc0...0xd6 => true, 0xd8...0xf6 => true, 0xf8...0x137 => true, 0x139...0x18c => true, 0x18e...0x19a => true, 0x19c...0x1a9 => true, 0x1ac...0x1b9 => true, 0x1bc...0x1bd => true, 0x1bf => true, 0x1c4...0x220 => true, 0x222...0x233 => true, 0x23a...0x254 => true, 0x256...0x257 => true, 0x259 => true, 0x25b...0x25c => true, 0x260...0x261 => true, 0x263 => true, 0x265...0x266 => true, 0x268...0x26c => true, 0x26f => true, 0x271...0x272 => true, 0x275 => true, 0x27d => true, 0x280 => true, 0x282...0x283 => true, 0x287...0x28c => true, 0x292 => true, 0x29d...0x29e => true, 0x345 => true, 0x370...0x373 => true, 0x376...0x377 => true, 0x37b...0x37d => true, 0x37f => true, 0x386 => true, 0x388...0x38a => true, 0x38c => true, 0x38e...0x3a1 => true, 0x3a3...0x3d1 => true, 0x3d5...0x3f5 => true, 0x3f7...0x3fb => true, 0x3fd...0x481 => true, 0x48a...0x52f => true, 0x531...0x556 => true, 0x561...0x587 => true, 0x10a0...0x10c5 => true, 0x10c7 => true, 0x10cd => true, 0x10d0...0x10fa => true, 0x10fd...0x10ff => true, 0x13a0...0x13f5 => true, 0x13f8...0x13fd => true, 0x1c80...0x1c88 => true, 0x1c90...0x1cba => true, 0x1cbd...0x1cbf => true, 0x1d79 => true, 0x1d7d => true, 0x1d8e => true, 0x1e00...0x1e9b => true, 0x1e9e => true, 0x1ea0...0x1f15 => true, 0x1f18...0x1f1d => true, 0x1f20...0x1f45 => true, 0x1f48...0x1f4d => true, 0x1f50...0x1f57 => true, 0x1f59 => true, 0x1f5b => true, 0x1f5d => true, 0x1f5f...0x1f7d => true, 0x1f80...0x1fb4 => true, 0x1fb6...0x1fbc => true, 0x1fbe => true, 0x1fc2...0x1fc4 => true, 0x1fc6...0x1fcc => true, 0x1fd0...0x1fd3 => true, 0x1fd6...0x1fdb => true, 0x1fe0...0x1fec => true, 0x1ff2...0x1ff4 => true, 0x1ff6...0x1ffc => true, 0x2126 => true, 0x212a...0x212b => true, 0x2132 => true, 0x214e => true, 0x2160...0x217f => true, 0x2183...0x2184 => true, 0x24b6...0x24e9 => true, 0x2c00...0x2c70 => true, 0x2c72...0x2c73 => true, 0x2c75...0x2c76 => true, 0x2c7e...0x2ce3 => true, 0x2ceb...0x2cee => true, 0x2cf2...0x2cf3 => true, 0x2d00...0x2d25 => true, 0x2d27 => true, 0x2d2d => true, 0xa640...0xa66d => true, 0xa680...0xa69b => true, 0xa722...0xa72f => true, 0xa732...0xa76f => true, 0xa779...0xa787 => true, 0xa78b...0xa78d => true, 0xa790...0xa794 => true, 0xa796...0xa7ae => true, 0xa7b0...0xa7ca => true, 0xa7d0...0xa7d1 => true, 0xa7d6...0xa7d9 => true, 0xa7f5...0xa7f6 => true, 0xab53 => true, 0xab70...0xabbf => true, 0xfb00...0xfb06 => true, 0xfb13...0xfb17 => true, 0xff21...0xff3a => true, 0xff41...0xff5a => true, 0x10400...0x1044f => true, 0x104b0...0x104d3 => true, 0x104d8...0x104fb => true, 0x10570...0x1057a => true, 0x1057c...0x1058a => true, 0x1058c...0x10592 => true, 0x10594...0x10595 => true, 0x10597...0x105a1 => true, 0x105a3...0x105b1 => true, 0x105b3...0x105b9 => true, 0x105bb...0x105bc => true, 0x10c80...0x10cb2 => true, 0x10cc0...0x10cf2 => true, 0x118a0...0x118df => true, 0x16e40...0x16e7f => true, 0x1e900...0x1e943 => true, else => false, }; } pub fn isIdStart(cp: u21) bool { if (cp < 0x41 or cp > 0x3134a) return false; return switch (cp) { 0x41...0x5a => true, 0x61...0x7a => true, 0xaa => true, 0xb5 => true, 0xba => true, 0xc0...0xd6 => true, 0xd8...0xf6 => true, 0xf8...0x1ba => true, 0x1bb => true, 0x1bc...0x1bf => true, 0x1c0...0x1c3 => true, 0x1c4...0x293 => true, 0x294 => true, 0x295...0x2af => true, 0x2b0...0x2c1 => true, 0x2c6...0x2d1 => true, 0x2e0...0x2e4 => true, 0x2ec => true, 0x2ee => true, 0x370...0x373 => true, 0x374 => true, 0x376...0x377 => true, 0x37a => true, 0x37b...0x37d => true, 0x37f => true, 0x386 => true, 0x388...0x38a => true, 0x38c => true, 0x38e...0x3a1 => true, 0x3a3...0x3f5 => true, 0x3f7...0x481 => true, 0x48a...0x52f => true, 0x531...0x556 => true, 0x559 => true, 0x560...0x588 => true, 0x5d0...0x5ea => true, 0x5ef...0x5f2 => true, 0x620...0x63f => true, 0x640 => true, 0x641...0x64a => true, 0x66e...0x66f => true, 0x671...0x6d3 => true, 0x6d5 => true, 0x6e5...0x6e6 => true, 0x6ee...0x6ef => true, 0x6fa...0x6fc => true, 0x6ff => true, 0x710 => true, 0x712...0x72f => true, 0x74d...0x7a5 => true, 0x7b1 => true, 0x7ca...0x7ea => true, 0x7f4...0x7f5 => true, 0x7fa => true, 0x800...0x815 => true, 0x81a => true, 0x824 => true, 0x828 => true, 0x840...0x858 => true, 0x860...0x86a => true, 0x870...0x887 => true, 0x889...0x88e => true, 0x8a0...0x8c8 => true, 0x8c9 => true, 0x904...0x939 => true, 0x93d => true, 0x950 => true, 0x958...0x961 => true, 0x971 => true, 0x972...0x980 => true, 0x985...0x98c => true, 0x98f...0x990 => true, 0x993...0x9a8 => true, 0x9aa...0x9b0 => true, 0x9b2 => true, 0x9b6...0x9b9 => true, 0x9bd => true, 0x9ce => true, 0x9dc...0x9dd => true, 0x9df...0x9e1 => true, 0x9f0...0x9f1 => true, 0x9fc => true, 0xa05...0xa0a => true, 0xa0f...0xa10 => true, 0xa13...0xa28 => true, 0xa2a...0xa30 => true, 0xa32...0xa33 => true, 0xa35...0xa36 => true, 0xa38...0xa39 => true, 0xa59...0xa5c => true, 0xa5e => true, 0xa72...0xa74 => true, 0xa85...0xa8d => true, 0xa8f...0xa91 => true, 0xa93...0xaa8 => true, 0xaaa...0xab0 => true, 0xab2...0xab3 => true, 0xab5...0xab9 => true, 0xabd => true, 0xad0 => true, 0xae0...0xae1 => true, 0xaf9 => true, 0xb05...0xb0c => true, 0xb0f...0xb10 => true, 0xb13...0xb28 => true, 0xb2a...0xb30 => true, 0xb32...0xb33 => true, 0xb35...0xb39 => true, 0xb3d => true, 0xb5c...0xb5d => true, 0xb5f...0xb61 => true, 0xb71 => true, 0xb83 => true, 0xb85...0xb8a => true, 0xb8e...0xb90 => true, 0xb92...0xb95 => true, 0xb99...0xb9a => true, 0xb9c => true, 0xb9e...0xb9f => true, 0xba3...0xba4 => true, 0xba8...0xbaa => true, 0xbae...0xbb9 => true, 0xbd0 => true, 0xc05...0xc0c => true, 0xc0e...0xc10 => true, 0xc12...0xc28 => true, 0xc2a...0xc39 => true, 0xc3d => true, 0xc58...0xc5a => true, 0xc5d => true, 0xc60...0xc61 => true, 0xc80 => true, 0xc85...0xc8c => true, 0xc8e...0xc90 => true, 0xc92...0xca8 => true, 0xcaa...0xcb3 => true, 0xcb5...0xcb9 => true, 0xcbd => true, 0xcdd...0xcde => true, 0xce0...0xce1 => true, 0xcf1...0xcf2 => true, 0xd04...0xd0c => true, 0xd0e...0xd10 => true, 0xd12...0xd3a => true, 0xd3d => true, 0xd4e => true, 0xd54...0xd56 => true, 0xd5f...0xd61 => true, 0xd7a...0xd7f => true, 0xd85...0xd96 => true, 0xd9a...0xdb1 => true, 0xdb3...0xdbb => true, 0xdbd => true, 0xdc0...0xdc6 => true, 0xe01...0xe30 => true, 0xe32...0xe33 => true, 0xe40...0xe45 => true, 0xe46 => true, 0xe81...0xe82 => true, 0xe84 => true, 0xe86...0xe8a => true, 0xe8c...0xea3 => true, 0xea5 => true, 0xea7...0xeb0 => true, 0xeb2...0xeb3 => true, 0xebd => true, 0xec0...0xec4 => true, 0xec6 => true, 0xedc...0xedf => true, 0xf00 => true, 0xf40...0xf47 => true, 0xf49...0xf6c => true, 0xf88...0xf8c => true, 0x1000...0x102a => true, 0x103f => true, 0x1050...0x1055 => true, 0x105a...0x105d => true, 0x1061 => true, 0x1065...0x1066 => true, 0x106e...0x1070 => true, 0x1075...0x1081 => true, 0x108e => true, 0x10a0...0x10c5 => true, 0x10c7 => true, 0x10cd => true, 0x10d0...0x10fa => true, 0x10fc => true, 0x10fd...0x10ff => true, 0x1100...0x1248 => true, 0x124a...0x124d => true, 0x1250...0x1256 => true, 0x1258 => true, 0x125a...0x125d => true, 0x1260...0x1288 => true, 0x128a...0x128d => true, 0x1290...0x12b0 => true, 0x12b2...0x12b5 => true, 0x12b8...0x12be => true, 0x12c0 => true, 0x12c2...0x12c5 => true, 0x12c8...0x12d6 => true, 0x12d8...0x1310 => true, 0x1312...0x1315 => true, 0x1318...0x135a => true, 0x1380...0x138f => true, 0x13a0...0x13f5 => true, 0x13f8...0x13fd => true, 0x1401...0x166c => true, 0x166f...0x167f => true, 0x1681...0x169a => true, 0x16a0...0x16ea => true, 0x16ee...0x16f0 => true, 0x16f1...0x16f8 => true, 0x1700...0x1711 => true, 0x171f...0x1731 => true, 0x1740...0x1751 => true, 0x1760...0x176c => true, 0x176e...0x1770 => true, 0x1780...0x17b3 => true, 0x17d7 => true, 0x17dc => true, 0x1820...0x1842 => true, 0x1843 => true, 0x1844...0x1878 => true, 0x1880...0x1884 => true, 0x1885...0x1886 => true, 0x1887...0x18a8 => true, 0x18aa => true, 0x18b0...0x18f5 => true, 0x1900...0x191e => true, 0x1950...0x196d => true, 0x1970...0x1974 => true, 0x1980...0x19ab => true, 0x19b0...0x19c9 => true, 0x1a00...0x1a16 => true, 0x1a20...0x1a54 => true, 0x1aa7 => true, 0x1b05...0x1b33 => true, 0x1b45...0x1b4c => true, 0x1b83...0x1ba0 => true, 0x1bae...0x1baf => true, 0x1bba...0x1be5 => true, 0x1c00...0x1c23 => true, 0x1c4d...0x1c4f => true, 0x1c5a...0x1c77 => true, 0x1c78...0x1c7d => true, 0x1c80...0x1c88 => true, 0x1c90...0x1cba => true, 0x1cbd...0x1cbf => true, 0x1ce9...0x1cec => true, 0x1cee...0x1cf3 => true, 0x1cf5...0x1cf6 => true, 0x1cfa => true, 0x1d00...0x1d2b => true, 0x1d2c...0x1d6a => true, 0x1d6b...0x1d77 => true, 0x1d78 => true, 0x1d79...0x1d9a => true, 0x1d9b...0x1dbf => true, 0x1e00...0x1f15 => true, 0x1f18...0x1f1d => true, 0x1f20...0x1f45 => true, 0x1f48...0x1f4d => true, 0x1f50...0x1f57 => true, 0x1f59 => true, 0x1f5b => true, 0x1f5d => true, 0x1f5f...0x1f7d => true, 0x1f80...0x1fb4 => true, 0x1fb6...0x1fbc => true, 0x1fbe => true, 0x1fc2...0x1fc4 => true, 0x1fc6...0x1fcc => true, 0x1fd0...0x1fd3 => true, 0x1fd6...0x1fdb => true, 0x1fe0...0x1fec => true, 0x1ff2...0x1ff4 => true, 0x1ff6...0x1ffc => true, 0x2071 => true, 0x207f => true, 0x2090...0x209c => true, 0x2102 => true, 0x2107 => true, 0x210a...0x2113 => true, 0x2115 => true, 0x2118 => true, 0x2119...0x211d => true, 0x2124 => true, 0x2126 => true, 0x2128 => true, 0x212a...0x212d => true, 0x212e => true, 0x212f...0x2134 => true, 0x2135...0x2138 => true, 0x2139 => true, 0x213c...0x213f => true, 0x2145...0x2149 => true, 0x214e => true, 0x2160...0x2182 => true, 0x2183...0x2184 => true, 0x2185...0x2188 => true, 0x2c00...0x2c7b => true, 0x2c7c...0x2c7d => true, 0x2c7e...0x2ce4 => true, 0x2ceb...0x2cee => true, 0x2cf2...0x2cf3 => true, 0x2d00...0x2d25 => true, 0x2d27 => true, 0x2d2d => true, 0x2d30...0x2d67 => true, 0x2d6f => true, 0x2d80...0x2d96 => true, 0x2da0...0x2da6 => true, 0x2da8...0x2dae => true, 0x2db0...0x2db6 => true, 0x2db8...0x2dbe => true, 0x2dc0...0x2dc6 => true, 0x2dc8...0x2dce => true, 0x2dd0...0x2dd6 => true, 0x2dd8...0x2dde => true, 0x3005 => true, 0x3006 => true, 0x3007 => true, 0x3021...0x3029 => true, 0x3031...0x3035 => true, 0x3038...0x303a => true, 0x303b => true, 0x303c => true, 0x3041...0x3096 => true, 0x309b...0x309c => true, 0x309d...0x309e => true, 0x309f => true, 0x30a1...0x30fa => true, 0x30fc...0x30fe => true, 0x30ff => true, 0x3105...0x312f => true, 0x3131...0x318e => true, 0x31a0...0x31bf => true, 0x31f0...0x31ff => true, 0x3400...0x4dbf => true, 0x4e00...0xa014 => true, 0xa015 => true, 0xa016...0xa48c => true, 0xa4d0...0xa4f7 => true, 0xa4f8...0xa4fd => true, 0xa500...0xa60b => true, 0xa60c => true, 0xa610...0xa61f => true, 0xa62a...0xa62b => true, 0xa640...0xa66d => true, 0xa66e => true, 0xa67f => true, 0xa680...0xa69b => true, 0xa69c...0xa69d => true, 0xa6a0...0xa6e5 => true, 0xa6e6...0xa6ef => true, 0xa717...0xa71f => true, 0xa722...0xa76f => true, 0xa770 => true, 0xa771...0xa787 => true, 0xa788 => true, 0xa78b...0xa78e => true, 0xa78f => true, 0xa790...0xa7ca => true, 0xa7d0...0xa7d1 => true, 0xa7d3 => true, 0xa7d5...0xa7d9 => true, 0xa7f2...0xa7f4 => true, 0xa7f5...0xa7f6 => true, 0xa7f7 => true, 0xa7f8...0xa7f9 => true, 0xa7fa => true, 0xa7fb...0xa801 => true, 0xa803...0xa805 => true, 0xa807...0xa80a => true, 0xa80c...0xa822 => true, 0xa840...0xa873 => true, 0xa882...0xa8b3 => true, 0xa8f2...0xa8f7 => true, 0xa8fb => true, 0xa8fd...0xa8fe => true, 0xa90a...0xa925 => true, 0xa930...0xa946 => true, 0xa960...0xa97c => true, 0xa984...0xa9b2 => true, 0xa9cf => true, 0xa9e0...0xa9e4 => true, 0xa9e6 => true, 0xa9e7...0xa9ef => true, 0xa9fa...0xa9fe => true, 0xaa00...0xaa28 => true, 0xaa40...0xaa42 => true, 0xaa44...0xaa4b => true, 0xaa60...0xaa6f => true, 0xaa70 => true, 0xaa71...0xaa76 => true, 0xaa7a => true, 0xaa7e...0xaaaf => true, 0xaab1 => true, 0xaab5...0xaab6 => true, 0xaab9...0xaabd => true, 0xaac0 => true, 0xaac2 => true, 0xaadb...0xaadc => true, 0xaadd => true, 0xaae0...0xaaea => true, 0xaaf2 => true, 0xaaf3...0xaaf4 => true, 0xab01...0xab06 => true, 0xab09...0xab0e => true, 0xab11...0xab16 => true, 0xab20...0xab26 => true, 0xab28...0xab2e => true, 0xab30...0xab5a => true, 0xab5c...0xab5f => true, 0xab60...0xab68 => true, 0xab69 => true, 0xab70...0xabbf => true, 0xabc0...0xabe2 => true, 0xac00...0xd7a3 => true, 0xd7b0...0xd7c6 => true, 0xd7cb...0xd7fb => true, 0xf900...0xfa6d => true, 0xfa70...0xfad9 => true, 0xfb00...0xfb06 => true, 0xfb13...0xfb17 => true, 0xfb1d => true, 0xfb1f...0xfb28 => true, 0xfb2a...0xfb36 => true, 0xfb38...0xfb3c => true, 0xfb3e => true, 0xfb40...0xfb41 => true, 0xfb43...0xfb44 => true, 0xfb46...0xfbb1 => true, 0xfbd3...0xfd3d => true, 0xfd50...0xfd8f => true, 0xfd92...0xfdc7 => true, 0xfdf0...0xfdfb => true, 0xfe70...0xfe74 => true, 0xfe76...0xfefc => true, 0xff21...0xff3a => true, 0xff41...0xff5a => true, 0xff66...0xff6f => true, 0xff70 => true, 0xff71...0xff9d => true, 0xff9e...0xff9f => true, 0xffa0...0xffbe => true, 0xffc2...0xffc7 => true, 0xffca...0xffcf => true, 0xffd2...0xffd7 => true, 0xffda...0xffdc => true, 0x10000...0x1000b => true, 0x1000d...0x10026 => true, 0x10028...0x1003a => true, 0x1003c...0x1003d => true, 0x1003f...0x1004d => true, 0x10050...0x1005d => true, 0x10080...0x100fa => true, 0x10140...0x10174 => true, 0x10280...0x1029c => true, 0x102a0...0x102d0 => true, 0x10300...0x1031f => true, 0x1032d...0x10340 => true, 0x10341 => true, 0x10342...0x10349 => true, 0x1034a => true, 0x10350...0x10375 => true, 0x10380...0x1039d => true, 0x103a0...0x103c3 => true, 0x103c8...0x103cf => true, 0x103d1...0x103d5 => true, 0x10400...0x1044f => true, 0x10450...0x1049d => true, 0x104b0...0x104d3 => true, 0x104d8...0x104fb => true, 0x10500...0x10527 => true, 0x10530...0x10563 => true, 0x10570...0x1057a => true, 0x1057c...0x1058a => true, 0x1058c...0x10592 => true, 0x10594...0x10595 => true, 0x10597...0x105a1 => true, 0x105a3...0x105b1 => true, 0x105b3...0x105b9 => true, 0x105bb...0x105bc => true, 0x10600...0x10736 => true, 0x10740...0x10755 => true, 0x10760...0x10767 => true, 0x10780...0x10785 => true, 0x10787...0x107b0 => true, 0x107b2...0x107ba => true, 0x10800...0x10805 => true, 0x10808 => true, 0x1080a...0x10835 => true, 0x10837...0x10838 => true, 0x1083c => true, 0x1083f...0x10855 => true, 0x10860...0x10876 => true, 0x10880...0x1089e => true, 0x108e0...0x108f2 => true, 0x108f4...0x108f5 => true, 0x10900...0x10915 => true, 0x10920...0x10939 => true, 0x10980...0x109b7 => true, 0x109be...0x109bf => true, 0x10a00 => true, 0x10a10...0x10a13 => true, 0x10a15...0x10a17 => true, 0x10a19...0x10a35 => true, 0x10a60...0x10a7c => true, 0x10a80...0x10a9c => true, 0x10ac0...0x10ac7 => true, 0x10ac9...0x10ae4 => true, 0x10b00...0x10b35 => true, 0x10b40...0x10b55 => true, 0x10b60...0x10b72 => true, 0x10b80...0x10b91 => true, 0x10c00...0x10c48 => true, 0x10c80...0x10cb2 => true, 0x10cc0...0x10cf2 => true, 0x10d00...0x10d23 => true, 0x10e80...0x10ea9 => true, 0x10eb0...0x10eb1 => true, 0x10f00...0x10f1c => true, 0x10f27 => true, 0x10f30...0x10f45 => true, 0x10f70...0x10f81 => true, 0x10fb0...0x10fc4 => true, 0x10fe0...0x10ff6 => true, 0x11003...0x11037 => true, 0x11071...0x11072 => true, 0x11075 => true, 0x11083...0x110af => true, 0x110d0...0x110e8 => true, 0x11103...0x11126 => true, 0x11144 => true, 0x11147 => true, 0x11150...0x11172 => true, 0x11176 => true, 0x11183...0x111b2 => true, 0x111c1...0x111c4 => true, 0x111da => true, 0x111dc => true, 0x11200...0x11211 => true, 0x11213...0x1122b => true, 0x11280...0x11286 => true, 0x11288 => true, 0x1128a...0x1128d => true, 0x1128f...0x1129d => true, 0x1129f...0x112a8 => true, 0x112b0...0x112de => true, 0x11305...0x1130c => true, 0x1130f...0x11310 => true, 0x11313...0x11328 => true, 0x1132a...0x11330 => true, 0x11332...0x11333 => true, 0x11335...0x11339 => true, 0x1133d => true, 0x11350 => true, 0x1135d...0x11361 => true, 0x11400...0x11434 => true, 0x11447...0x1144a => true, 0x1145f...0x11461 => true, 0x11480...0x114af => true, 0x114c4...0x114c5 => true, 0x114c7 => true, 0x11580...0x115ae => true, 0x115d8...0x115db => true, 0x11600...0x1162f => true, 0x11644 => true, 0x11680...0x116aa => true, 0x116b8 => true, 0x11700...0x1171a => true, 0x11740...0x11746 => true, 0x11800...0x1182b => true, 0x118a0...0x118df => true, 0x118ff...0x11906 => true, 0x11909 => true, 0x1190c...0x11913 => true, 0x11915...0x11916 => true, 0x11918...0x1192f => true, 0x1193f => true, 0x11941 => true, 0x119a0...0x119a7 => true, 0x119aa...0x119d0 => true, 0x119e1 => true, 0x119e3 => true, 0x11a00 => true, 0x11a0b...0x11a32 => true, 0x11a3a => true, 0x11a50 => true, 0x11a5c...0x11a89 => true, 0x11a9d => true, 0x11ab0...0x11af8 => true, 0x11c00...0x11c08 => true, 0x11c0a...0x11c2e => true, 0x11c40 => true, 0x11c72...0x11c8f => true, 0x11d00...0x11d06 => true, 0x11d08...0x11d09 => true, 0x11d0b...0x11d30 => true, 0x11d46 => true, 0x11d60...0x11d65 => true, 0x11d67...0x11d68 => true, 0x11d6a...0x11d89 => true, 0x11d98 => true, 0x11ee0...0x11ef2 => true, 0x11fb0 => true, 0x12000...0x12399 => true, 0x12400...0x1246e => true, 0x12480...0x12543 => true, 0x12f90...0x12ff0 => true, 0x13000...0x1342e => true, 0x14400...0x14646 => true, 0x16800...0x16a38 => true, 0x16a40...0x16a5e => true, 0x16a70...0x16abe => true, 0x16ad0...0x16aed => true, 0x16b00...0x16b2f => true, 0x16b40...0x16b43 => true, 0x16b63...0x16b77 => true, 0x16b7d...0x16b8f => true, 0x16e40...0x16e7f => true, 0x16f00...0x16f4a => true, 0x16f50 => true, 0x16f93...0x16f9f => true, 0x16fe0...0x16fe1 => true, 0x16fe3 => true, 0x17000...0x187f7 => true, 0x18800...0x18cd5 => true, 0x18d00...0x18d08 => true, 0x1aff0...0x1aff3 => true, 0x1aff5...0x1affb => true, 0x1affd...0x1affe => true, 0x1b000...0x1b122 => true, 0x1b150...0x1b152 => true, 0x1b164...0x1b167 => true, 0x1b170...0x1b2fb => true, 0x1bc00...0x1bc6a => true, 0x1bc70...0x1bc7c => true, 0x1bc80...0x1bc88 => true, 0x1bc90...0x1bc99 => true, 0x1d400...0x1d454 => true, 0x1d456...0x1d49c => true, 0x1d49e...0x1d49f => true, 0x1d4a2 => true, 0x1d4a5...0x1d4a6 => true, 0x1d4a9...0x1d4ac => true, 0x1d4ae...0x1d4b9 => true, 0x1d4bb => true, 0x1d4bd...0x1d4c3 => true, 0x1d4c5...0x1d505 => true, 0x1d507...0x1d50a => true, 0x1d50d...0x1d514 => true, 0x1d516...0x1d51c => true, 0x1d51e...0x1d539 => true, 0x1d53b...0x1d53e => true, 0x1d540...0x1d544 => true, 0x1d546 => true, 0x1d54a...0x1d550 => true, 0x1d552...0x1d6a5 => true, 0x1d6a8...0x1d6c0 => true, 0x1d6c2...0x1d6da => true, 0x1d6dc...0x1d6fa => true, 0x1d6fc...0x1d714 => true, 0x1d716...0x1d734 => true, 0x1d736...0x1d74e => true, 0x1d750...0x1d76e => true, 0x1d770...0x1d788 => true, 0x1d78a...0x1d7a8 => true, 0x1d7aa...0x1d7c2 => true, 0x1d7c4...0x1d7cb => true, 0x1df00...0x1df09 => true, 0x1df0a => true, 0x1df0b...0x1df1e => true, 0x1e100...0x1e12c => true, 0x1e137...0x1e13d => true, 0x1e14e => true, 0x1e290...0x1e2ad => true, 0x1e2c0...0x1e2eb => true, 0x1e7e0...0x1e7e6 => true, 0x1e7e8...0x1e7eb => true, 0x1e7ed...0x1e7ee => true, 0x1e7f0...0x1e7fe => true, 0x1e800...0x1e8c4 => true, 0x1e900...0x1e943 => true, 0x1e94b => true, 0x1ee00...0x1ee03 => true, 0x1ee05...0x1ee1f => true, 0x1ee21...0x1ee22 => true, 0x1ee24 => true, 0x1ee27 => true, 0x1ee29...0x1ee32 => true, 0x1ee34...0x1ee37 => true, 0x1ee39 => true, 0x1ee3b => true, 0x1ee42 => true, 0x1ee47 => true, 0x1ee49 => true, 0x1ee4b => true, 0x1ee4d...0x1ee4f => true, 0x1ee51...0x1ee52 => true, 0x1ee54 => true, 0x1ee57 => true, 0x1ee59 => true, 0x1ee5b => true, 0x1ee5d => true, 0x1ee5f => true, 0x1ee61...0x1ee62 => true, 0x1ee64 => true, 0x1ee67...0x1ee6a => true, 0x1ee6c...0x1ee72 => true, 0x1ee74...0x1ee77 => true, 0x1ee79...0x1ee7c => true, 0x1ee7e => true, 0x1ee80...0x1ee89 => true, 0x1ee8b...0x1ee9b => true, 0x1eea1...0x1eea3 => true, 0x1eea5...0x1eea9 => true, 0x1eeab...0x1eebb => true, 0x20000...0x2a6df => true, 0x2a700...0x2b738 => true, 0x2b740...0x2b81d => true, 0x2b820...0x2cea1 => true, 0x2ceb0...0x2ebe0 => true, 0x2f800...0x2fa1d => true, 0x30000...0x3134a => true, else => false, }; } pub fn isIdContinue(cp: u21) bool { if (cp < 0x30 or cp > 0xe01ef) return false; return switch (cp) { 0x30...0x39 => true, 0x41...0x5a => true, 0x5f => true, 0x61...0x7a => true, 0xaa => true, 0xb5 => true, 0xb7 => true, 0xba => true, 0xc0...0xd6 => true, 0xd8...0xf6 => true, 0xf8...0x1ba => true, 0x1bb => true, 0x1bc...0x1bf => true, 0x1c0...0x1c3 => true, 0x1c4...0x293 => true, 0x294 => true, 0x295...0x2af => true, 0x2b0...0x2c1 => true, 0x2c6...0x2d1 => true, 0x2e0...0x2e4 => true, 0x2ec => true, 0x2ee => true, 0x300...0x36f => true, 0x370...0x373 => true, 0x374 => true, 0x376...0x377 => true, 0x37a => true, 0x37b...0x37d => true, 0x37f => true, 0x386 => true, 0x387 => true, 0x388...0x38a => true, 0x38c => true, 0x38e...0x3a1 => true, 0x3a3...0x3f5 => true, 0x3f7...0x481 => true, 0x483...0x487 => true, 0x48a...0x52f => true, 0x531...0x556 => true, 0x559 => true, 0x560...0x588 => true, 0x591...0x5bd => true, 0x5bf => true, 0x5c1...0x5c2 => true, 0x5c4...0x5c5 => true, 0x5c7 => true, 0x5d0...0x5ea => true, 0x5ef...0x5f2 => true, 0x610...0x61a => true, 0x620...0x63f => true, 0x640 => true, 0x641...0x64a => true, 0x64b...0x65f => true, 0x660...0x669 => true, 0x66e...0x66f => true, 0x670 => true, 0x671...0x6d3 => true, 0x6d5 => true, 0x6d6...0x6dc => true, 0x6df...0x6e4 => true, 0x6e5...0x6e6 => true, 0x6e7...0x6e8 => true, 0x6ea...0x6ed => true, 0x6ee...0x6ef => true, 0x6f0...0x6f9 => true, 0x6fa...0x6fc => true, 0x6ff => true, 0x710 => true, 0x711 => true, 0x712...0x72f => true, 0x730...0x74a => true, 0x74d...0x7a5 => true, 0x7a6...0x7b0 => true, 0x7b1 => true, 0x7c0...0x7c9 => true, 0x7ca...0x7ea => true, 0x7eb...0x7f3 => true, 0x7f4...0x7f5 => true, 0x7fa => true, 0x7fd => true, 0x800...0x815 => true, 0x816...0x819 => true, 0x81a => true, 0x81b...0x823 => true, 0x824 => true, 0x825...0x827 => true, 0x828 => true, 0x829...0x82d => true, 0x840...0x858 => true, 0x859...0x85b => true, 0x860...0x86a => true, 0x870...0x887 => true, 0x889...0x88e => true, 0x898...0x89f => true, 0x8a0...0x8c8 => true, 0x8c9 => true, 0x8ca...0x8e1 => true, 0x8e3...0x902 => true, 0x903 => true, 0x904...0x939 => true, 0x93a => true, 0x93b => true, 0x93c => true, 0x93d => true, 0x93e...0x940 => true, 0x941...0x948 => true, 0x949...0x94c => true, 0x94d => true, 0x94e...0x94f => true, 0x950 => true, 0x951...0x957 => true, 0x958...0x961 => true, 0x962...0x963 => true, 0x966...0x96f => true, 0x971 => true, 0x972...0x980 => true, 0x981 => true, 0x982...0x983 => true, 0x985...0x98c => true, 0x98f...0x990 => true, 0x993...0x9a8 => true, 0x9aa...0x9b0 => true, 0x9b2 => true, 0x9b6...0x9b9 => true, 0x9bc => true, 0x9bd => true, 0x9be...0x9c0 => true, 0x9c1...0x9c4 => true, 0x9c7...0x9c8 => true, 0x9cb...0x9cc => true, 0x9cd => true, 0x9ce => true, 0x9d7 => true, 0x9dc...0x9dd => true, 0x9df...0x9e1 => true, 0x9e2...0x9e3 => true, 0x9e6...0x9ef => true, 0x9f0...0x9f1 => true, 0x9fc => true, 0x9fe => true, 0xa01...0xa02 => true, 0xa03 => true, 0xa05...0xa0a => true, 0xa0f...0xa10 => true, 0xa13...0xa28 => true, 0xa2a...0xa30 => true, 0xa32...0xa33 => true, 0xa35...0xa36 => true, 0xa38...0xa39 => true, 0xa3c => true, 0xa3e...0xa40 => true, 0xa41...0xa42 => true, 0xa47...0xa48 => true, 0xa4b...0xa4d => true, 0xa51 => true, 0xa59...0xa5c => true, 0xa5e => true, 0xa66...0xa6f => true, 0xa70...0xa71 => true, 0xa72...0xa74 => true, 0xa75 => true, 0xa81...0xa82 => true, 0xa83 => true, 0xa85...0xa8d => true, 0xa8f...0xa91 => true, 0xa93...0xaa8 => true, 0xaaa...0xab0 => true, 0xab2...0xab3 => true, 0xab5...0xab9 => true, 0xabc => true, 0xabd => true, 0xabe...0xac0 => true, 0xac1...0xac5 => true, 0xac7...0xac8 => true, 0xac9 => true, 0xacb...0xacc => true, 0xacd => true, 0xad0 => true, 0xae0...0xae1 => true, 0xae2...0xae3 => true, 0xae6...0xaef => true, 0xaf9 => true, 0xafa...0xaff => true, 0xb01 => true, 0xb02...0xb03 => true, 0xb05...0xb0c => true, 0xb0f...0xb10 => true, 0xb13...0xb28 => true, 0xb2a...0xb30 => true, 0xb32...0xb33 => true, 0xb35...0xb39 => true, 0xb3c => true, 0xb3d => true, 0xb3e => true, 0xb3f => true, 0xb40 => true, 0xb41...0xb44 => true, 0xb47...0xb48 => true, 0xb4b...0xb4c => true, 0xb4d => true, 0xb55...0xb56 => true, 0xb57 => true, 0xb5c...0xb5d => true, 0xb5f...0xb61 => true, 0xb62...0xb63 => true, 0xb66...0xb6f => true, 0xb71 => true, 0xb82 => true, 0xb83 => true, 0xb85...0xb8a => true, 0xb8e...0xb90 => true, 0xb92...0xb95 => true, 0xb99...0xb9a => true, 0xb9c => true, 0xb9e...0xb9f => true, 0xba3...0xba4 => true, 0xba8...0xbaa => true, 0xbae...0xbb9 => true, 0xbbe...0xbbf => true, 0xbc0 => true, 0xbc1...0xbc2 => true, 0xbc6...0xbc8 => true, 0xbca...0xbcc => true, 0xbcd => true, 0xbd0 => true, 0xbd7 => true, 0xbe6...0xbef => true, 0xc00 => true, 0xc01...0xc03 => true, 0xc04 => true, 0xc05...0xc0c => true, 0xc0e...0xc10 => true, 0xc12...0xc28 => true, 0xc2a...0xc39 => true, 0xc3c => true, 0xc3d => true, 0xc3e...0xc40 => true, 0xc41...0xc44 => true, 0xc46...0xc48 => true, 0xc4a...0xc4d => true, 0xc55...0xc56 => true, 0xc58...0xc5a => true, 0xc5d => true, 0xc60...0xc61 => true, 0xc62...0xc63 => true, 0xc66...0xc6f => true, 0xc80 => true, 0xc81 => true, 0xc82...0xc83 => true, 0xc85...0xc8c => true, 0xc8e...0xc90 => true, 0xc92...0xca8 => true, 0xcaa...0xcb3 => true, 0xcb5...0xcb9 => true, 0xcbc => true, 0xcbd => true, 0xcbe => true, 0xcbf => true, 0xcc0...0xcc4 => true, 0xcc6 => true, 0xcc7...0xcc8 => true, 0xcca...0xccb => true, 0xccc...0xccd => true, 0xcd5...0xcd6 => true, 0xcdd...0xcde => true, 0xce0...0xce1 => true, 0xce2...0xce3 => true, 0xce6...0xcef => true, 0xcf1...0xcf2 => true, 0xd00...0xd01 => true, 0xd02...0xd03 => true, 0xd04...0xd0c => true, 0xd0e...0xd10 => true, 0xd12...0xd3a => true, 0xd3b...0xd3c => true, 0xd3d => true, 0xd3e...0xd40 => true, 0xd41...0xd44 => true, 0xd46...0xd48 => true, 0xd4a...0xd4c => true, 0xd4d => true, 0xd4e => true, 0xd54...0xd56 => true, 0xd57 => true, 0xd5f...0xd61 => true, 0xd62...0xd63 => true, 0xd66...0xd6f => true, 0xd7a...0xd7f => true, 0xd81 => true, 0xd82...0xd83 => true, 0xd85...0xd96 => true, 0xd9a...0xdb1 => true, 0xdb3...0xdbb => true, 0xdbd => true, 0xdc0...0xdc6 => true, 0xdca => true, 0xdcf...0xdd1 => true, 0xdd2...0xdd4 => true, 0xdd6 => true, 0xdd8...0xddf => true, 0xde6...0xdef => true, 0xdf2...0xdf3 => true, 0xe01...0xe30 => true, 0xe31 => true, 0xe32...0xe33 => true, 0xe34...0xe3a => true, 0xe40...0xe45 => true, 0xe46 => true, 0xe47...0xe4e => true, 0xe50...0xe59 => true, 0xe81...0xe82 => true, 0xe84 => true, 0xe86...0xe8a => true, 0xe8c...0xea3 => true, 0xea5 => true, 0xea7...0xeb0 => true, 0xeb1 => true, 0xeb2...0xeb3 => true, 0xeb4...0xebc => true, 0xebd => true, 0xec0...0xec4 => true, 0xec6 => true, 0xec8...0xecd => true, 0xed0...0xed9 => true, 0xedc...0xedf => true, 0xf00 => true, 0xf18...0xf19 => true, 0xf20...0xf29 => true, 0xf35 => true, 0xf37 => true, 0xf39 => true, 0xf3e...0xf3f => true, 0xf40...0xf47 => true, 0xf49...0xf6c => true, 0xf71...0xf7e => true, 0xf7f => true, 0xf80...0xf84 => true, 0xf86...0xf87 => true, 0xf88...0xf8c => true, 0xf8d...0xf97 => true, 0xf99...0xfbc => true, 0xfc6 => true, 0x1000...0x102a => true, 0x102b...0x102c => true, 0x102d...0x1030 => true, 0x1031 => true, 0x1032...0x1037 => true, 0x1038 => true, 0x1039...0x103a => true, 0x103b...0x103c => true, 0x103d...0x103e => true, 0x103f => true, 0x1040...0x1049 => true, 0x1050...0x1055 => true, 0x1056...0x1057 => true, 0x1058...0x1059 => true, 0x105a...0x105d => true, 0x105e...0x1060 => true, 0x1061 => true, 0x1062...0x1064 => true, 0x1065...0x1066 => true, 0x1067...0x106d => true, 0x106e...0x1070 => true, 0x1071...0x1074 => true, 0x1075...0x1081 => true, 0x1082 => true, 0x1083...0x1084 => true, 0x1085...0x1086 => true, 0x1087...0x108c => true, 0x108d => true, 0x108e => true, 0x108f => true, 0x1090...0x1099 => true, 0x109a...0x109c => true, 0x109d => true, 0x10a0...0x10c5 => true, 0x10c7 => true, 0x10cd => true, 0x10d0...0x10fa => true, 0x10fc => true, 0x10fd...0x10ff => true, 0x1100...0x1248 => true, 0x124a...0x124d => true, 0x1250...0x1256 => true, 0x1258 => true, 0x125a...0x125d => true, 0x1260...0x1288 => true, 0x128a...0x128d => true, 0x1290...0x12b0 => true, 0x12b2...0x12b5 => true, 0x12b8...0x12be => true, 0x12c0 => true, 0x12c2...0x12c5 => true, 0x12c8...0x12d6 => true, 0x12d8...0x1310 => true, 0x1312...0x1315 => true, 0x1318...0x135a => true, 0x135d...0x135f => true, 0x1369...0x1371 => true, 0x1380...0x138f => true, 0x13a0...0x13f5 => true, 0x13f8...0x13fd => true, 0x1401...0x166c => true, 0x166f...0x167f => true, 0x1681...0x169a => true, 0x16a0...0x16ea => true, 0x16ee...0x16f0 => true, 0x16f1...0x16f8 => true, 0x1700...0x1711 => true, 0x1712...0x1714 => true, 0x1715 => true, 0x171f...0x1731 => true, 0x1732...0x1733 => true, 0x1734 => true, 0x1740...0x1751 => true, 0x1752...0x1753 => true, 0x1760...0x176c => true, 0x176e...0x1770 => true, 0x1772...0x1773 => true, 0x1780...0x17b3 => true, 0x17b4...0x17b5 => true, 0x17b6 => true, 0x17b7...0x17bd => true, 0x17be...0x17c5 => true, 0x17c6 => true, 0x17c7...0x17c8 => true, 0x17c9...0x17d3 => true, 0x17d7 => true, 0x17dc => true, 0x17dd => true, 0x17e0...0x17e9 => true, 0x180b...0x180d => true, 0x180f => true, 0x1810...0x1819 => true, 0x1820...0x1842 => true, 0x1843 => true, 0x1844...0x1878 => true, 0x1880...0x1884 => true, 0x1885...0x1886 => true, 0x1887...0x18a8 => true, 0x18a9 => true, 0x18aa => true, 0x18b0...0x18f5 => true, 0x1900...0x191e => true, 0x1920...0x1922 => true, 0x1923...0x1926 => true, 0x1927...0x1928 => true, 0x1929...0x192b => true, 0x1930...0x1931 => true, 0x1932 => true, 0x1933...0x1938 => true, 0x1939...0x193b => true, 0x1946...0x194f => true, 0x1950...0x196d => true, 0x1970...0x1974 => true, 0x1980...0x19ab => true, 0x19b0...0x19c9 => true, 0x19d0...0x19d9 => true, 0x19da => true, 0x1a00...0x1a16 => true, 0x1a17...0x1a18 => true, 0x1a19...0x1a1a => true, 0x1a1b => true, 0x1a20...0x1a54 => true, 0x1a55 => true, 0x1a56 => true, 0x1a57 => true, 0x1a58...0x1a5e => true, 0x1a60 => true, 0x1a61 => true, 0x1a62 => true, 0x1a63...0x1a64 => true, 0x1a65...0x1a6c => true, 0x1a6d...0x1a72 => true, 0x1a73...0x1a7c => true, 0x1a7f => true, 0x1a80...0x1a89 => true, 0x1a90...0x1a99 => true, 0x1aa7 => true, 0x1ab0...0x1abd => true, 0x1abf...0x1ace => true, 0x1b00...0x1b03 => true, 0x1b04 => true, 0x1b05...0x1b33 => true, 0x1b34 => true, 0x1b35 => true, 0x1b36...0x1b3a => true, 0x1b3b => true, 0x1b3c => true, 0x1b3d...0x1b41 => true, 0x1b42 => true, 0x1b43...0x1b44 => true, 0x1b45...0x1b4c => true, 0x1b50...0x1b59 => true, 0x1b6b...0x1b73 => true, 0x1b80...0x1b81 => true, 0x1b82 => true, 0x1b83...0x1ba0 => true, 0x1ba1 => true, 0x1ba2...0x1ba5 => true, 0x1ba6...0x1ba7 => true, 0x1ba8...0x1ba9 => true, 0x1baa => true, 0x1bab...0x1bad => true, 0x1bae...0x1baf => true, 0x1bb0...0x1bb9 => true, 0x1bba...0x1be5 => true, 0x1be6 => true, 0x1be7 => true, 0x1be8...0x1be9 => true, 0x1bea...0x1bec => true, 0x1bed => true, 0x1bee => true, 0x1bef...0x1bf1 => true, 0x1bf2...0x1bf3 => true, 0x1c00...0x1c23 => true, 0x1c24...0x1c2b => true, 0x1c2c...0x1c33 => true, 0x1c34...0x1c35 => true, 0x1c36...0x1c37 => true, 0x1c40...0x1c49 => true, 0x1c4d...0x1c4f => true, 0x1c50...0x1c59 => true, 0x1c5a...0x1c77 => true, 0x1c78...0x1c7d => true, 0x1c80...0x1c88 => true, 0x1c90...0x1cba => true, 0x1cbd...0x1cbf => true, 0x1cd0...0x1cd2 => true, 0x1cd4...0x1ce0 => true, 0x1ce1 => true, 0x1ce2...0x1ce8 => true, 0x1ce9...0x1cec => true, 0x1ced => true, 0x1cee...0x1cf3 => true, 0x1cf4 => true, 0x1cf5...0x1cf6 => true, 0x1cf7 => true, 0x1cf8...0x1cf9 => true, 0x1cfa => true, 0x1d00...0x1d2b => true, 0x1d2c...0x1d6a => true, 0x1d6b...0x1d77 => true, 0x1d78 => true, 0x1d79...0x1d9a => true, 0x1d9b...0x1dbf => true, 0x1dc0...0x1dff => true, 0x1e00...0x1f15 => true, 0x1f18...0x1f1d => true, 0x1f20...0x1f45 => true, 0x1f48...0x1f4d => true, 0x1f50...0x1f57 => true, 0x1f59 => true, 0x1f5b => true, 0x1f5d => true, 0x1f5f...0x1f7d => true, 0x1f80...0x1fb4 => true, 0x1fb6...0x1fbc => true, 0x1fbe => true, 0x1fc2...0x1fc4 => true, 0x1fc6...0x1fcc => true, 0x1fd0...0x1fd3 => true, 0x1fd6...0x1fdb => true, 0x1fe0...0x1fec => true, 0x1ff2...0x1ff4 => true, 0x1ff6...0x1ffc => true, 0x203f...0x2040 => true, 0x2054 => true, 0x2071 => true, 0x207f => true, 0x2090...0x209c => true, 0x20d0...0x20dc => true, 0x20e1 => true, 0x20e5...0x20f0 => true, 0x2102 => true, 0x2107 => true, 0x210a...0x2113 => true, 0x2115 => true, 0x2118 => true, 0x2119...0x211d => true, 0x2124 => true, 0x2126 => true, 0x2128 => true, 0x212a...0x212d => true, 0x212e => true, 0x212f...0x2134 => true, 0x2135...0x2138 => true, 0x2139 => true, 0x213c...0x213f => true, 0x2145...0x2149 => true, 0x214e => true, 0x2160...0x2182 => true, 0x2183...0x2184 => true, 0x2185...0x2188 => true, 0x2c00...0x2c7b => true, 0x2c7c...0x2c7d => true, 0x2c7e...0x2ce4 => true, 0x2ceb...0x2cee => true, 0x2cef...0x2cf1 => true, 0x2cf2...0x2cf3 => true, 0x2d00...0x2d25 => true, 0x2d27 => true, 0x2d2d => true, 0x2d30...0x2d67 => true, 0x2d6f => true, 0x2d7f => true, 0x2d80...0x2d96 => true, 0x2da0...0x2da6 => true, 0x2da8...0x2dae => true, 0x2db0...0x2db6 => true, 0x2db8...0x2dbe => true, 0x2dc0...0x2dc6 => true, 0x2dc8...0x2dce => true, 0x2dd0...0x2dd6 => true, 0x2dd8...0x2dde => true, 0x2de0...0x2dff => true, 0x3005 => true, 0x3006 => true, 0x3007 => true, 0x3021...0x3029 => true, 0x302a...0x302d => true, 0x302e...0x302f => true, 0x3031...0x3035 => true, 0x3038...0x303a => true, 0x303b => true, 0x303c => true, 0x3041...0x3096 => true, 0x3099...0x309a => true, 0x309b...0x309c => true, 0x309d...0x309e => true, 0x309f => true, 0x30a1...0x30fa => true, 0x30fc...0x30fe => true, 0x30ff => true, 0x3105...0x312f => true, 0x3131...0x318e => true, 0x31a0...0x31bf => true, 0x31f0...0x31ff => true, 0x3400...0x4dbf => true, 0x4e00...0xa014 => true, 0xa015 => true, 0xa016...0xa48c => true, 0xa4d0...0xa4f7 => true, 0xa4f8...0xa4fd => true, 0xa500...0xa60b => true, 0xa60c => true, 0xa610...0xa61f => true, 0xa620...0xa629 => true, 0xa62a...0xa62b => true, 0xa640...0xa66d => true, 0xa66e => true, 0xa66f => true, 0xa674...0xa67d => true, 0xa67f => true, 0xa680...0xa69b => true, 0xa69c...0xa69d => true, 0xa69e...0xa69f => true, 0xa6a0...0xa6e5 => true, 0xa6e6...0xa6ef => true, 0xa6f0...0xa6f1 => true, 0xa717...0xa71f => true, 0xa722...0xa76f => true, 0xa770 => true, 0xa771...0xa787 => true, 0xa788 => true, 0xa78b...0xa78e => true, 0xa78f => true, 0xa790...0xa7ca => true, 0xa7d0...0xa7d1 => true, 0xa7d3 => true, 0xa7d5...0xa7d9 => true, 0xa7f2...0xa7f4 => true, 0xa7f5...0xa7f6 => true, 0xa7f7 => true, 0xa7f8...0xa7f9 => true, 0xa7fa => true, 0xa7fb...0xa801 => true, 0xa802 => true, 0xa803...0xa805 => true, 0xa806 => true, 0xa807...0xa80a => true, 0xa80b => true, 0xa80c...0xa822 => true, 0xa823...0xa824 => true, 0xa825...0xa826 => true, 0xa827 => true, 0xa82c => true, 0xa840...0xa873 => true, 0xa880...0xa881 => true, 0xa882...0xa8b3 => true, 0xa8b4...0xa8c3 => true, 0xa8c4...0xa8c5 => true, 0xa8d0...0xa8d9 => true, 0xa8e0...0xa8f1 => true, 0xa8f2...0xa8f7 => true, 0xa8fb => true, 0xa8fd...0xa8fe => true, 0xa8ff => true, 0xa900...0xa909 => true, 0xa90a...0xa925 => true, 0xa926...0xa92d => true, 0xa930...0xa946 => true, 0xa947...0xa951 => true, 0xa952...0xa953 => true, 0xa960...0xa97c => true, 0xa980...0xa982 => true, 0xa983 => true, 0xa984...0xa9b2 => true, 0xa9b3 => true, 0xa9b4...0xa9b5 => true, 0xa9b6...0xa9b9 => true, 0xa9ba...0xa9bb => true, 0xa9bc...0xa9bd => true, 0xa9be...0xa9c0 => true, 0xa9cf => true, 0xa9d0...0xa9d9 => true, 0xa9e0...0xa9e4 => true, 0xa9e5 => true, 0xa9e6 => true, 0xa9e7...0xa9ef => true, 0xa9f0...0xa9f9 => true, 0xa9fa...0xa9fe => true, 0xaa00...0xaa28 => true, 0xaa29...0xaa2e => true, 0xaa2f...0xaa30 => true, 0xaa31...0xaa32 => true, 0xaa33...0xaa34 => true, 0xaa35...0xaa36 => true, 0xaa40...0xaa42 => true, 0xaa43 => true, 0xaa44...0xaa4b => true, 0xaa4c => true, 0xaa4d => true, 0xaa50...0xaa59 => true, 0xaa60...0xaa6f => true, 0xaa70 => true, 0xaa71...0xaa76 => true, 0xaa7a => true, 0xaa7b => true, 0xaa7c => true, 0xaa7d => true, 0xaa7e...0xaaaf => true, 0xaab0 => true, 0xaab1 => true, 0xaab2...0xaab4 => true, 0xaab5...0xaab6 => true, 0xaab7...0xaab8 => true, 0xaab9...0xaabd => true, 0xaabe...0xaabf => true, 0xaac0 => true, 0xaac1 => true, 0xaac2 => true, 0xaadb...0xaadc => true, 0xaadd => true, 0xaae0...0xaaea => true, 0xaaeb => true, 0xaaec...0xaaed => true, 0xaaee...0xaaef => true, 0xaaf2 => true, 0xaaf3...0xaaf4 => true, 0xaaf5 => true, 0xaaf6 => true, 0xab01...0xab06 => true, 0xab09...0xab0e => true, 0xab11...0xab16 => true, 0xab20...0xab26 => true, 0xab28...0xab2e => true, 0xab30...0xab5a => true, 0xab5c...0xab5f => true, 0xab60...0xab68 => true, 0xab69 => true, 0xab70...0xabbf => true, 0xabc0...0xabe2 => true, 0xabe3...0xabe4 => true, 0xabe5 => true, 0xabe6...0xabe7 => true, 0xabe8 => true, 0xabe9...0xabea => true, 0xabec => true, 0xabed => true, 0xabf0...0xabf9 => true, 0xac00...0xd7a3 => true, 0xd7b0...0xd7c6 => true, 0xd7cb...0xd7fb => true, 0xf900...0xfa6d => true, 0xfa70...0xfad9 => true, 0xfb00...0xfb06 => true, 0xfb13...0xfb17 => true, 0xfb1d => true, 0xfb1e => true, 0xfb1f...0xfb28 => true, 0xfb2a...0xfb36 => true, 0xfb38...0xfb3c => true, 0xfb3e => true, 0xfb40...0xfb41 => true, 0xfb43...0xfb44 => true, 0xfb46...0xfbb1 => true, 0xfbd3...0xfd3d => true, 0xfd50...0xfd8f => true, 0xfd92...0xfdc7 => true, 0xfdf0...0xfdfb => true, 0xfe00...0xfe0f => true, 0xfe20...0xfe2f => true, 0xfe33...0xfe34 => true, 0xfe4d...0xfe4f => true, 0xfe70...0xfe74 => true, 0xfe76...0xfefc => true, 0xff10...0xff19 => true, 0xff21...0xff3a => true, 0xff3f => true, 0xff41...0xff5a => true, 0xff66...0xff6f => true, 0xff70 => true, 0xff71...0xff9d => true, 0xff9e...0xff9f => true, 0xffa0...0xffbe => true, 0xffc2...0xffc7 => true, 0xffca...0xffcf => true, 0xffd2...0xffd7 => true, 0xffda...0xffdc => true, 0x10000...0x1000b => true, 0x1000d...0x10026 => true, 0x10028...0x1003a => true, 0x1003c...0x1003d => true, 0x1003f...0x1004d => true, 0x10050...0x1005d => true, 0x10080...0x100fa => true, 0x10140...0x10174 => true, 0x101fd => true, 0x10280...0x1029c => true, 0x102a0...0x102d0 => true, 0x102e0 => true, 0x10300...0x1031f => true, 0x1032d...0x10340 => true, 0x10341 => true, 0x10342...0x10349 => true, 0x1034a => true, 0x10350...0x10375 => true, 0x10376...0x1037a => true, 0x10380...0x1039d => true, 0x103a0...0x103c3 => true, 0x103c8...0x103cf => true, 0x103d1...0x103d5 => true, 0x10400...0x1044f => true, 0x10450...0x1049d => true, 0x104a0...0x104a9 => true, 0x104b0...0x104d3 => true, 0x104d8...0x104fb => true, 0x10500...0x10527 => true, 0x10530...0x10563 => true, 0x10570...0x1057a => true, 0x1057c...0x1058a => true, 0x1058c...0x10592 => true, 0x10594...0x10595 => true, 0x10597...0x105a1 => true, 0x105a3...0x105b1 => true, 0x105b3...0x105b9 => true, 0x105bb...0x105bc => true, 0x10600...0x10736 => true, 0x10740...0x10755 => true, 0x10760...0x10767 => true, 0x10780...0x10785 => true, 0x10787...0x107b0 => true, 0x107b2...0x107ba => true, 0x10800...0x10805 => true, 0x10808 => true, 0x1080a...0x10835 => true, 0x10837...0x10838 => true, 0x1083c => true, 0x1083f...0x10855 => true, 0x10860...0x10876 => true, 0x10880...0x1089e => true, 0x108e0...0x108f2 => true, 0x108f4...0x108f5 => true, 0x10900...0x10915 => true, 0x10920...0x10939 => true, 0x10980...0x109b7 => true, 0x109be...0x109bf => true, 0x10a00 => true, 0x10a01...0x10a03 => true, 0x10a05...0x10a06 => true, 0x10a0c...0x10a0f => true, 0x10a10...0x10a13 => true, 0x10a15...0x10a17 => true, 0x10a19...0x10a35 => true, 0x10a38...0x10a3a => true, 0x10a3f => true, 0x10a60...0x10a7c => true, 0x10a80...0x10a9c => true, 0x10ac0...0x10ac7 => true, 0x10ac9...0x10ae4 => true, 0x10ae5...0x10ae6 => true, 0x10b00...0x10b35 => true, 0x10b40...0x10b55 => true, 0x10b60...0x10b72 => true, 0x10b80...0x10b91 => true, 0x10c00...0x10c48 => true, 0x10c80...0x10cb2 => true, 0x10cc0...0x10cf2 => true, 0x10d00...0x10d23 => true, 0x10d24...0x10d27 => true, 0x10d30...0x10d39 => true, 0x10e80...0x10ea9 => true, 0x10eab...0x10eac => true, 0x10eb0...0x10eb1 => true, 0x10f00...0x10f1c => true, 0x10f27 => true, 0x10f30...0x10f45 => true, 0x10f46...0x10f50 => true, 0x10f70...0x10f81 => true, 0x10f82...0x10f85 => true, 0x10fb0...0x10fc4 => true, 0x10fe0...0x10ff6 => true, 0x11000 => true, 0x11001 => true, 0x11002 => true, 0x11003...0x11037 => true, 0x11038...0x11046 => true, 0x11066...0x1106f => true, 0x11070 => true, 0x11071...0x11072 => true, 0x11073...0x11074 => true, 0x11075 => true, 0x1107f...0x11081 => true, 0x11082 => true, 0x11083...0x110af => true, 0x110b0...0x110b2 => true, 0x110b3...0x110b6 => true, 0x110b7...0x110b8 => true, 0x110b9...0x110ba => true, 0x110c2 => true, 0x110d0...0x110e8 => true, 0x110f0...0x110f9 => true, 0x11100...0x11102 => true, 0x11103...0x11126 => true, 0x11127...0x1112b => true, 0x1112c => true, 0x1112d...0x11134 => true, 0x11136...0x1113f => true, 0x11144 => true, 0x11145...0x11146 => true, 0x11147 => true, 0x11150...0x11172 => true, 0x11173 => true, 0x11176 => true, 0x11180...0x11181 => true, 0x11182 => true, 0x11183...0x111b2 => true, 0x111b3...0x111b5 => true, 0x111b6...0x111be => true, 0x111bf...0x111c0 => true, 0x111c1...0x111c4 => true, 0x111c9...0x111cc => true, 0x111ce => true, 0x111cf => true, 0x111d0...0x111d9 => true, 0x111da => true, 0x111dc => true, 0x11200...0x11211 => true, 0x11213...0x1122b => true, 0x1122c...0x1122e => true, 0x1122f...0x11231 => true, 0x11232...0x11233 => true, 0x11234 => true, 0x11235 => true, 0x11236...0x11237 => true, 0x1123e => true, 0x11280...0x11286 => true, 0x11288 => true, 0x1128a...0x1128d => true, 0x1128f...0x1129d => true, 0x1129f...0x112a8 => true, 0x112b0...0x112de => true, 0x112df => true, 0x112e0...0x112e2 => true, 0x112e3...0x112ea => true, 0x112f0...0x112f9 => true, 0x11300...0x11301 => true, 0x11302...0x11303 => true, 0x11305...0x1130c => true, 0x1130f...0x11310 => true, 0x11313...0x11328 => true, 0x1132a...0x11330 => true, 0x11332...0x11333 => true, 0x11335...0x11339 => true, 0x1133b...0x1133c => true, 0x1133d => true, 0x1133e...0x1133f => true, 0x11340 => true, 0x11341...0x11344 => true, 0x11347...0x11348 => true, 0x1134b...0x1134d => true, 0x11350 => true, 0x11357 => true, 0x1135d...0x11361 => true, 0x11362...0x11363 => true, 0x11366...0x1136c => true, 0x11370...0x11374 => true, 0x11400...0x11434 => true, 0x11435...0x11437 => true, 0x11438...0x1143f => true, 0x11440...0x11441 => true, 0x11442...0x11444 => true, 0x11445 => true, 0x11446 => true, 0x11447...0x1144a => true, 0x11450...0x11459 => true, 0x1145e => true, 0x1145f...0x11461 => true, 0x11480...0x114af => true, 0x114b0...0x114b2 => true, 0x114b3...0x114b8 => true, 0x114b9 => true, 0x114ba => true, 0x114bb...0x114be => true, 0x114bf...0x114c0 => true, 0x114c1 => true, 0x114c2...0x114c3 => true, 0x114c4...0x114c5 => true, 0x114c7 => true, 0x114d0...0x114d9 => true, 0x11580...0x115ae => true, 0x115af...0x115b1 => true, 0x115b2...0x115b5 => true, 0x115b8...0x115bb => true, 0x115bc...0x115bd => true, 0x115be => true, 0x115bf...0x115c0 => true, 0x115d8...0x115db => true, 0x115dc...0x115dd => true, 0x11600...0x1162f => true, 0x11630...0x11632 => true, 0x11633...0x1163a => true, 0x1163b...0x1163c => true, 0x1163d => true, 0x1163e => true, 0x1163f...0x11640 => true, 0x11644 => true, 0x11650...0x11659 => true, 0x11680...0x116aa => true, 0x116ab => true, 0x116ac => true, 0x116ad => true, 0x116ae...0x116af => true, 0x116b0...0x116b5 => true, 0x116b6 => true, 0x116b7 => true, 0x116b8 => true, 0x116c0...0x116c9 => true, 0x11700...0x1171a => true, 0x1171d...0x1171f => true, 0x11720...0x11721 => true, 0x11722...0x11725 => true, 0x11726 => true, 0x11727...0x1172b => true, 0x11730...0x11739 => true, 0x11740...0x11746 => true, 0x11800...0x1182b => true, 0x1182c...0x1182e => true, 0x1182f...0x11837 => true, 0x11838 => true, 0x11839...0x1183a => true, 0x118a0...0x118df => true, 0x118e0...0x118e9 => true, 0x118ff...0x11906 => true, 0x11909 => true, 0x1190c...0x11913 => true, 0x11915...0x11916 => true, 0x11918...0x1192f => true, 0x11930...0x11935 => true, 0x11937...0x11938 => true, 0x1193b...0x1193c => true, 0x1193d => true, 0x1193e => true, 0x1193f => true, 0x11940 => true, 0x11941 => true, 0x11942 => true, 0x11943 => true, 0x11950...0x11959 => true, 0x119a0...0x119a7 => true, 0x119aa...0x119d0 => true, 0x119d1...0x119d3 => true, 0x119d4...0x119d7 => true, 0x119da...0x119db => true, 0x119dc...0x119df => true, 0x119e0 => true, 0x119e1 => true, 0x119e3 => true, 0x119e4 => true, 0x11a00 => true, 0x11a01...0x11a0a => true, 0x11a0b...0x11a32 => true, 0x11a33...0x11a38 => true, 0x11a39 => true, 0x11a3a => true, 0x11a3b...0x11a3e => true, 0x11a47 => true, 0x11a50 => true, 0x11a51...0x11a56 => true, 0x11a57...0x11a58 => true, 0x11a59...0x11a5b => true, 0x11a5c...0x11a89 => true, 0x11a8a...0x11a96 => true, 0x11a97 => true, 0x11a98...0x11a99 => true, 0x11a9d => true, 0x11ab0...0x11af8 => true, 0x11c00...0x11c08 => true, 0x11c0a...0x11c2e => true, 0x11c2f => true, 0x11c30...0x11c36 => true, 0x11c38...0x11c3d => true, 0x11c3e => true, 0x11c3f => true, 0x11c40 => true, 0x11c50...0x11c59 => true, 0x11c72...0x11c8f => true, 0x11c92...0x11ca7 => true, 0x11ca9 => true, 0x11caa...0x11cb0 => true, 0x11cb1 => true, 0x11cb2...0x11cb3 => true, 0x11cb4 => true, 0x11cb5...0x11cb6 => true, 0x11d00...0x11d06 => true, 0x11d08...0x11d09 => true, 0x11d0b...0x11d30 => true, 0x11d31...0x11d36 => true, 0x11d3a => true, 0x11d3c...0x11d3d => true, 0x11d3f...0x11d45 => true, 0x11d46 => true, 0x11d47 => true, 0x11d50...0x11d59 => true, 0x11d60...0x11d65 => true, 0x11d67...0x11d68 => true, 0x11d6a...0x11d89 => true, 0x11d8a...0x11d8e => true, 0x11d90...0x11d91 => true, 0x11d93...0x11d94 => true, 0x11d95 => true, 0x11d96 => true, 0x11d97 => true, 0x11d98 => true, 0x11da0...0x11da9 => true, 0x11ee0...0x11ef2 => true, 0x11ef3...0x11ef4 => true, 0x11ef5...0x11ef6 => true, 0x11fb0 => true, 0x12000...0x12399 => true, 0x12400...0x1246e => true, 0x12480...0x12543 => true, 0x12f90...0x12ff0 => true, 0x13000...0x1342e => true, 0x14400...0x14646 => true, 0x16800...0x16a38 => true, 0x16a40...0x16a5e => true, 0x16a60...0x16a69 => true, 0x16a70...0x16abe => true, 0x16ac0...0x16ac9 => true, 0x16ad0...0x16aed => true, 0x16af0...0x16af4 => true, 0x16b00...0x16b2f => true, 0x16b30...0x16b36 => true, 0x16b40...0x16b43 => true, 0x16b50...0x16b59 => true, 0x16b63...0x16b77 => true, 0x16b7d...0x16b8f => true, 0x16e40...0x16e7f => true, 0x16f00...0x16f4a => true, 0x16f4f => true, 0x16f50 => true, 0x16f51...0x16f87 => true, 0x16f8f...0x16f92 => true, 0x16f93...0x16f9f => true, 0x16fe0...0x16fe1 => true, 0x16fe3 => true, 0x16fe4 => true, 0x16ff0...0x16ff1 => true, 0x17000...0x187f7 => true, 0x18800...0x18cd5 => true, 0x18d00...0x18d08 => true, 0x1aff0...0x1aff3 => true, 0x1aff5...0x1affb => true, 0x1affd...0x1affe => true, 0x1b000...0x1b122 => true, 0x1b150...0x1b152 => true, 0x1b164...0x1b167 => true, 0x1b170...0x1b2fb => true, 0x1bc00...0x1bc6a => true, 0x1bc70...0x1bc7c => true, 0x1bc80...0x1bc88 => true, 0x1bc90...0x1bc99 => true, 0x1bc9d...0x1bc9e => true, 0x1cf00...0x1cf2d => true, 0x1cf30...0x1cf46 => true, 0x1d165...0x1d166 => true, 0x1d167...0x1d169 => true, 0x1d16d...0x1d172 => true, 0x1d17b...0x1d182 => true, 0x1d185...0x1d18b => true, 0x1d1aa...0x1d1ad => true, 0x1d242...0x1d244 => true, 0x1d400...0x1d454 => true, 0x1d456...0x1d49c => true, 0x1d49e...0x1d49f => true, 0x1d4a2 => true, 0x1d4a5...0x1d4a6 => true, 0x1d4a9...0x1d4ac => true, 0x1d4ae...0x1d4b9 => true, 0x1d4bb => true, 0x1d4bd...0x1d4c3 => true, 0x1d4c5...0x1d505 => true, 0x1d507...0x1d50a => true, 0x1d50d...0x1d514 => true, 0x1d516...0x1d51c => true, 0x1d51e...0x1d539 => true, 0x1d53b...0x1d53e => true, 0x1d540...0x1d544 => true, 0x1d546 => true, 0x1d54a...0x1d550 => true, 0x1d552...0x1d6a5 => true, 0x1d6a8...0x1d6c0 => true, 0x1d6c2...0x1d6da => true, 0x1d6dc...0x1d6fa => true, 0x1d6fc...0x1d714 => true, 0x1d716...0x1d734 => true, 0x1d736...0x1d74e => true, 0x1d750...0x1d76e => true, 0x1d770...0x1d788 => true, 0x1d78a...0x1d7a8 => true, 0x1d7aa...0x1d7c2 => true, 0x1d7c4...0x1d7cb => true, 0x1d7ce...0x1d7ff => true, 0x1da00...0x1da36 => true, 0x1da3b...0x1da6c => true, 0x1da75 => true, 0x1da84 => true, 0x1da9b...0x1da9f => true, 0x1daa1...0x1daaf => true, 0x1df00...0x1df09 => true, 0x1df0a => true, 0x1df0b...0x1df1e => true, 0x1e000...0x1e006 => true, 0x1e008...0x1e018 => true, 0x1e01b...0x1e021 => true, 0x1e023...0x1e024 => true, 0x1e026...0x1e02a => true, 0x1e100...0x1e12c => true, 0x1e130...0x1e136 => true, 0x1e137...0x1e13d => true, 0x1e140...0x1e149 => true, 0x1e14e => true, 0x1e290...0x1e2ad => true, 0x1e2ae => true, 0x1e2c0...0x1e2eb => true, 0x1e2ec...0x1e2ef => true, 0x1e2f0...0x1e2f9 => true, 0x1e7e0...0x1e7e6 => true, 0x1e7e8...0x1e7eb => true, 0x1e7ed...0x1e7ee => true, 0x1e7f0...0x1e7fe => true, 0x1e800...0x1e8c4 => true, 0x1e8d0...0x1e8d6 => true, 0x1e900...0x1e943 => true, 0x1e944...0x1e94a => true, 0x1e94b => true, 0x1e950...0x1e959 => true, 0x1ee00...0x1ee03 => true, 0x1ee05...0x1ee1f => true, 0x1ee21...0x1ee22 => true, 0x1ee24 => true, 0x1ee27 => true, 0x1ee29...0x1ee32 => true, 0x1ee34...0x1ee37 => true, 0x1ee39 => true, 0x1ee3b => true, 0x1ee42 => true, 0x1ee47 => true, 0x1ee49 => true, 0x1ee4b => true, 0x1ee4d...0x1ee4f => true, 0x1ee51...0x1ee52 => true, 0x1ee54 => true, 0x1ee57 => true, 0x1ee59 => true, 0x1ee5b => true, 0x1ee5d => true, 0x1ee5f => true, 0x1ee61...0x1ee62 => true, 0x1ee64 => true, 0x1ee67...0x1ee6a => true, 0x1ee6c...0x1ee72 => true, 0x1ee74...0x1ee77 => true, 0x1ee79...0x1ee7c => true, 0x1ee7e => true, 0x1ee80...0x1ee89 => true, 0x1ee8b...0x1ee9b => true, 0x1eea1...0x1eea3 => true, 0x1eea5...0x1eea9 => true, 0x1eeab...0x1eebb => true, 0x1fbf0...0x1fbf9 => true, 0x20000...0x2a6df => true, 0x2a700...0x2b738 => true, 0x2b740...0x2b81d => true, 0x2b820...0x2cea1 => true, 0x2ceb0...0x2ebe0 => true, 0x2f800...0x2fa1d => true, 0x30000...0x3134a => true, 0xe0100...0xe01ef => true, else => false, }; } pub fn isXidStart(cp: u21) bool { if (cp < 0x41 or cp > 0x3134a) return false; return switch (cp) { 0x41...0x5a => true, 0x61...0x7a => true, 0xaa => true, 0xb5 => true, 0xba => true, 0xc0...0xd6 => true, 0xd8...0xf6 => true, 0xf8...0x1ba => true, 0x1bb => true, 0x1bc...0x1bf => true, 0x1c0...0x1c3 => true, 0x1c4...0x293 => true, 0x294 => true, 0x295...0x2af => true, 0x2b0...0x2c1 => true, 0x2c6...0x2d1 => true, 0x2e0...0x2e4 => true, 0x2ec => true, 0x2ee => true, 0x370...0x373 => true, 0x374 => true, 0x376...0x377 => true, 0x37b...0x37d => true, 0x37f => true, 0x386 => true, 0x388...0x38a => true, 0x38c => true, 0x38e...0x3a1 => true, 0x3a3...0x3f5 => true, 0x3f7...0x481 => true, 0x48a...0x52f => true, 0x531...0x556 => true, 0x559 => true, 0x560...0x588 => true, 0x5d0...0x5ea => true, 0x5ef...0x5f2 => true, 0x620...0x63f => true, 0x640 => true, 0x641...0x64a => true, 0x66e...0x66f => true, 0x671...0x6d3 => true, 0x6d5 => true, 0x6e5...0x6e6 => true, 0x6ee...0x6ef => true, 0x6fa...0x6fc => true, 0x6ff => true, 0x710 => true, 0x712...0x72f => true, 0x74d...0x7a5 => true, 0x7b1 => true, 0x7ca...0x7ea => true, 0x7f4...0x7f5 => true, 0x7fa => true, 0x800...0x815 => true, 0x81a => true, 0x824 => true, 0x828 => true, 0x840...0x858 => true, 0x860...0x86a => true, 0x870...0x887 => true, 0x889...0x88e => true, 0x8a0...0x8c8 => true, 0x8c9 => true, 0x904...0x939 => true, 0x93d => true, 0x950 => true, 0x958...0x961 => true, 0x971 => true, 0x972...0x980 => true, 0x985...0x98c => true, 0x98f...0x990 => true, 0x993...0x9a8 => true, 0x9aa...0x9b0 => true, 0x9b2 => true, 0x9b6...0x9b9 => true, 0x9bd => true, 0x9ce => true, 0x9dc...0x9dd => true, 0x9df...0x9e1 => true, 0x9f0...0x9f1 => true, 0x9fc => true, 0xa05...0xa0a => true, 0xa0f...0xa10 => true, 0xa13...0xa28 => true, 0xa2a...0xa30 => true, 0xa32...0xa33 => true, 0xa35...0xa36 => true, 0xa38...0xa39 => true, 0xa59...0xa5c => true, 0xa5e => true, 0xa72...0xa74 => true, 0xa85...0xa8d => true, 0xa8f...0xa91 => true, 0xa93...0xaa8 => true, 0xaaa...0xab0 => true, 0xab2...0xab3 => true, 0xab5...0xab9 => true, 0xabd => true, 0xad0 => true, 0xae0...0xae1 => true, 0xaf9 => true, 0xb05...0xb0c => true, 0xb0f...0xb10 => true, 0xb13...0xb28 => true, 0xb2a...0xb30 => true, 0xb32...0xb33 => true, 0xb35...0xb39 => true, 0xb3d => true, 0xb5c...0xb5d => true, 0xb5f...0xb61 => true, 0xb71 => true, 0xb83 => true, 0xb85...0xb8a => true, 0xb8e...0xb90 => true, 0xb92...0xb95 => true, 0xb99...0xb9a => true, 0xb9c => true, 0xb9e...0xb9f => true, 0xba3...0xba4 => true, 0xba8...0xbaa => true, 0xbae...0xbb9 => true, 0xbd0 => true, 0xc05...0xc0c => true, 0xc0e...0xc10 => true, 0xc12...0xc28 => true, 0xc2a...0xc39 => true, 0xc3d => true, 0xc58...0xc5a => true, 0xc5d => true, 0xc60...0xc61 => true, 0xc80 => true, 0xc85...0xc8c => true, 0xc8e...0xc90 => true, 0xc92...0xca8 => true, 0xcaa...0xcb3 => true, 0xcb5...0xcb9 => true, 0xcbd => true, 0xcdd...0xcde => true, 0xce0...0xce1 => true, 0xcf1...0xcf2 => true, 0xd04...0xd0c => true, 0xd0e...0xd10 => true, 0xd12...0xd3a => true, 0xd3d => true, 0xd4e => true, 0xd54...0xd56 => true, 0xd5f...0xd61 => true, 0xd7a...0xd7f => true, 0xd85...0xd96 => true, 0xd9a...0xdb1 => true, 0xdb3...0xdbb => true, 0xdbd => true, 0xdc0...0xdc6 => true, 0xe01...0xe30 => true, 0xe32 => true, 0xe40...0xe45 => true, 0xe46 => true, 0xe81...0xe82 => true, 0xe84 => true, 0xe86...0xe8a => true, 0xe8c...0xea3 => true, 0xea5 => true, 0xea7...0xeb0 => true, 0xeb2 => true, 0xebd => true, 0xec0...0xec4 => true, 0xec6 => true, 0xedc...0xedf => true, 0xf00 => true, 0xf40...0xf47 => true, 0xf49...0xf6c => true, 0xf88...0xf8c => true, 0x1000...0x102a => true, 0x103f => true, 0x1050...0x1055 => true, 0x105a...0x105d => true, 0x1061 => true, 0x1065...0x1066 => true, 0x106e...0x1070 => true, 0x1075...0x1081 => true, 0x108e => true, 0x10a0...0x10c5 => true, 0x10c7 => true, 0x10cd => true, 0x10d0...0x10fa => true, 0x10fc => true, 0x10fd...0x10ff => true, 0x1100...0x1248 => true, 0x124a...0x124d => true, 0x1250...0x1256 => true, 0x1258 => true, 0x125a...0x125d => true, 0x1260...0x1288 => true, 0x128a...0x128d => true, 0x1290...0x12b0 => true, 0x12b2...0x12b5 => true, 0x12b8...0x12be => true, 0x12c0 => true, 0x12c2...0x12c5 => true, 0x12c8...0x12d6 => true, 0x12d8...0x1310 => true, 0x1312...0x1315 => true, 0x1318...0x135a => true, 0x1380...0x138f => true, 0x13a0...0x13f5 => true, 0x13f8...0x13fd => true, 0x1401...0x166c => true, 0x166f...0x167f => true, 0x1681...0x169a => true, 0x16a0...0x16ea => true, 0x16ee...0x16f0 => true, 0x16f1...0x16f8 => true, 0x1700...0x1711 => true, 0x171f...0x1731 => true, 0x1740...0x1751 => true, 0x1760...0x176c => true, 0x176e...0x1770 => true, 0x1780...0x17b3 => true, 0x17d7 => true, 0x17dc => true, 0x1820...0x1842 => true, 0x1843 => true, 0x1844...0x1878 => true, 0x1880...0x1884 => true, 0x1885...0x1886 => true, 0x1887...0x18a8 => true, 0x18aa => true, 0x18b0...0x18f5 => true, 0x1900...0x191e => true, 0x1950...0x196d => true, 0x1970...0x1974 => true, 0x1980...0x19ab => true, 0x19b0...0x19c9 => true, 0x1a00...0x1a16 => true, 0x1a20...0x1a54 => true, 0x1aa7 => true, 0x1b05...0x1b33 => true, 0x1b45...0x1b4c => true, 0x1b83...0x1ba0 => true, 0x1bae...0x1baf => true, 0x1bba...0x1be5 => true, 0x1c00...0x1c23 => true, 0x1c4d...0x1c4f => true, 0x1c5a...0x1c77 => true, 0x1c78...0x1c7d => true, 0x1c80...0x1c88 => true, 0x1c90...0x1cba => true, 0x1cbd...0x1cbf => true, 0x1ce9...0x1cec => true, 0x1cee...0x1cf3 => true, 0x1cf5...0x1cf6 => true, 0x1cfa => true, 0x1d00...0x1d2b => true, 0x1d2c...0x1d6a => true, 0x1d6b...0x1d77 => true, 0x1d78 => true, 0x1d79...0x1d9a => true, 0x1d9b...0x1dbf => true, 0x1e00...0x1f15 => true, 0x1f18...0x1f1d => true, 0x1f20...0x1f45 => true, 0x1f48...0x1f4d => true, 0x1f50...0x1f57 => true, 0x1f59 => true, 0x1f5b => true, 0x1f5d => true, 0x1f5f...0x1f7d => true, 0x1f80...0x1fb4 => true, 0x1fb6...0x1fbc => true, 0x1fbe => true, 0x1fc2...0x1fc4 => true, 0x1fc6...0x1fcc => true, 0x1fd0...0x1fd3 => true, 0x1fd6...0x1fdb => true, 0x1fe0...0x1fec => true, 0x1ff2...0x1ff4 => true, 0x1ff6...0x1ffc => true, 0x2071 => true, 0x207f => true, 0x2090...0x209c => true, 0x2102 => true, 0x2107 => true, 0x210a...0x2113 => true, 0x2115 => true, 0x2118 => true, 0x2119...0x211d => true, 0x2124 => true, 0x2126 => true, 0x2128 => true, 0x212a...0x212d => true, 0x212e => true, 0x212f...0x2134 => true, 0x2135...0x2138 => true, 0x2139 => true, 0x213c...0x213f => true, 0x2145...0x2149 => true, 0x214e => true, 0x2160...0x2182 => true, 0x2183...0x2184 => true, 0x2185...0x2188 => true, 0x2c00...0x2c7b => true, 0x2c7c...0x2c7d => true, 0x2c7e...0x2ce4 => true, 0x2ceb...0x2cee => true, 0x2cf2...0x2cf3 => true, 0x2d00...0x2d25 => true, 0x2d27 => true, 0x2d2d => true, 0x2d30...0x2d67 => true, 0x2d6f => true, 0x2d80...0x2d96 => true, 0x2da0...0x2da6 => true, 0x2da8...0x2dae => true, 0x2db0...0x2db6 => true, 0x2db8...0x2dbe => true, 0x2dc0...0x2dc6 => true, 0x2dc8...0x2dce => true, 0x2dd0...0x2dd6 => true, 0x2dd8...0x2dde => true, 0x3005 => true, 0x3006 => true, 0x3007 => true, 0x3021...0x3029 => true, 0x3031...0x3035 => true, 0x3038...0x303a => true, 0x303b => true, 0x303c => true, 0x3041...0x3096 => true, 0x309d...0x309e => true, 0x309f => true, 0x30a1...0x30fa => true, 0x30fc...0x30fe => true, 0x30ff => true, 0x3105...0x312f => true, 0x3131...0x318e => true, 0x31a0...0x31bf => true, 0x31f0...0x31ff => true, 0x3400...0x4dbf => true, 0x4e00...0xa014 => true, 0xa015 => true, 0xa016...0xa48c => true, 0xa4d0...0xa4f7 => true, 0xa4f8...0xa4fd => true, 0xa500...0xa60b => true, 0xa60c => true, 0xa610...0xa61f => true, 0xa62a...0xa62b => true, 0xa640...0xa66d => true, 0xa66e => true, 0xa67f => true, 0xa680...0xa69b => true, 0xa69c...0xa69d => true, 0xa6a0...0xa6e5 => true, 0xa6e6...0xa6ef => true, 0xa717...0xa71f => true, 0xa722...0xa76f => true, 0xa770 => true, 0xa771...0xa787 => true, 0xa788 => true, 0xa78b...0xa78e => true, 0xa78f => true, 0xa790...0xa7ca => true, 0xa7d0...0xa7d1 => true, 0xa7d3 => true, 0xa7d5...0xa7d9 => true, 0xa7f2...0xa7f4 => true, 0xa7f5...0xa7f6 => true, 0xa7f7 => true, 0xa7f8...0xa7f9 => true, 0xa7fa => true, 0xa7fb...0xa801 => true, 0xa803...0xa805 => true, 0xa807...0xa80a => true, 0xa80c...0xa822 => true, 0xa840...0xa873 => true, 0xa882...0xa8b3 => true, 0xa8f2...0xa8f7 => true, 0xa8fb => true, 0xa8fd...0xa8fe => true, 0xa90a...0xa925 => true, 0xa930...0xa946 => true, 0xa960...0xa97c => true, 0xa984...0xa9b2 => true, 0xa9cf => true, 0xa9e0...0xa9e4 => true, 0xa9e6 => true, 0xa9e7...0xa9ef => true, 0xa9fa...0xa9fe => true, 0xaa00...0xaa28 => true, 0xaa40...0xaa42 => true, 0xaa44...0xaa4b => true, 0xaa60...0xaa6f => true, 0xaa70 => true, 0xaa71...0xaa76 => true, 0xaa7a => true, 0xaa7e...0xaaaf => true, 0xaab1 => true, 0xaab5...0xaab6 => true, 0xaab9...0xaabd => true, 0xaac0 => true, 0xaac2 => true, 0xaadb...0xaadc => true, 0xaadd => true, 0xaae0...0xaaea => true, 0xaaf2 => true, 0xaaf3...0xaaf4 => true, 0xab01...0xab06 => true, 0xab09...0xab0e => true, 0xab11...0xab16 => true, 0xab20...0xab26 => true, 0xab28...0xab2e => true, 0xab30...0xab5a => true, 0xab5c...0xab5f => true, 0xab60...0xab68 => true, 0xab69 => true, 0xab70...0xabbf => true, 0xabc0...0xabe2 => true, 0xac00...0xd7a3 => true, 0xd7b0...0xd7c6 => true, 0xd7cb...0xd7fb => true, 0xf900...0xfa6d => true, 0xfa70...0xfad9 => true, 0xfb00...0xfb06 => true, 0xfb13...0xfb17 => true, 0xfb1d => true, 0xfb1f...0xfb28 => true, 0xfb2a...0xfb36 => true, 0xfb38...0xfb3c => true, 0xfb3e => true, 0xfb40...0xfb41 => true, 0xfb43...0xfb44 => true, 0xfb46...0xfbb1 => true, 0xfbd3...0xfc5d => true, 0xfc64...0xfd3d => true, 0xfd50...0xfd8f => true, 0xfd92...0xfdc7 => true, 0xfdf0...0xfdf9 => true, 0xfe71 => true, 0xfe73 => true, 0xfe77 => true, 0xfe79 => true, 0xfe7b => true, 0xfe7d => true, 0xfe7f...0xfefc => true, 0xff21...0xff3a => true, 0xff41...0xff5a => true, 0xff66...0xff6f => true, 0xff70 => true, 0xff71...0xff9d => true, 0xffa0...0xffbe => true, 0xffc2...0xffc7 => true, 0xffca...0xffcf => true, 0xffd2...0xffd7 => true, 0xffda...0xffdc => true, 0x10000...0x1000b => true, 0x1000d...0x10026 => true, 0x10028...0x1003a => true, 0x1003c...0x1003d => true, 0x1003f...0x1004d => true, 0x10050...0x1005d => true, 0x10080...0x100fa => true, 0x10140...0x10174 => true, 0x10280...0x1029c => true, 0x102a0...0x102d0 => true, 0x10300...0x1031f => true, 0x1032d...0x10340 => true, 0x10341 => true, 0x10342...0x10349 => true, 0x1034a => true, 0x10350...0x10375 => true, 0x10380...0x1039d => true, 0x103a0...0x103c3 => true, 0x103c8...0x103cf => true, 0x103d1...0x103d5 => true, 0x10400...0x1044f => true, 0x10450...0x1049d => true, 0x104b0...0x104d3 => true, 0x104d8...0x104fb => true, 0x10500...0x10527 => true, 0x10530...0x10563 => true, 0x10570...0x1057a => true, 0x1057c...0x1058a => true, 0x1058c...0x10592 => true, 0x10594...0x10595 => true, 0x10597...0x105a1 => true, 0x105a3...0x105b1 => true, 0x105b3...0x105b9 => true, 0x105bb...0x105bc => true, 0x10600...0x10736 => true, 0x10740...0x10755 => true, 0x10760...0x10767 => true, 0x10780...0x10785 => true, 0x10787...0x107b0 => true, 0x107b2...0x107ba => true, 0x10800...0x10805 => true, 0x10808 => true, 0x1080a...0x10835 => true, 0x10837...0x10838 => true, 0x1083c => true, 0x1083f...0x10855 => true, 0x10860...0x10876 => true, 0x10880...0x1089e => true, 0x108e0...0x108f2 => true, 0x108f4...0x108f5 => true, 0x10900...0x10915 => true, 0x10920...0x10939 => true, 0x10980...0x109b7 => true, 0x109be...0x109bf => true, 0x10a00 => true, 0x10a10...0x10a13 => true, 0x10a15...0x10a17 => true, 0x10a19...0x10a35 => true, 0x10a60...0x10a7c => true, 0x10a80...0x10a9c => true, 0x10ac0...0x10ac7 => true, 0x10ac9...0x10ae4 => true, 0x10b00...0x10b35 => true, 0x10b40...0x10b55 => true, 0x10b60...0x10b72 => true, 0x10b80...0x10b91 => true, 0x10c00...0x10c48 => true, 0x10c80...0x10cb2 => true, 0x10cc0...0x10cf2 => true, 0x10d00...0x10d23 => true, 0x10e80...0x10ea9 => true, 0x10eb0...0x10eb1 => true, 0x10f00...0x10f1c => true, 0x10f27 => true, 0x10f30...0x10f45 => true, 0x10f70...0x10f81 => true, 0x10fb0...0x10fc4 => true, 0x10fe0...0x10ff6 => true, 0x11003...0x11037 => true, 0x11071...0x11072 => true, 0x11075 => true, 0x11083...0x110af => true, 0x110d0...0x110e8 => true, 0x11103...0x11126 => true, 0x11144 => true, 0x11147 => true, 0x11150...0x11172 => true, 0x11176 => true, 0x11183...0x111b2 => true, 0x111c1...0x111c4 => true, 0x111da => true, 0x111dc => true, 0x11200...0x11211 => true, 0x11213...0x1122b => true, 0x11280...0x11286 => true, 0x11288 => true, 0x1128a...0x1128d => true, 0x1128f...0x1129d => true, 0x1129f...0x112a8 => true, 0x112b0...0x112de => true, 0x11305...0x1130c => true, 0x1130f...0x11310 => true, 0x11313...0x11328 => true, 0x1132a...0x11330 => true, 0x11332...0x11333 => true, 0x11335...0x11339 => true, 0x1133d => true, 0x11350 => true, 0x1135d...0x11361 => true, 0x11400...0x11434 => true, 0x11447...0x1144a => true, 0x1145f...0x11461 => true, 0x11480...0x114af => true, 0x114c4...0x114c5 => true, 0x114c7 => true, 0x11580...0x115ae => true, 0x115d8...0x115db => true, 0x11600...0x1162f => true, 0x11644 => true, 0x11680...0x116aa => true, 0x116b8 => true, 0x11700...0x1171a => true, 0x11740...0x11746 => true, 0x11800...0x1182b => true, 0x118a0...0x118df => true, 0x118ff...0x11906 => true, 0x11909 => true, 0x1190c...0x11913 => true, 0x11915...0x11916 => true, 0x11918...0x1192f => true, 0x1193f => true, 0x11941 => true, 0x119a0...0x119a7 => true, 0x119aa...0x119d0 => true, 0x119e1 => true, 0x119e3 => true, 0x11a00 => true, 0x11a0b...0x11a32 => true, 0x11a3a => true, 0x11a50 => true, 0x11a5c...0x11a89 => true, 0x11a9d => true, 0x11ab0...0x11af8 => true, 0x11c00...0x11c08 => true, 0x11c0a...0x11c2e => true, 0x11c40 => true, 0x11c72...0x11c8f => true, 0x11d00...0x11d06 => true, 0x11d08...0x11d09 => true, 0x11d0b...0x11d30 => true, 0x11d46 => true, 0x11d60...0x11d65 => true, 0x11d67...0x11d68 => true, 0x11d6a...0x11d89 => true, 0x11d98 => true, 0x11ee0...0x11ef2 => true, 0x11fb0 => true, 0x12000...0x12399 => true, 0x12400...0x1246e => true, 0x12480...0x12543 => true, 0x12f90...0x12ff0 => true, 0x13000...0x1342e => true, 0x14400...0x14646 => true, 0x16800...0x16a38 => true, 0x16a40...0x16a5e => true, 0x16a70...0x16abe => true, 0x16ad0...0x16aed => true, 0x16b00...0x16b2f => true, 0x16b40...0x16b43 => true, 0x16b63...0x16b77 => true, 0x16b7d...0x16b8f => true, 0x16e40...0x16e7f => true, 0x16f00...0x16f4a => true, 0x16f50 => true, 0x16f93...0x16f9f => true, 0x16fe0...0x16fe1 => true, 0x16fe3 => true, 0x17000...0x187f7 => true, 0x18800...0x18cd5 => true, 0x18d00...0x18d08 => true, 0x1aff0...0x1aff3 => true, 0x1aff5...0x1affb => true, 0x1affd...0x1affe => true, 0x1b000...0x1b122 => true, 0x1b150...0x1b152 => true, 0x1b164...0x1b167 => true, 0x1b170...0x1b2fb => true, 0x1bc00...0x1bc6a => true, 0x1bc70...0x1bc7c => true, 0x1bc80...0x1bc88 => true, 0x1bc90...0x1bc99 => true, 0x1d400...0x1d454 => true, 0x1d456...0x1d49c => true, 0x1d49e...0x1d49f => true, 0x1d4a2 => true, 0x1d4a5...0x1d4a6 => true, 0x1d4a9...0x1d4ac => true, 0x1d4ae...0x1d4b9 => true, 0x1d4bb => true, 0x1d4bd...0x1d4c3 => true, 0x1d4c5...0x1d505 => true, 0x1d507...0x1d50a => true, 0x1d50d...0x1d514 => true, 0x1d516...0x1d51c => true, 0x1d51e...0x1d539 => true, 0x1d53b...0x1d53e => true, 0x1d540...0x1d544 => true, 0x1d546 => true, 0x1d54a...0x1d550 => true, 0x1d552...0x1d6a5 => true, 0x1d6a8...0x1d6c0 => true, 0x1d6c2...0x1d6da => true, 0x1d6dc...0x1d6fa => true, 0x1d6fc...0x1d714 => true, 0x1d716...0x1d734 => true, 0x1d736...0x1d74e => true, 0x1d750...0x1d76e => true, 0x1d770...0x1d788 => true, 0x1d78a...0x1d7a8 => true, 0x1d7aa...0x1d7c2 => true, 0x1d7c4...0x1d7cb => true, 0x1df00...0x1df09 => true, 0x1df0a => true, 0x1df0b...0x1df1e => true, 0x1e100...0x1e12c => true, 0x1e137...0x1e13d => true, 0x1e14e => true, 0x1e290...0x1e2ad => true, 0x1e2c0...0x1e2eb => true, 0x1e7e0...0x1e7e6 => true, 0x1e7e8...0x1e7eb => true, 0x1e7ed...0x1e7ee => true, 0x1e7f0...0x1e7fe => true, 0x1e800...0x1e8c4 => true, 0x1e900...0x1e943 => true, 0x1e94b => true, 0x1ee00...0x1ee03 => true, 0x1ee05...0x1ee1f => true, 0x1ee21...0x1ee22 => true, 0x1ee24 => true, 0x1ee27 => true, 0x1ee29...0x1ee32 => true, 0x1ee34...0x1ee37 => true, 0x1ee39 => true, 0x1ee3b => true, 0x1ee42 => true, 0x1ee47 => true, 0x1ee49 => true, 0x1ee4b => true, 0x1ee4d...0x1ee4f => true, 0x1ee51...0x1ee52 => true, 0x1ee54 => true, 0x1ee57 => true, 0x1ee59 => true, 0x1ee5b => true, 0x1ee5d => true, 0x1ee5f => true, 0x1ee61...0x1ee62 => true, 0x1ee64 => true, 0x1ee67...0x1ee6a => true, 0x1ee6c...0x1ee72 => true, 0x1ee74...0x1ee77 => true, 0x1ee79...0x1ee7c => true, 0x1ee7e => true, 0x1ee80...0x1ee89 => true, 0x1ee8b...0x1ee9b => true, 0x1eea1...0x1eea3 => true, 0x1eea5...0x1eea9 => true, 0x1eeab...0x1eebb => true, 0x20000...0x2a6df => true, 0x2a700...0x2b738 => true, 0x2b740...0x2b81d => true, 0x2b820...0x2cea1 => true, 0x2ceb0...0x2ebe0 => true, 0x2f800...0x2fa1d => true, 0x30000...0x3134a => true, else => false, }; } pub fn isXidContinue(cp: u21) bool { if (cp < 0x30 or cp > 0xe01ef) return false; return switch (cp) { 0x30...0x39 => true, 0x41...0x5a => true, 0x5f => true, 0x61...0x7a => true, 0xaa => true, 0xb5 => true, 0xb7 => true, 0xba => true, 0xc0...0xd6 => true, 0xd8...0xf6 => true, 0xf8...0x1ba => true, 0x1bb => true, 0x1bc...0x1bf => true, 0x1c0...0x1c3 => true, 0x1c4...0x293 => true, 0x294 => true, 0x295...0x2af => true, 0x2b0...0x2c1 => true, 0x2c6...0x2d1 => true, 0x2e0...0x2e4 => true, 0x2ec => true, 0x2ee => true, 0x300...0x36f => true, 0x370...0x373 => true, 0x374 => true, 0x376...0x377 => true, 0x37b...0x37d => true, 0x37f => true, 0x386 => true, 0x387 => true, 0x388...0x38a => true, 0x38c => true, 0x38e...0x3a1 => true, 0x3a3...0x3f5 => true, 0x3f7...0x481 => true, 0x483...0x487 => true, 0x48a...0x52f => true, 0x531...0x556 => true, 0x559 => true, 0x560...0x588 => true, 0x591...0x5bd => true, 0x5bf => true, 0x5c1...0x5c2 => true, 0x5c4...0x5c5 => true, 0x5c7 => true, 0x5d0...0x5ea => true, 0x5ef...0x5f2 => true, 0x610...0x61a => true, 0x620...0x63f => true, 0x640 => true, 0x641...0x64a => true, 0x64b...0x65f => true, 0x660...0x669 => true, 0x66e...0x66f => true, 0x670 => true, 0x671...0x6d3 => true, 0x6d5 => true, 0x6d6...0x6dc => true, 0x6df...0x6e4 => true, 0x6e5...0x6e6 => true, 0x6e7...0x6e8 => true, 0x6ea...0x6ed => true, 0x6ee...0x6ef => true, 0x6f0...0x6f9 => true, 0x6fa...0x6fc => true, 0x6ff => true, 0x710 => true, 0x711 => true, 0x712...0x72f => true, 0x730...0x74a => true, 0x74d...0x7a5 => true, 0x7a6...0x7b0 => true, 0x7b1 => true, 0x7c0...0x7c9 => true, 0x7ca...0x7ea => true, 0x7eb...0x7f3 => true, 0x7f4...0x7f5 => true, 0x7fa => true, 0x7fd => true, 0x800...0x815 => true, 0x816...0x819 => true, 0x81a => true, 0x81b...0x823 => true, 0x824 => true, 0x825...0x827 => true, 0x828 => true, 0x829...0x82d => true, 0x840...0x858 => true, 0x859...0x85b => true, 0x860...0x86a => true, 0x870...0x887 => true, 0x889...0x88e => true, 0x898...0x89f => true, 0x8a0...0x8c8 => true, 0x8c9 => true, 0x8ca...0x8e1 => true, 0x8e3...0x902 => true, 0x903 => true, 0x904...0x939 => true, 0x93a => true, 0x93b => true, 0x93c => true, 0x93d => true, 0x93e...0x940 => true, 0x941...0x948 => true, 0x949...0x94c => true, 0x94d => true, 0x94e...0x94f => true, 0x950 => true, 0x951...0x957 => true, 0x958...0x961 => true, 0x962...0x963 => true, 0x966...0x96f => true, 0x971 => true, 0x972...0x980 => true, 0x981 => true, 0x982...0x983 => true, 0x985...0x98c => true, 0x98f...0x990 => true, 0x993...0x9a8 => true, 0x9aa...0x9b0 => true, 0x9b2 => true, 0x9b6...0x9b9 => true, 0x9bc => true, 0x9bd => true, 0x9be...0x9c0 => true, 0x9c1...0x9c4 => true, 0x9c7...0x9c8 => true, 0x9cb...0x9cc => true, 0x9cd => true, 0x9ce => true, 0x9d7 => true, 0x9dc...0x9dd => true, 0x9df...0x9e1 => true, 0x9e2...0x9e3 => true, 0x9e6...0x9ef => true, 0x9f0...0x9f1 => true, 0x9fc => true, 0x9fe => true, 0xa01...0xa02 => true, 0xa03 => true, 0xa05...0xa0a => true, 0xa0f...0xa10 => true, 0xa13...0xa28 => true, 0xa2a...0xa30 => true, 0xa32...0xa33 => true, 0xa35...0xa36 => true, 0xa38...0xa39 => true, 0xa3c => true, 0xa3e...0xa40 => true, 0xa41...0xa42 => true, 0xa47...0xa48 => true, 0xa4b...0xa4d => true, 0xa51 => true, 0xa59...0xa5c => true, 0xa5e => true, 0xa66...0xa6f => true, 0xa70...0xa71 => true, 0xa72...0xa74 => true, 0xa75 => true, 0xa81...0xa82 => true, 0xa83 => true, 0xa85...0xa8d => true, 0xa8f...0xa91 => true, 0xa93...0xaa8 => true, 0xaaa...0xab0 => true, 0xab2...0xab3 => true, 0xab5...0xab9 => true, 0xabc => true, 0xabd => true, 0xabe...0xac0 => true, 0xac1...0xac5 => true, 0xac7...0xac8 => true, 0xac9 => true, 0xacb...0xacc => true, 0xacd => true, 0xad0 => true, 0xae0...0xae1 => true, 0xae2...0xae3 => true, 0xae6...0xaef => true, 0xaf9 => true, 0xafa...0xaff => true, 0xb01 => true, 0xb02...0xb03 => true, 0xb05...0xb0c => true, 0xb0f...0xb10 => true, 0xb13...0xb28 => true, 0xb2a...0xb30 => true, 0xb32...0xb33 => true, 0xb35...0xb39 => true, 0xb3c => true, 0xb3d => true, 0xb3e => true, 0xb3f => true, 0xb40 => true, 0xb41...0xb44 => true, 0xb47...0xb48 => true, 0xb4b...0xb4c => true, 0xb4d => true, 0xb55...0xb56 => true, 0xb57 => true, 0xb5c...0xb5d => true, 0xb5f...0xb61 => true, 0xb62...0xb63 => true, 0xb66...0xb6f => true, 0xb71 => true, 0xb82 => true, 0xb83 => true, 0xb85...0xb8a => true, 0xb8e...0xb90 => true, 0xb92...0xb95 => true, 0xb99...0xb9a => true, 0xb9c => true, 0xb9e...0xb9f => true, 0xba3...0xba4 => true, 0xba8...0xbaa => true, 0xbae...0xbb9 => true, 0xbbe...0xbbf => true, 0xbc0 => true, 0xbc1...0xbc2 => true, 0xbc6...0xbc8 => true, 0xbca...0xbcc => true, 0xbcd => true, 0xbd0 => true, 0xbd7 => true, 0xbe6...0xbef => true, 0xc00 => true, 0xc01...0xc03 => true, 0xc04 => true, 0xc05...0xc0c => true, 0xc0e...0xc10 => true, 0xc12...0xc28 => true, 0xc2a...0xc39 => true, 0xc3c => true, 0xc3d => true, 0xc3e...0xc40 => true, 0xc41...0xc44 => true, 0xc46...0xc48 => true, 0xc4a...0xc4d => true, 0xc55...0xc56 => true, 0xc58...0xc5a => true, 0xc5d => true, 0xc60...0xc61 => true, 0xc62...0xc63 => true, 0xc66...0xc6f => true, 0xc80 => true, 0xc81 => true, 0xc82...0xc83 => true, 0xc85...0xc8c => true, 0xc8e...0xc90 => true, 0xc92...0xca8 => true, 0xcaa...0xcb3 => true, 0xcb5...0xcb9 => true, 0xcbc => true, 0xcbd => true, 0xcbe => true, 0xcbf => true, 0xcc0...0xcc4 => true, 0xcc6 => true, 0xcc7...0xcc8 => true, 0xcca...0xccb => true, 0xccc...0xccd => true, 0xcd5...0xcd6 => true, 0xcdd...0xcde => true, 0xce0...0xce1 => true, 0xce2...0xce3 => true, 0xce6...0xcef => true, 0xcf1...0xcf2 => true, 0xd00...0xd01 => true, 0xd02...0xd03 => true, 0xd04...0xd0c => true, 0xd0e...0xd10 => true, 0xd12...0xd3a => true, 0xd3b...0xd3c => true, 0xd3d => true, 0xd3e...0xd40 => true, 0xd41...0xd44 => true, 0xd46...0xd48 => true, 0xd4a...0xd4c => true, 0xd4d => true, 0xd4e => true, 0xd54...0xd56 => true, 0xd57 => true, 0xd5f...0xd61 => true, 0xd62...0xd63 => true, 0xd66...0xd6f => true, 0xd7a...0xd7f => true, 0xd81 => true, 0xd82...0xd83 => true, 0xd85...0xd96 => true, 0xd9a...0xdb1 => true, 0xdb3...0xdbb => true, 0xdbd => true, 0xdc0...0xdc6 => true, 0xdca => true, 0xdcf...0xdd1 => true, 0xdd2...0xdd4 => true, 0xdd6 => true, 0xdd8...0xddf => true, 0xde6...0xdef => true, 0xdf2...0xdf3 => true, 0xe01...0xe30 => true, 0xe31 => true, 0xe32...0xe33 => true, 0xe34...0xe3a => true, 0xe40...0xe45 => true, 0xe46 => true, 0xe47...0xe4e => true, 0xe50...0xe59 => true, 0xe81...0xe82 => true, 0xe84 => true, 0xe86...0xe8a => true, 0xe8c...0xea3 => true, 0xea5 => true, 0xea7...0xeb0 => true, 0xeb1 => true, 0xeb2...0xeb3 => true, 0xeb4...0xebc => true, 0xebd => true, 0xec0...0xec4 => true, 0xec6 => true, 0xec8...0xecd => true, 0xed0...0xed9 => true, 0xedc...0xedf => true, 0xf00 => true, 0xf18...0xf19 => true, 0xf20...0xf29 => true, 0xf35 => true, 0xf37 => true, 0xf39 => true, 0xf3e...0xf3f => true, 0xf40...0xf47 => true, 0xf49...0xf6c => true, 0xf71...0xf7e => true, 0xf7f => true, 0xf80...0xf84 => true, 0xf86...0xf87 => true, 0xf88...0xf8c => true, 0xf8d...0xf97 => true, 0xf99...0xfbc => true, 0xfc6 => true, 0x1000...0x102a => true, 0x102b...0x102c => true, 0x102d...0x1030 => true, 0x1031 => true, 0x1032...0x1037 => true, 0x1038 => true, 0x1039...0x103a => true, 0x103b...0x103c => true, 0x103d...0x103e => true, 0x103f => true, 0x1040...0x1049 => true, 0x1050...0x1055 => true, 0x1056...0x1057 => true, 0x1058...0x1059 => true, 0x105a...0x105d => true, 0x105e...0x1060 => true, 0x1061 => true, 0x1062...0x1064 => true, 0x1065...0x1066 => true, 0x1067...0x106d => true, 0x106e...0x1070 => true, 0x1071...0x1074 => true, 0x1075...0x1081 => true, 0x1082 => true, 0x1083...0x1084 => true, 0x1085...0x1086 => true, 0x1087...0x108c => true, 0x108d => true, 0x108e => true, 0x108f => true, 0x1090...0x1099 => true, 0x109a...0x109c => true, 0x109d => true, 0x10a0...0x10c5 => true, 0x10c7 => true, 0x10cd => true, 0x10d0...0x10fa => true, 0x10fc => true, 0x10fd...0x10ff => true, 0x1100...0x1248 => true, 0x124a...0x124d => true, 0x1250...0x1256 => true, 0x1258 => true, 0x125a...0x125d => true, 0x1260...0x1288 => true, 0x128a...0x128d => true, 0x1290...0x12b0 => true, 0x12b2...0x12b5 => true, 0x12b8...0x12be => true, 0x12c0 => true, 0x12c2...0x12c5 => true, 0x12c8...0x12d6 => true, 0x12d8...0x1310 => true, 0x1312...0x1315 => true, 0x1318...0x135a => true, 0x135d...0x135f => true, 0x1369...0x1371 => true, 0x1380...0x138f => true, 0x13a0...0x13f5 => true, 0x13f8...0x13fd => true, 0x1401...0x166c => true, 0x166f...0x167f => true, 0x1681...0x169a => true, 0x16a0...0x16ea => true, 0x16ee...0x16f0 => true, 0x16f1...0x16f8 => true, 0x1700...0x1711 => true, 0x1712...0x1714 => true, 0x1715 => true, 0x171f...0x1731 => true, 0x1732...0x1733 => true, 0x1734 => true, 0x1740...0x1751 => true, 0x1752...0x1753 => true, 0x1760...0x176c => true, 0x176e...0x1770 => true, 0x1772...0x1773 => true, 0x1780...0x17b3 => true, 0x17b4...0x17b5 => true, 0x17b6 => true, 0x17b7...0x17bd => true, 0x17be...0x17c5 => true, 0x17c6 => true, 0x17c7...0x17c8 => true, 0x17c9...0x17d3 => true, 0x17d7 => true, 0x17dc => true, 0x17dd => true, 0x17e0...0x17e9 => true, 0x180b...0x180d => true, 0x180f => true, 0x1810...0x1819 => true, 0x1820...0x1842 => true, 0x1843 => true, 0x1844...0x1878 => true, 0x1880...0x1884 => true, 0x1885...0x1886 => true, 0x1887...0x18a8 => true, 0x18a9 => true, 0x18aa => true, 0x18b0...0x18f5 => true, 0x1900...0x191e => true, 0x1920...0x1922 => true, 0x1923...0x1926 => true, 0x1927...0x1928 => true, 0x1929...0x192b => true, 0x1930...0x1931 => true, 0x1932 => true, 0x1933...0x1938 => true, 0x1939...0x193b => true, 0x1946...0x194f => true, 0x1950...0x196d => true, 0x1970...0x1974 => true, 0x1980...0x19ab => true, 0x19b0...0x19c9 => true, 0x19d0...0x19d9 => true, 0x19da => true, 0x1a00...0x1a16 => true, 0x1a17...0x1a18 => true, 0x1a19...0x1a1a => true, 0x1a1b => true, 0x1a20...0x1a54 => true, 0x1a55 => true, 0x1a56 => true, 0x1a57 => true, 0x1a58...0x1a5e => true, 0x1a60 => true, 0x1a61 => true, 0x1a62 => true, 0x1a63...0x1a64 => true, 0x1a65...0x1a6c => true, 0x1a6d...0x1a72 => true, 0x1a73...0x1a7c => true, 0x1a7f => true, 0x1a80...0x1a89 => true, 0x1a90...0x1a99 => true, 0x1aa7 => true, 0x1ab0...0x1abd => true, 0x1abf...0x1ace => true, 0x1b00...0x1b03 => true, 0x1b04 => true, 0x1b05...0x1b33 => true, 0x1b34 => true, 0x1b35 => true, 0x1b36...0x1b3a => true, 0x1b3b => true, 0x1b3c => true, 0x1b3d...0x1b41 => true, 0x1b42 => true, 0x1b43...0x1b44 => true, 0x1b45...0x1b4c => true, 0x1b50...0x1b59 => true, 0x1b6b...0x1b73 => true, 0x1b80...0x1b81 => true, 0x1b82 => true, 0x1b83...0x1ba0 => true, 0x1ba1 => true, 0x1ba2...0x1ba5 => true, 0x1ba6...0x1ba7 => true, 0x1ba8...0x1ba9 => true, 0x1baa => true, 0x1bab...0x1bad => true, 0x1bae...0x1baf => true, 0x1bb0...0x1bb9 => true, 0x1bba...0x1be5 => true, 0x1be6 => true, 0x1be7 => true, 0x1be8...0x1be9 => true, 0x1bea...0x1bec => true, 0x1bed => true, 0x1bee => true, 0x1bef...0x1bf1 => true, 0x1bf2...0x1bf3 => true, 0x1c00...0x1c23 => true, 0x1c24...0x1c2b => true, 0x1c2c...0x1c33 => true, 0x1c34...0x1c35 => true, 0x1c36...0x1c37 => true, 0x1c40...0x1c49 => true, 0x1c4d...0x1c4f => true, 0x1c50...0x1c59 => true, 0x1c5a...0x1c77 => true, 0x1c78...0x1c7d => true, 0x1c80...0x1c88 => true, 0x1c90...0x1cba => true, 0x1cbd...0x1cbf => true, 0x1cd0...0x1cd2 => true, 0x1cd4...0x1ce0 => true, 0x1ce1 => true, 0x1ce2...0x1ce8 => true, 0x1ce9...0x1cec => true, 0x1ced => true, 0x1cee...0x1cf3 => true, 0x1cf4 => true, 0x1cf5...0x1cf6 => true, 0x1cf7 => true, 0x1cf8...0x1cf9 => true, 0x1cfa => true, 0x1d00...0x1d2b => true, 0x1d2c...0x1d6a => true, 0x1d6b...0x1d77 => true, 0x1d78 => true, 0x1d79...0x1d9a => true, 0x1d9b...0x1dbf => true, 0x1dc0...0x1dff => true, 0x1e00...0x1f15 => true, 0x1f18...0x1f1d => true, 0x1f20...0x1f45 => true, 0x1f48...0x1f4d => true, 0x1f50...0x1f57 => true, 0x1f59 => true, 0x1f5b => true, 0x1f5d => true, 0x1f5f...0x1f7d => true, 0x1f80...0x1fb4 => true, 0x1fb6...0x1fbc => true, 0x1fbe => true, 0x1fc2...0x1fc4 => true, 0x1fc6...0x1fcc => true, 0x1fd0...0x1fd3 => true, 0x1fd6...0x1fdb => true, 0x1fe0...0x1fec => true, 0x1ff2...0x1ff4 => true, 0x1ff6...0x1ffc => true, 0x203f...0x2040 => true, 0x2054 => true, 0x2071 => true, 0x207f => true, 0x2090...0x209c => true, 0x20d0...0x20dc => true, 0x20e1 => true, 0x20e5...0x20f0 => true, 0x2102 => true, 0x2107 => true, 0x210a...0x2113 => true, 0x2115 => true, 0x2118 => true, 0x2119...0x211d => true, 0x2124 => true, 0x2126 => true, 0x2128 => true, 0x212a...0x212d => true, 0x212e => true, 0x212f...0x2134 => true, 0x2135...0x2138 => true, 0x2139 => true, 0x213c...0x213f => true, 0x2145...0x2149 => true, 0x214e => true, 0x2160...0x2182 => true, 0x2183...0x2184 => true, 0x2185...0x2188 => true, 0x2c00...0x2c7b => true, 0x2c7c...0x2c7d => true, 0x2c7e...0x2ce4 => true, 0x2ceb...0x2cee => true, 0x2cef...0x2cf1 => true, 0x2cf2...0x2cf3 => true, 0x2d00...0x2d25 => true, 0x2d27 => true, 0x2d2d => true, 0x2d30...0x2d67 => true, 0x2d6f => true, 0x2d7f => true, 0x2d80...0x2d96 => true, 0x2da0...0x2da6 => true, 0x2da8...0x2dae => true, 0x2db0...0x2db6 => true, 0x2db8...0x2dbe => true, 0x2dc0...0x2dc6 => true, 0x2dc8...0x2dce => true, 0x2dd0...0x2dd6 => true, 0x2dd8...0x2dde => true, 0x2de0...0x2dff => true, 0x3005 => true, 0x3006 => true, 0x3007 => true, 0x3021...0x3029 => true, 0x302a...0x302d => true, 0x302e...0x302f => true, 0x3031...0x3035 => true, 0x3038...0x303a => true, 0x303b => true, 0x303c => true, 0x3041...0x3096 => true, 0x3099...0x309a => true, 0x309d...0x309e => true, 0x309f => true, 0x30a1...0x30fa => true, 0x30fc...0x30fe => true, 0x30ff => true, 0x3105...0x312f => true, 0x3131...0x318e => true, 0x31a0...0x31bf => true, 0x31f0...0x31ff => true, 0x3400...0x4dbf => true, 0x4e00...0xa014 => true, 0xa015 => true, 0xa016...0xa48c => true, 0xa4d0...0xa4f7 => true, 0xa4f8...0xa4fd => true, 0xa500...0xa60b => true, 0xa60c => true, 0xa610...0xa61f => true, 0xa620...0xa629 => true, 0xa62a...0xa62b => true, 0xa640...0xa66d => true, 0xa66e => true, 0xa66f => true, 0xa674...0xa67d => true, 0xa67f => true, 0xa680...0xa69b => true, 0xa69c...0xa69d => true, 0xa69e...0xa69f => true, 0xa6a0...0xa6e5 => true, 0xa6e6...0xa6ef => true, 0xa6f0...0xa6f1 => true, 0xa717...0xa71f => true, 0xa722...0xa76f => true, 0xa770 => true, 0xa771...0xa787 => true, 0xa788 => true, 0xa78b...0xa78e => true, 0xa78f => true, 0xa790...0xa7ca => true, 0xa7d0...0xa7d1 => true, 0xa7d3 => true, 0xa7d5...0xa7d9 => true, 0xa7f2...0xa7f4 => true, 0xa7f5...0xa7f6 => true, 0xa7f7 => true, 0xa7f8...0xa7f9 => true, 0xa7fa => true, 0xa7fb...0xa801 => true, 0xa802 => true, 0xa803...0xa805 => true, 0xa806 => true, 0xa807...0xa80a => true, 0xa80b => true, 0xa80c...0xa822 => true, 0xa823...0xa824 => true, 0xa825...0xa826 => true, 0xa827 => true, 0xa82c => true, 0xa840...0xa873 => true, 0xa880...0xa881 => true, 0xa882...0xa8b3 => true, 0xa8b4...0xa8c3 => true, 0xa8c4...0xa8c5 => true, 0xa8d0...0xa8d9 => true, 0xa8e0...0xa8f1 => true, 0xa8f2...0xa8f7 => true, 0xa8fb => true, 0xa8fd...0xa8fe => true, 0xa8ff => true, 0xa900...0xa909 => true, 0xa90a...0xa925 => true, 0xa926...0xa92d => true, 0xa930...0xa946 => true, 0xa947...0xa951 => true, 0xa952...0xa953 => true, 0xa960...0xa97c => true, 0xa980...0xa982 => true, 0xa983 => true, 0xa984...0xa9b2 => true, 0xa9b3 => true, 0xa9b4...0xa9b5 => true, 0xa9b6...0xa9b9 => true, 0xa9ba...0xa9bb => true, 0xa9bc...0xa9bd => true, 0xa9be...0xa9c0 => true, 0xa9cf => true, 0xa9d0...0xa9d9 => true, 0xa9e0...0xa9e4 => true, 0xa9e5 => true, 0xa9e6 => true, 0xa9e7...0xa9ef => true, 0xa9f0...0xa9f9 => true, 0xa9fa...0xa9fe => true, 0xaa00...0xaa28 => true, 0xaa29...0xaa2e => true, 0xaa2f...0xaa30 => true, 0xaa31...0xaa32 => true, 0xaa33...0xaa34 => true, 0xaa35...0xaa36 => true, 0xaa40...0xaa42 => true, 0xaa43 => true, 0xaa44...0xaa4b => true, 0xaa4c => true, 0xaa4d => true, 0xaa50...0xaa59 => true, 0xaa60...0xaa6f => true, 0xaa70 => true, 0xaa71...0xaa76 => true, 0xaa7a => true, 0xaa7b => true, 0xaa7c => true, 0xaa7d => true, 0xaa7e...0xaaaf => true, 0xaab0 => true, 0xaab1 => true, 0xaab2...0xaab4 => true, 0xaab5...0xaab6 => true, 0xaab7...0xaab8 => true, 0xaab9...0xaabd => true, 0xaabe...0xaabf => true, 0xaac0 => true, 0xaac1 => true, 0xaac2 => true, 0xaadb...0xaadc => true, 0xaadd => true, 0xaae0...0xaaea => true, 0xaaeb => true, 0xaaec...0xaaed => true, 0xaaee...0xaaef => true, 0xaaf2 => true, 0xaaf3...0xaaf4 => true, 0xaaf5 => true, 0xaaf6 => true, 0xab01...0xab06 => true, 0xab09...0xab0e => true, 0xab11...0xab16 => true, 0xab20...0xab26 => true, 0xab28...0xab2e => true, 0xab30...0xab5a => true, 0xab5c...0xab5f => true, 0xab60...0xab68 => true, 0xab69 => true, 0xab70...0xabbf => true, 0xabc0...0xabe2 => true, 0xabe3...0xabe4 => true, 0xabe5 => true, 0xabe6...0xabe7 => true, 0xabe8 => true, 0xabe9...0xabea => true, 0xabec => true, 0xabed => true, 0xabf0...0xabf9 => true, 0xac00...0xd7a3 => true, 0xd7b0...0xd7c6 => true, 0xd7cb...0xd7fb => true, 0xf900...0xfa6d => true, 0xfa70...0xfad9 => true, 0xfb00...0xfb06 => true, 0xfb13...0xfb17 => true, 0xfb1d => true, 0xfb1e => true, 0xfb1f...0xfb28 => true, 0xfb2a...0xfb36 => true, 0xfb38...0xfb3c => true, 0xfb3e => true, 0xfb40...0xfb41 => true, 0xfb43...0xfb44 => true, 0xfb46...0xfbb1 => true, 0xfbd3...0xfc5d => true, 0xfc64...0xfd3d => true, 0xfd50...0xfd8f => true, 0xfd92...0xfdc7 => true, 0xfdf0...0xfdf9 => true, 0xfe00...0xfe0f => true, 0xfe20...0xfe2f => true, 0xfe33...0xfe34 => true, 0xfe4d...0xfe4f => true, 0xfe71 => true, 0xfe73 => true, 0xfe77 => true, 0xfe79 => true, 0xfe7b => true, 0xfe7d => true, 0xfe7f...0xfefc => true, 0xff10...0xff19 => true, 0xff21...0xff3a => true, 0xff3f => true, 0xff41...0xff5a => true, 0xff66...0xff6f => true, 0xff70 => true, 0xff71...0xff9d => true, 0xff9e...0xff9f => true, 0xffa0...0xffbe => true, 0xffc2...0xffc7 => true, 0xffca...0xffcf => true, 0xffd2...0xffd7 => true, 0xffda...0xffdc => true, 0x10000...0x1000b => true, 0x1000d...0x10026 => true, 0x10028...0x1003a => true, 0x1003c...0x1003d => true, 0x1003f...0x1004d => true, 0x10050...0x1005d => true, 0x10080...0x100fa => true, 0x10140...0x10174 => true, 0x101fd => true, 0x10280...0x1029c => true, 0x102a0...0x102d0 => true, 0x102e0 => true, 0x10300...0x1031f => true, 0x1032d...0x10340 => true, 0x10341 => true, 0x10342...0x10349 => true, 0x1034a => true, 0x10350...0x10375 => true, 0x10376...0x1037a => true, 0x10380...0x1039d => true, 0x103a0...0x103c3 => true, 0x103c8...0x103cf => true, 0x103d1...0x103d5 => true, 0x10400...0x1044f => true, 0x10450...0x1049d => true, 0x104a0...0x104a9 => true, 0x104b0...0x104d3 => true, 0x104d8...0x104fb => true, 0x10500...0x10527 => true, 0x10530...0x10563 => true, 0x10570...0x1057a => true, 0x1057c...0x1058a => true, 0x1058c...0x10592 => true, 0x10594...0x10595 => true, 0x10597...0x105a1 => true, 0x105a3...0x105b1 => true, 0x105b3...0x105b9 => true, 0x105bb...0x105bc => true, 0x10600...0x10736 => true, 0x10740...0x10755 => true, 0x10760...0x10767 => true, 0x10780...0x10785 => true, 0x10787...0x107b0 => true, 0x107b2...0x107ba => true, 0x10800...0x10805 => true, 0x10808 => true, 0x1080a...0x10835 => true, 0x10837...0x10838 => true, 0x1083c => true, 0x1083f...0x10855 => true, 0x10860...0x10876 => true, 0x10880...0x1089e => true, 0x108e0...0x108f2 => true, 0x108f4...0x108f5 => true, 0x10900...0x10915 => true, 0x10920...0x10939 => true, 0x10980...0x109b7 => true, 0x109be...0x109bf => true, 0x10a00 => true, 0x10a01...0x10a03 => true, 0x10a05...0x10a06 => true, 0x10a0c...0x10a0f => true, 0x10a10...0x10a13 => true, 0x10a15...0x10a17 => true, 0x10a19...0x10a35 => true, 0x10a38...0x10a3a => true, 0x10a3f => true, 0x10a60...0x10a7c => true, 0x10a80...0x10a9c => true, 0x10ac0...0x10ac7 => true, 0x10ac9...0x10ae4 => true, 0x10ae5...0x10ae6 => true, 0x10b00...0x10b35 => true, 0x10b40...0x10b55 => true, 0x10b60...0x10b72 => true, 0x10b80...0x10b91 => true, 0x10c00...0x10c48 => true, 0x10c80...0x10cb2 => true, 0x10cc0...0x10cf2 => true, 0x10d00...0x10d23 => true, 0x10d24...0x10d27 => true, 0x10d30...0x10d39 => true, 0x10e80...0x10ea9 => true, 0x10eab...0x10eac => true, 0x10eb0...0x10eb1 => true, 0x10f00...0x10f1c => true, 0x10f27 => true, 0x10f30...0x10f45 => true, 0x10f46...0x10f50 => true, 0x10f70...0x10f81 => true, 0x10f82...0x10f85 => true, 0x10fb0...0x10fc4 => true, 0x10fe0...0x10ff6 => true, 0x11000 => true, 0x11001 => true, 0x11002 => true, 0x11003...0x11037 => true, 0x11038...0x11046 => true, 0x11066...0x1106f => true, 0x11070 => true, 0x11071...0x11072 => true, 0x11073...0x11074 => true, 0x11075 => true, 0x1107f...0x11081 => true, 0x11082 => true, 0x11083...0x110af => true, 0x110b0...0x110b2 => true, 0x110b3...0x110b6 => true, 0x110b7...0x110b8 => true, 0x110b9...0x110ba => true, 0x110c2 => true, 0x110d0...0x110e8 => true, 0x110f0...0x110f9 => true, 0x11100...0x11102 => true, 0x11103...0x11126 => true, 0x11127...0x1112b => true, 0x1112c => true, 0x1112d...0x11134 => true, 0x11136...0x1113f => true, 0x11144 => true, 0x11145...0x11146 => true, 0x11147 => true, 0x11150...0x11172 => true, 0x11173 => true, 0x11176 => true, 0x11180...0x11181 => true, 0x11182 => true, 0x11183...0x111b2 => true, 0x111b3...0x111b5 => true, 0x111b6...0x111be => true, 0x111bf...0x111c0 => true, 0x111c1...0x111c4 => true, 0x111c9...0x111cc => true, 0x111ce => true, 0x111cf => true, 0x111d0...0x111d9 => true, 0x111da => true, 0x111dc => true, 0x11200...0x11211 => true, 0x11213...0x1122b => true, 0x1122c...0x1122e => true, 0x1122f...0x11231 => true, 0x11232...0x11233 => true, 0x11234 => true, 0x11235 => true, 0x11236...0x11237 => true, 0x1123e => true, 0x11280...0x11286 => true, 0x11288 => true, 0x1128a...0x1128d => true, 0x1128f...0x1129d => true, 0x1129f...0x112a8 => true, 0x112b0...0x112de => true, 0x112df => true, 0x112e0...0x112e2 => true, 0x112e3...0x112ea => true, 0x112f0...0x112f9 => true, 0x11300...0x11301 => true, 0x11302...0x11303 => true, 0x11305...0x1130c => true, 0x1130f...0x11310 => true, 0x11313...0x11328 => true, 0x1132a...0x11330 => true, 0x11332...0x11333 => true, 0x11335...0x11339 => true, 0x1133b...0x1133c => true, 0x1133d => true, 0x1133e...0x1133f => true, 0x11340 => true, 0x11341...0x11344 => true, 0x11347...0x11348 => true, 0x1134b...0x1134d => true, 0x11350 => true, 0x11357 => true, 0x1135d...0x11361 => true, 0x11362...0x11363 => true, 0x11366...0x1136c => true, 0x11370...0x11374 => true, 0x11400...0x11434 => true, 0x11435...0x11437 => true, 0x11438...0x1143f => true, 0x11440...0x11441 => true, 0x11442...0x11444 => true, 0x11445 => true, 0x11446 => true, 0x11447...0x1144a => true, 0x11450...0x11459 => true, 0x1145e => true, 0x1145f...0x11461 => true, 0x11480...0x114af => true, 0x114b0...0x114b2 => true, 0x114b3...0x114b8 => true, 0x114b9 => true, 0x114ba => true, 0x114bb...0x114be => true, 0x114bf...0x114c0 => true, 0x114c1 => true, 0x114c2...0x114c3 => true, 0x114c4...0x114c5 => true, 0x114c7 => true, 0x114d0...0x114d9 => true, 0x11580...0x115ae => true, 0x115af...0x115b1 => true, 0x115b2...0x115b5 => true, 0x115b8...0x115bb => true, 0x115bc...0x115bd => true, 0x115be => true, 0x115bf...0x115c0 => true, 0x115d8...0x115db => true, 0x115dc...0x115dd => true, 0x11600...0x1162f => true, 0x11630...0x11632 => true, 0x11633...0x1163a => true, 0x1163b...0x1163c => true, 0x1163d => true, 0x1163e => true, 0x1163f...0x11640 => true, 0x11644 => true, 0x11650...0x11659 => true, 0x11680...0x116aa => true, 0x116ab => true, 0x116ac => true, 0x116ad => true, 0x116ae...0x116af => true, 0x116b0...0x116b5 => true, 0x116b6 => true, 0x116b7 => true, 0x116b8 => true, 0x116c0...0x116c9 => true, 0x11700...0x1171a => true, 0x1171d...0x1171f => true, 0x11720...0x11721 => true, 0x11722...0x11725 => true, 0x11726 => true, 0x11727...0x1172b => true, 0x11730...0x11739 => true, 0x11740...0x11746 => true, 0x11800...0x1182b => true, 0x1182c...0x1182e => true, 0x1182f...0x11837 => true, 0x11838 => true, 0x11839...0x1183a => true, 0x118a0...0x118df => true, 0x118e0...0x118e9 => true, 0x118ff...0x11906 => true, 0x11909 => true, 0x1190c...0x11913 => true, 0x11915...0x11916 => true, 0x11918...0x1192f => true, 0x11930...0x11935 => true, 0x11937...0x11938 => true, 0x1193b...0x1193c => true, 0x1193d => true, 0x1193e => true, 0x1193f => true, 0x11940 => true, 0x11941 => true, 0x11942 => true, 0x11943 => true, 0x11950...0x11959 => true, 0x119a0...0x119a7 => true, 0x119aa...0x119d0 => true, 0x119d1...0x119d3 => true, 0x119d4...0x119d7 => true, 0x119da...0x119db => true, 0x119dc...0x119df => true, 0x119e0 => true, 0x119e1 => true, 0x119e3 => true, 0x119e4 => true, 0x11a00 => true, 0x11a01...0x11a0a => true, 0x11a0b...0x11a32 => true, 0x11a33...0x11a38 => true, 0x11a39 => true, 0x11a3a => true, 0x11a3b...0x11a3e => true, 0x11a47 => true, 0x11a50 => true, 0x11a51...0x11a56 => true, 0x11a57...0x11a58 => true, 0x11a59...0x11a5b => true, 0x11a5c...0x11a89 => true, 0x11a8a...0x11a96 => true, 0x11a97 => true, 0x11a98...0x11a99 => true, 0x11a9d => true, 0x11ab0...0x11af8 => true, 0x11c00...0x11c08 => true, 0x11c0a...0x11c2e => true, 0x11c2f => true, 0x11c30...0x11c36 => true, 0x11c38...0x11c3d => true, 0x11c3e => true, 0x11c3f => true, 0x11c40 => true, 0x11c50...0x11c59 => true, 0x11c72...0x11c8f => true, 0x11c92...0x11ca7 => true, 0x11ca9 => true, 0x11caa...0x11cb0 => true, 0x11cb1 => true, 0x11cb2...0x11cb3 => true, 0x11cb4 => true, 0x11cb5...0x11cb6 => true, 0x11d00...0x11d06 => true, 0x11d08...0x11d09 => true, 0x11d0b...0x11d30 => true, 0x11d31...0x11d36 => true, 0x11d3a => true, 0x11d3c...0x11d3d => true, 0x11d3f...0x11d45 => true, 0x11d46 => true, 0x11d47 => true, 0x11d50...0x11d59 => true, 0x11d60...0x11d65 => true, 0x11d67...0x11d68 => true, 0x11d6a...0x11d89 => true, 0x11d8a...0x11d8e => true, 0x11d90...0x11d91 => true, 0x11d93...0x11d94 => true, 0x11d95 => true, 0x11d96 => true, 0x11d97 => true, 0x11d98 => true, 0x11da0...0x11da9 => true, 0x11ee0...0x11ef2 => true, 0x11ef3...0x11ef4 => true, 0x11ef5...0x11ef6 => true, 0x11fb0 => true, 0x12000...0x12399 => true, 0x12400...0x1246e => true, 0x12480...0x12543 => true, 0x12f90...0x12ff0 => true, 0x13000...0x1342e => true, 0x14400...0x14646 => true, 0x16800...0x16a38 => true, 0x16a40...0x16a5e => true, 0x16a60...0x16a69 => true, 0x16a70...0x16abe => true, 0x16ac0...0x16ac9 => true, 0x16ad0...0x16aed => true, 0x16af0...0x16af4 => true, 0x16b00...0x16b2f => true, 0x16b30...0x16b36 => true, 0x16b40...0x16b43 => true, 0x16b50...0x16b59 => true, 0x16b63...0x16b77 => true, 0x16b7d...0x16b8f => true, 0x16e40...0x16e7f => true, 0x16f00...0x16f4a => true, 0x16f4f => true, 0x16f50 => true, 0x16f51...0x16f87 => true, 0x16f8f...0x16f92 => true, 0x16f93...0x16f9f => true, 0x16fe0...0x16fe1 => true, 0x16fe3 => true, 0x16fe4 => true, 0x16ff0...0x16ff1 => true, 0x17000...0x187f7 => true, 0x18800...0x18cd5 => true, 0x18d00...0x18d08 => true, 0x1aff0...0x1aff3 => true, 0x1aff5...0x1affb => true, 0x1affd...0x1affe => true, 0x1b000...0x1b122 => true, 0x1b150...0x1b152 => true, 0x1b164...0x1b167 => true, 0x1b170...0x1b2fb => true, 0x1bc00...0x1bc6a => true, 0x1bc70...0x1bc7c => true, 0x1bc80...0x1bc88 => true, 0x1bc90...0x1bc99 => true, 0x1bc9d...0x1bc9e => true, 0x1cf00...0x1cf2d => true, 0x1cf30...0x1cf46 => true, 0x1d165...0x1d166 => true, 0x1d167...0x1d169 => true, 0x1d16d...0x1d172 => true, 0x1d17b...0x1d182 => true, 0x1d185...0x1d18b => true, 0x1d1aa...0x1d1ad => true, 0x1d242...0x1d244 => true, 0x1d400...0x1d454 => true, 0x1d456...0x1d49c => true, 0x1d49e...0x1d49f => true, 0x1d4a2 => true, 0x1d4a5...0x1d4a6 => true, 0x1d4a9...0x1d4ac => true, 0x1d4ae...0x1d4b9 => true, 0x1d4bb => true, 0x1d4bd...0x1d4c3 => true, 0x1d4c5...0x1d505 => true, 0x1d507...0x1d50a => true, 0x1d50d...0x1d514 => true, 0x1d516...0x1d51c => true, 0x1d51e...0x1d539 => true, 0x1d53b...0x1d53e => true, 0x1d540...0x1d544 => true, 0x1d546 => true, 0x1d54a...0x1d550 => true, 0x1d552...0x1d6a5 => true, 0x1d6a8...0x1d6c0 => true, 0x1d6c2...0x1d6da => true, 0x1d6dc...0x1d6fa => true, 0x1d6fc...0x1d714 => true, 0x1d716...0x1d734 => true, 0x1d736...0x1d74e => true, 0x1d750...0x1d76e => true, 0x1d770...0x1d788 => true, 0x1d78a...0x1d7a8 => true, 0x1d7aa...0x1d7c2 => true, 0x1d7c4...0x1d7cb => true, 0x1d7ce...0x1d7ff => true, 0x1da00...0x1da36 => true, 0x1da3b...0x1da6c => true, 0x1da75 => true, 0x1da84 => true, 0x1da9b...0x1da9f => true, 0x1daa1...0x1daaf => true, 0x1df00...0x1df09 => true, 0x1df0a => true, 0x1df0b...0x1df1e => true, 0x1e000...0x1e006 => true, 0x1e008...0x1e018 => true, 0x1e01b...0x1e021 => true, 0x1e023...0x1e024 => true, 0x1e026...0x1e02a => true, 0x1e100...0x1e12c => true, 0x1e130...0x1e136 => true, 0x1e137...0x1e13d => true, 0x1e140...0x1e149 => true, 0x1e14e => true, 0x1e290...0x1e2ad => true, 0x1e2ae => true, 0x1e2c0...0x1e2eb => true, 0x1e2ec...0x1e2ef => true, 0x1e2f0...0x1e2f9 => true, 0x1e7e0...0x1e7e6 => true, 0x1e7e8...0x1e7eb => true, 0x1e7ed...0x1e7ee => true, 0x1e7f0...0x1e7fe => true, 0x1e800...0x1e8c4 => true, 0x1e8d0...0x1e8d6 => true, 0x1e900...0x1e943 => true, 0x1e944...0x1e94a => true, 0x1e94b => true, 0x1e950...0x1e959 => true, 0x1ee00...0x1ee03 => true, 0x1ee05...0x1ee1f => true, 0x1ee21...0x1ee22 => true, 0x1ee24 => true, 0x1ee27 => true, 0x1ee29...0x1ee32 => true, 0x1ee34...0x1ee37 => true, 0x1ee39 => true, 0x1ee3b => true, 0x1ee42 => true, 0x1ee47 => true, 0x1ee49 => true, 0x1ee4b => true, 0x1ee4d...0x1ee4f => true, 0x1ee51...0x1ee52 => true, 0x1ee54 => true, 0x1ee57 => true, 0x1ee59 => true, 0x1ee5b => true, 0x1ee5d => true, 0x1ee5f => true, 0x1ee61...0x1ee62 => true, 0x1ee64 => true, 0x1ee67...0x1ee6a => true, 0x1ee6c...0x1ee72 => true, 0x1ee74...0x1ee77 => true, 0x1ee79...0x1ee7c => true, 0x1ee7e => true, 0x1ee80...0x1ee89 => true, 0x1ee8b...0x1ee9b => true, 0x1eea1...0x1eea3 => true, 0x1eea5...0x1eea9 => true, 0x1eeab...0x1eebb => true, 0x1fbf0...0x1fbf9 => true, 0x20000...0x2a6df => true, 0x2a700...0x2b738 => true, 0x2b740...0x2b81d => true, 0x2b820...0x2cea1 => true, 0x2ceb0...0x2ebe0 => true, 0x2f800...0x2fa1d => true, 0x30000...0x3134a => true, 0xe0100...0xe01ef => true, else => false, }; } pub fn isDefaultIgnorableCodePoint(cp: u21) bool { if (cp < 0xad or cp > 0xe0fff) return false; return switch (cp) { 0xad => true, 0x34f => true, 0x61c => true, 0x115f...0x1160 => true, 0x17b4...0x17b5 => true, 0x180b...0x180d => true, 0x180e => true, 0x180f => true, 0x200b...0x200f => true, 0x202a...0x202e => true, 0x2060...0x2064 => true, 0x2065 => true, 0x2066...0x206f => true, 0x3164 => true, 0xfe00...0xfe0f => true, 0xfeff => true, 0xffa0 => true, 0xfff0...0xfff8 => true, 0x1bca0...0x1bca3 => true, 0x1d173...0x1d17a => true, 0xe0000 => true, 0xe0001 => true, 0xe0002...0xe001f => true, 0xe0020...0xe007f => true, 0xe0080...0xe00ff => true, 0xe0100...0xe01ef => true, 0xe01f0...0xe0fff => true, else => false, }; } pub fn isGraphemeExtend(cp: u21) bool { if (cp < 0x300 or cp > 0xe01ef) return false; return switch (cp) { 0x300...0x36f => true, 0x483...0x487 => true, 0x488...0x489 => true, 0x591...0x5bd => true, 0x5bf => true, 0x5c1...0x5c2 => true, 0x5c4...0x5c5 => true, 0x5c7 => true, 0x610...0x61a => true, 0x64b...0x65f => true, 0x670 => true, 0x6d6...0x6dc => true, 0x6df...0x6e4 => true, 0x6e7...0x6e8 => true, 0x6ea...0x6ed => true, 0x711 => true, 0x730...0x74a => true, 0x7a6...0x7b0 => true, 0x7eb...0x7f3 => true, 0x7fd => true, 0x816...0x819 => true, 0x81b...0x823 => true, 0x825...0x827 => true, 0x829...0x82d => true, 0x859...0x85b => true, 0x898...0x89f => true, 0x8ca...0x8e1 => true, 0x8e3...0x902 => true, 0x93a => true, 0x93c => true, 0x941...0x948 => true, 0x94d => true, 0x951...0x957 => true, 0x962...0x963 => true, 0x981 => true, 0x9bc => true, 0x9be => true, 0x9c1...0x9c4 => true, 0x9cd => true, 0x9d7 => true, 0x9e2...0x9e3 => true, 0x9fe => true, 0xa01...0xa02 => true, 0xa3c => true, 0xa41...0xa42 => true, 0xa47...0xa48 => true, 0xa4b...0xa4d => true, 0xa51 => true, 0xa70...0xa71 => true, 0xa75 => true, 0xa81...0xa82 => true, 0xabc => true, 0xac1...0xac5 => true, 0xac7...0xac8 => true, 0xacd => true, 0xae2...0xae3 => true, 0xafa...0xaff => true, 0xb01 => true, 0xb3c => true, 0xb3e => true, 0xb3f => true, 0xb41...0xb44 => true, 0xb4d => true, 0xb55...0xb56 => true, 0xb57 => true, 0xb62...0xb63 => true, 0xb82 => true, 0xbbe => true, 0xbc0 => true, 0xbcd => true, 0xbd7 => true, 0xc00 => true, 0xc04 => true, 0xc3c => true, 0xc3e...0xc40 => true, 0xc46...0xc48 => true, 0xc4a...0xc4d => true, 0xc55...0xc56 => true, 0xc62...0xc63 => true, 0xc81 => true, 0xcbc => true, 0xcbf => true, 0xcc2 => true, 0xcc6 => true, 0xccc...0xccd => true, 0xcd5...0xcd6 => true, 0xce2...0xce3 => true, 0xd00...0xd01 => true, 0xd3b...0xd3c => true, 0xd3e => true, 0xd41...0xd44 => true, 0xd4d => true, 0xd57 => true, 0xd62...0xd63 => true, 0xd81 => true, 0xdca => true, 0xdcf => true, 0xdd2...0xdd4 => true, 0xdd6 => true, 0xddf => true, 0xe31 => true, 0xe34...0xe3a => true, 0xe47...0xe4e => true, 0xeb1 => true, 0xeb4...0xebc => true, 0xec8...0xecd => true, 0xf18...0xf19 => true, 0xf35 => true, 0xf37 => true, 0xf39 => true, 0xf71...0xf7e => true, 0xf80...0xf84 => true, 0xf86...0xf87 => true, 0xf8d...0xf97 => true, 0xf99...0xfbc => true, 0xfc6 => true, 0x102d...0x1030 => true, 0x1032...0x1037 => true, 0x1039...0x103a => true, 0x103d...0x103e => true, 0x1058...0x1059 => true, 0x105e...0x1060 => true, 0x1071...0x1074 => true, 0x1082 => true, 0x1085...0x1086 => true, 0x108d => true, 0x109d => true, 0x135d...0x135f => true, 0x1712...0x1714 => true, 0x1732...0x1733 => true, 0x1752...0x1753 => true, 0x1772...0x1773 => true, 0x17b4...0x17b5 => true, 0x17b7...0x17bd => true, 0x17c6 => true, 0x17c9...0x17d3 => true, 0x17dd => true, 0x180b...0x180d => true, 0x180f => true, 0x1885...0x1886 => true, 0x18a9 => true, 0x1920...0x1922 => true, 0x1927...0x1928 => true, 0x1932 => true, 0x1939...0x193b => true, 0x1a17...0x1a18 => true, 0x1a1b => true, 0x1a56 => true, 0x1a58...0x1a5e => true, 0x1a60 => true, 0x1a62 => true, 0x1a65...0x1a6c => true, 0x1a73...0x1a7c => true, 0x1a7f => true, 0x1ab0...0x1abd => true, 0x1abe => true, 0x1abf...0x1ace => true, 0x1b00...0x1b03 => true, 0x1b34 => true, 0x1b35 => true, 0x1b36...0x1b3a => true, 0x1b3c => true, 0x1b42 => true, 0x1b6b...0x1b73 => true, 0x1b80...0x1b81 => true, 0x1ba2...0x1ba5 => true, 0x1ba8...0x1ba9 => true, 0x1bab...0x1bad => true, 0x1be6 => true, 0x1be8...0x1be9 => true, 0x1bed => true, 0x1bef...0x1bf1 => true, 0x1c2c...0x1c33 => true, 0x1c36...0x1c37 => true, 0x1cd0...0x1cd2 => true, 0x1cd4...0x1ce0 => true, 0x1ce2...0x1ce8 => true, 0x1ced => true, 0x1cf4 => true, 0x1cf8...0x1cf9 => true, 0x1dc0...0x1dff => true, 0x200c => true, 0x20d0...0x20dc => true, 0x20dd...0x20e0 => true, 0x20e1 => true, 0x20e2...0x20e4 => true, 0x20e5...0x20f0 => true, 0x2cef...0x2cf1 => true, 0x2d7f => true, 0x2de0...0x2dff => true, 0x302a...0x302d => true, 0x302e...0x302f => true, 0x3099...0x309a => true, 0xa66f => true, 0xa670...0xa672 => true, 0xa674...0xa67d => true, 0xa69e...0xa69f => true, 0xa6f0...0xa6f1 => true, 0xa802 => true, 0xa806 => true, 0xa80b => true, 0xa825...0xa826 => true, 0xa82c => true, 0xa8c4...0xa8c5 => true, 0xa8e0...0xa8f1 => true, 0xa8ff => true, 0xa926...0xa92d => true, 0xa947...0xa951 => true, 0xa980...0xa982 => true, 0xa9b3 => true, 0xa9b6...0xa9b9 => true, 0xa9bc...0xa9bd => true, 0xa9e5 => true, 0xaa29...0xaa2e => true, 0xaa31...0xaa32 => true, 0xaa35...0xaa36 => true, 0xaa43 => true, 0xaa4c => true, 0xaa7c => true, 0xaab0 => true, 0xaab2...0xaab4 => true, 0xaab7...0xaab8 => true, 0xaabe...0xaabf => true, 0xaac1 => true, 0xaaec...0xaaed => true, 0xaaf6 => true, 0xabe5 => true, 0xabe8 => true, 0xabed => true, 0xfb1e => true, 0xfe00...0xfe0f => true, 0xfe20...0xfe2f => true, 0xff9e...0xff9f => true, 0x101fd => true, 0x102e0 => true, 0x10376...0x1037a => true, 0x10a01...0x10a03 => true, 0x10a05...0x10a06 => true, 0x10a0c...0x10a0f => true, 0x10a38...0x10a3a => true, 0x10a3f => true, 0x10ae5...0x10ae6 => true, 0x10d24...0x10d27 => true, 0x10eab...0x10eac => true, 0x10f46...0x10f50 => true, 0x10f82...0x10f85 => true, 0x11001 => true, 0x11038...0x11046 => true, 0x11070 => true, 0x11073...0x11074 => true, 0x1107f...0x11081 => true, 0x110b3...0x110b6 => true, 0x110b9...0x110ba => true, 0x110c2 => true, 0x11100...0x11102 => true, 0x11127...0x1112b => true, 0x1112d...0x11134 => true, 0x11173 => true, 0x11180...0x11181 => true, 0x111b6...0x111be => true, 0x111c9...0x111cc => true, 0x111cf => true, 0x1122f...0x11231 => true, 0x11234 => true, 0x11236...0x11237 => true, 0x1123e => true, 0x112df => true, 0x112e3...0x112ea => true, 0x11300...0x11301 => true, 0x1133b...0x1133c => true, 0x1133e => true, 0x11340 => true, 0x11357 => true, 0x11366...0x1136c => true, 0x11370...0x11374 => true, 0x11438...0x1143f => true, 0x11442...0x11444 => true, 0x11446 => true, 0x1145e => true, 0x114b0 => true, 0x114b3...0x114b8 => true, 0x114ba => true, 0x114bd => true, 0x114bf...0x114c0 => true, 0x114c2...0x114c3 => true, 0x115af => true, 0x115b2...0x115b5 => true, 0x115bc...0x115bd => true, 0x115bf...0x115c0 => true, 0x115dc...0x115dd => true, 0x11633...0x1163a => true, 0x1163d => true, 0x1163f...0x11640 => true, 0x116ab => true, 0x116ad => true, 0x116b0...0x116b5 => true, 0x116b7 => true, 0x1171d...0x1171f => true, 0x11722...0x11725 => true, 0x11727...0x1172b => true, 0x1182f...0x11837 => true, 0x11839...0x1183a => true, 0x11930 => true, 0x1193b...0x1193c => true, 0x1193e => true, 0x11943 => true, 0x119d4...0x119d7 => true, 0x119da...0x119db => true, 0x119e0 => true, 0x11a01...0x11a0a => true, 0x11a33...0x11a38 => true, 0x11a3b...0x11a3e => true, 0x11a47 => true, 0x11a51...0x11a56 => true, 0x11a59...0x11a5b => true, 0x11a8a...0x11a96 => true, 0x11a98...0x11a99 => true, 0x11c30...0x11c36 => true, 0x11c38...0x11c3d => true, 0x11c3f => true, 0x11c92...0x11ca7 => true, 0x11caa...0x11cb0 => true, 0x11cb2...0x11cb3 => true, 0x11cb5...0x11cb6 => true, 0x11d31...0x11d36 => true, 0x11d3a => true, 0x11d3c...0x11d3d => true, 0x11d3f...0x11d45 => true, 0x11d47 => true, 0x11d90...0x11d91 => true, 0x11d95 => true, 0x11d97 => true, 0x11ef3...0x11ef4 => true, 0x16af0...0x16af4 => true, 0x16b30...0x16b36 => true, 0x16f4f => true, 0x16f8f...0x16f92 => true, 0x16fe4 => true, 0x1bc9d...0x1bc9e => true, 0x1cf00...0x1cf2d => true, 0x1cf30...0x1cf46 => true, 0x1d165 => true, 0x1d167...0x1d169 => true, 0x1d16e...0x1d172 => true, 0x1d17b...0x1d182 => true, 0x1d185...0x1d18b => true, 0x1d1aa...0x1d1ad => true, 0x1d242...0x1d244 => true, 0x1da00...0x1da36 => true, 0x1da3b...0x1da6c => true, 0x1da75 => true, 0x1da84 => true, 0x1da9b...0x1da9f => true, 0x1daa1...0x1daaf => true, 0x1e000...0x1e006 => true, 0x1e008...0x1e018 => true, 0x1e01b...0x1e021 => true, 0x1e023...0x1e024 => true, 0x1e026...0x1e02a => true, 0x1e130...0x1e136 => true, 0x1e2ae => true, 0x1e2ec...0x1e2ef => true, 0x1e8d0...0x1e8d6 => true, 0x1e944...0x1e94a => true, 0xe0020...0xe007f => true, 0xe0100...0xe01ef => true, else => false, }; } pub fn isGraphemeBase(cp: u21) bool { if (cp < 0x20 or cp > 0x3134a) return false; return switch (cp) { 0x20 => true, 0x21...0x23 => true, 0x24 => true, 0x25...0x27 => true, 0x28 => true, 0x29 => true, 0x2a => true, 0x2b => true, 0x2c => true, 0x2d => true, 0x2e...0x2f => true, 0x30...0x39 => true, 0x3a...0x3b => true, 0x3c...0x3e => true, 0x3f...0x40 => true, 0x41...0x5a => true, 0x5b => true, 0x5c => true, 0x5d => true, 0x5e => true, 0x5f => true, 0x60 => true, 0x61...0x7a => true, 0x7b => true, 0x7c => true, 0x7d => true, 0x7e => true, 0xa0 => true, 0xa1 => true, 0xa2...0xa5 => true, 0xa6 => true, 0xa7 => true, 0xa8 => true, 0xa9 => true, 0xaa => true, 0xab => true, 0xac => true, 0xae => true, 0xaf => true, 0xb0 => true, 0xb1 => true, 0xb2...0xb3 => true, 0xb4 => true, 0xb5 => true, 0xb6...0xb7 => true, 0xb8 => true, 0xb9 => true, 0xba => true, 0xbb => true, 0xbc...0xbe => true, 0xbf => true, 0xc0...0xd6 => true, 0xd7 => true, 0xd8...0xf6 => true, 0xf7 => true, 0xf8...0x1ba => true, 0x1bb => true, 0x1bc...0x1bf => true, 0x1c0...0x1c3 => true, 0x1c4...0x293 => true, 0x294 => true, 0x295...0x2af => true, 0x2b0...0x2c1 => true, 0x2c2...0x2c5 => true, 0x2c6...0x2d1 => true, 0x2d2...0x2df => true, 0x2e0...0x2e4 => true, 0x2e5...0x2eb => true, 0x2ec => true, 0x2ed => true, 0x2ee => true, 0x2ef...0x2ff => true, 0x370...0x373 => true, 0x374 => true, 0x375 => true, 0x376...0x377 => true, 0x37a => true, 0x37b...0x37d => true, 0x37e => true, 0x37f => true, 0x384...0x385 => true, 0x386 => true, 0x387 => true, 0x388...0x38a => true, 0x38c => true, 0x38e...0x3a1 => true, 0x3a3...0x3f5 => true, 0x3f6 => true, 0x3f7...0x481 => true, 0x482 => true, 0x48a...0x52f => true, 0x531...0x556 => true, 0x559 => true, 0x55a...0x55f => true, 0x560...0x588 => true, 0x589 => true, 0x58a => true, 0x58d...0x58e => true, 0x58f => true, 0x5be => true, 0x5c0 => true, 0x5c3 => true, 0x5c6 => true, 0x5d0...0x5ea => true, 0x5ef...0x5f2 => true, 0x5f3...0x5f4 => true, 0x606...0x608 => true, 0x609...0x60a => true, 0x60b => true, 0x60c...0x60d => true, 0x60e...0x60f => true, 0x61b => true, 0x61d...0x61f => true, 0x620...0x63f => true, 0x640 => true, 0x641...0x64a => true, 0x660...0x669 => true, 0x66a...0x66d => true, 0x66e...0x66f => true, 0x671...0x6d3 => true, 0x6d4 => true, 0x6d5 => true, 0x6de => true, 0x6e5...0x6e6 => true, 0x6e9 => true, 0x6ee...0x6ef => true, 0x6f0...0x6f9 => true, 0x6fa...0x6fc => true, 0x6fd...0x6fe => true, 0x6ff => true, 0x700...0x70d => true, 0x710 => true, 0x712...0x72f => true, 0x74d...0x7a5 => true, 0x7b1 => true, 0x7c0...0x7c9 => true, 0x7ca...0x7ea => true, 0x7f4...0x7f5 => true, 0x7f6 => true, 0x7f7...0x7f9 => true, 0x7fa => true, 0x7fe...0x7ff => true, 0x800...0x815 => true, 0x81a => true, 0x824 => true, 0x828 => true, 0x830...0x83e => true, 0x840...0x858 => true, 0x85e => true, 0x860...0x86a => true, 0x870...0x887 => true, 0x888 => true, 0x889...0x88e => true, 0x8a0...0x8c8 => true, 0x8c9 => true, 0x903 => true, 0x904...0x939 => true, 0x93b => true, 0x93d => true, 0x93e...0x940 => true, 0x949...0x94c => true, 0x94e...0x94f => true, 0x950 => true, 0x958...0x961 => true, 0x964...0x965 => true, 0x966...0x96f => true, 0x970 => true, 0x971 => true, 0x972...0x980 => true, 0x982...0x983 => true, 0x985...0x98c => true, 0x98f...0x990 => true, 0x993...0x9a8 => true, 0x9aa...0x9b0 => true, 0x9b2 => true, 0x9b6...0x9b9 => true, 0x9bd => true, 0x9bf...0x9c0 => true, 0x9c7...0x9c8 => true, 0x9cb...0x9cc => true, 0x9ce => true, 0x9dc...0x9dd => true, 0x9df...0x9e1 => true, 0x9e6...0x9ef => true, 0x9f0...0x9f1 => true, 0x9f2...0x9f3 => true, 0x9f4...0x9f9 => true, 0x9fa => true, 0x9fb => true, 0x9fc => true, 0x9fd => true, 0xa03 => true, 0xa05...0xa0a => true, 0xa0f...0xa10 => true, 0xa13...0xa28 => true, 0xa2a...0xa30 => true, 0xa32...0xa33 => true, 0xa35...0xa36 => true, 0xa38...0xa39 => true, 0xa3e...0xa40 => true, 0xa59...0xa5c => true, 0xa5e => true, 0xa66...0xa6f => true, 0xa72...0xa74 => true, 0xa76 => true, 0xa83 => true, 0xa85...0xa8d => true, 0xa8f...0xa91 => true, 0xa93...0xaa8 => true, 0xaaa...0xab0 => true, 0xab2...0xab3 => true, 0xab5...0xab9 => true, 0xabd => true, 0xabe...0xac0 => true, 0xac9 => true, 0xacb...0xacc => true, 0xad0 => true, 0xae0...0xae1 => true, 0xae6...0xaef => true, 0xaf0 => true, 0xaf1 => true, 0xaf9 => true, 0xb02...0xb03 => true, 0xb05...0xb0c => true, 0xb0f...0xb10 => true, 0xb13...0xb28 => true, 0xb2a...0xb30 => true, 0xb32...0xb33 => true, 0xb35...0xb39 => true, 0xb3d => true, 0xb40 => true, 0xb47...0xb48 => true, 0xb4b...0xb4c => true, 0xb5c...0xb5d => true, 0xb5f...0xb61 => true, 0xb66...0xb6f => true, 0xb70 => true, 0xb71 => true, 0xb72...0xb77 => true, 0xb83 => true, 0xb85...0xb8a => true, 0xb8e...0xb90 => true, 0xb92...0xb95 => true, 0xb99...0xb9a => true, 0xb9c => true, 0xb9e...0xb9f => true, 0xba3...0xba4 => true, 0xba8...0xbaa => true, 0xbae...0xbb9 => true, 0xbbf => true, 0xbc1...0xbc2 => true, 0xbc6...0xbc8 => true, 0xbca...0xbcc => true, 0xbd0 => true, 0xbe6...0xbef => true, 0xbf0...0xbf2 => true, 0xbf3...0xbf8 => true, 0xbf9 => true, 0xbfa => true, 0xc01...0xc03 => true, 0xc05...0xc0c => true, 0xc0e...0xc10 => true, 0xc12...0xc28 => true, 0xc2a...0xc39 => true, 0xc3d => true, 0xc41...0xc44 => true, 0xc58...0xc5a => true, 0xc5d => true, 0xc60...0xc61 => true, 0xc66...0xc6f => true, 0xc77 => true, 0xc78...0xc7e => true, 0xc7f => true, 0xc80 => true, 0xc82...0xc83 => true, 0xc84 => true, 0xc85...0xc8c => true, 0xc8e...0xc90 => true, 0xc92...0xca8 => true, 0xcaa...0xcb3 => true, 0xcb5...0xcb9 => true, 0xcbd => true, 0xcbe => true, 0xcc0...0xcc1 => true, 0xcc3...0xcc4 => true, 0xcc7...0xcc8 => true, 0xcca...0xccb => true, 0xcdd...0xcde => true, 0xce0...0xce1 => true, 0xce6...0xcef => true, 0xcf1...0xcf2 => true, 0xd02...0xd03 => true, 0xd04...0xd0c => true, 0xd0e...0xd10 => true, 0xd12...0xd3a => true, 0xd3d => true, 0xd3f...0xd40 => true, 0xd46...0xd48 => true, 0xd4a...0xd4c => true, 0xd4e => true, 0xd4f => true, 0xd54...0xd56 => true, 0xd58...0xd5e => true, 0xd5f...0xd61 => true, 0xd66...0xd6f => true, 0xd70...0xd78 => true, 0xd79 => true, 0xd7a...0xd7f => true, 0xd82...0xd83 => true, 0xd85...0xd96 => true, 0xd9a...0xdb1 => true, 0xdb3...0xdbb => true, 0xdbd => true, 0xdc0...0xdc6 => true, 0xdd0...0xdd1 => true, 0xdd8...0xdde => true, 0xde6...0xdef => true, 0xdf2...0xdf3 => true, 0xdf4 => true, 0xe01...0xe30 => true, 0xe32...0xe33 => true, 0xe3f => true, 0xe40...0xe45 => true, 0xe46 => true, 0xe4f => true, 0xe50...0xe59 => true, 0xe5a...0xe5b => true, 0xe81...0xe82 => true, 0xe84 => true, 0xe86...0xe8a => true, 0xe8c...0xea3 => true, 0xea5 => true, 0xea7...0xeb0 => true, 0xeb2...0xeb3 => true, 0xebd => true, 0xec0...0xec4 => true, 0xec6 => true, 0xed0...0xed9 => true, 0xedc...0xedf => true, 0xf00 => true, 0xf01...0xf03 => true, 0xf04...0xf12 => true, 0xf13 => true, 0xf14 => true, 0xf15...0xf17 => true, 0xf1a...0xf1f => true, 0xf20...0xf29 => true, 0xf2a...0xf33 => true, 0xf34 => true, 0xf36 => true, 0xf38 => true, 0xf3a => true, 0xf3b => true, 0xf3c => true, 0xf3d => true, 0xf3e...0xf3f => true, 0xf40...0xf47 => true, 0xf49...0xf6c => true, 0xf7f => true, 0xf85 => true, 0xf88...0xf8c => true, 0xfbe...0xfc5 => true, 0xfc7...0xfcc => true, 0xfce...0xfcf => true, 0xfd0...0xfd4 => true, 0xfd5...0xfd8 => true, 0xfd9...0xfda => true, 0x1000...0x102a => true, 0x102b...0x102c => true, 0x1031 => true, 0x1038 => true, 0x103b...0x103c => true, 0x103f => true, 0x1040...0x1049 => true, 0x104a...0x104f => true, 0x1050...0x1055 => true, 0x1056...0x1057 => true, 0x105a...0x105d => true, 0x1061 => true, 0x1062...0x1064 => true, 0x1065...0x1066 => true, 0x1067...0x106d => true, 0x106e...0x1070 => true, 0x1075...0x1081 => true, 0x1083...0x1084 => true, 0x1087...0x108c => true, 0x108e => true, 0x108f => true, 0x1090...0x1099 => true, 0x109a...0x109c => true, 0x109e...0x109f => true, 0x10a0...0x10c5 => true, 0x10c7 => true, 0x10cd => true, 0x10d0...0x10fa => true, 0x10fb => true, 0x10fc => true, 0x10fd...0x10ff => true, 0x1100...0x1248 => true, 0x124a...0x124d => true, 0x1250...0x1256 => true, 0x1258 => true, 0x125a...0x125d => true, 0x1260...0x1288 => true, 0x128a...0x128d => true, 0x1290...0x12b0 => true, 0x12b2...0x12b5 => true, 0x12b8...0x12be => true, 0x12c0 => true, 0x12c2...0x12c5 => true, 0x12c8...0x12d6 => true, 0x12d8...0x1310 => true, 0x1312...0x1315 => true, 0x1318...0x135a => true, 0x1360...0x1368 => true, 0x1369...0x137c => true, 0x1380...0x138f => true, 0x1390...0x1399 => true, 0x13a0...0x13f5 => true, 0x13f8...0x13fd => true, 0x1400 => true, 0x1401...0x166c => true, 0x166d => true, 0x166e => true, 0x166f...0x167f => true, 0x1680 => true, 0x1681...0x169a => true, 0x169b => true, 0x169c => true, 0x16a0...0x16ea => true, 0x16eb...0x16ed => true, 0x16ee...0x16f0 => true, 0x16f1...0x16f8 => true, 0x1700...0x1711 => true, 0x1715 => true, 0x171f...0x1731 => true, 0x1734 => true, 0x1735...0x1736 => true, 0x1740...0x1751 => true, 0x1760...0x176c => true, 0x176e...0x1770 => true, 0x1780...0x17b3 => true, 0x17b6 => true, 0x17be...0x17c5 => true, 0x17c7...0x17c8 => true, 0x17d4...0x17d6 => true, 0x17d7 => true, 0x17d8...0x17da => true, 0x17db => true, 0x17dc => true, 0x17e0...0x17e9 => true, 0x17f0...0x17f9 => true, 0x1800...0x1805 => true, 0x1806 => true, 0x1807...0x180a => true, 0x1810...0x1819 => true, 0x1820...0x1842 => true, 0x1843 => true, 0x1844...0x1878 => true, 0x1880...0x1884 => true, 0x1887...0x18a8 => true, 0x18aa => true, 0x18b0...0x18f5 => true, 0x1900...0x191e => true, 0x1923...0x1926 => true, 0x1929...0x192b => true, 0x1930...0x1931 => true, 0x1933...0x1938 => true, 0x1940 => true, 0x1944...0x1945 => true, 0x1946...0x194f => true, 0x1950...0x196d => true, 0x1970...0x1974 => true, 0x1980...0x19ab => true, 0x19b0...0x19c9 => true, 0x19d0...0x19d9 => true, 0x19da => true, 0x19de...0x19ff => true, 0x1a00...0x1a16 => true, 0x1a19...0x1a1a => true, 0x1a1e...0x1a1f => true, 0x1a20...0x1a54 => true, 0x1a55 => true, 0x1a57 => true, 0x1a61 => true, 0x1a63...0x1a64 => true, 0x1a6d...0x1a72 => true, 0x1a80...0x1a89 => true, 0x1a90...0x1a99 => true, 0x1aa0...0x1aa6 => true, 0x1aa7 => true, 0x1aa8...0x1aad => true, 0x1b04 => true, 0x1b05...0x1b33 => true, 0x1b3b => true, 0x1b3d...0x1b41 => true, 0x1b43...0x1b44 => true, 0x1b45...0x1b4c => true, 0x1b50...0x1b59 => true, 0x1b5a...0x1b60 => true, 0x1b61...0x1b6a => true, 0x1b74...0x1b7c => true, 0x1b7d...0x1b7e => true, 0x1b82 => true, 0x1b83...0x1ba0 => true, 0x1ba1 => true, 0x1ba6...0x1ba7 => true, 0x1baa => true, 0x1bae...0x1baf => true, 0x1bb0...0x1bb9 => true, 0x1bba...0x1be5 => true, 0x1be7 => true, 0x1bea...0x1bec => true, 0x1bee => true, 0x1bf2...0x1bf3 => true, 0x1bfc...0x1bff => true, 0x1c00...0x1c23 => true, 0x1c24...0x1c2b => true, 0x1c34...0x1c35 => true, 0x1c3b...0x1c3f => true, 0x1c40...0x1c49 => true, 0x1c4d...0x1c4f => true, 0x1c50...0x1c59 => true, 0x1c5a...0x1c77 => true, 0x1c78...0x1c7d => true, 0x1c7e...0x1c7f => true, 0x1c80...0x1c88 => true, 0x1c90...0x1cba => true, 0x1cbd...0x1cbf => true, 0x1cc0...0x1cc7 => true, 0x1cd3 => true, 0x1ce1 => true, 0x1ce9...0x1cec => true, 0x1cee...0x1cf3 => true, 0x1cf5...0x1cf6 => true, 0x1cf7 => true, 0x1cfa => true, 0x1d00...0x1d2b => true, 0x1d2c...0x1d6a => true, 0x1d6b...0x1d77 => true, 0x1d78 => true, 0x1d79...0x1d9a => true, 0x1d9b...0x1dbf => true, 0x1e00...0x1f15 => true, 0x1f18...0x1f1d => true, 0x1f20...0x1f45 => true, 0x1f48...0x1f4d => true, 0x1f50...0x1f57 => true, 0x1f59 => true, 0x1f5b => true, 0x1f5d => true, 0x1f5f...0x1f7d => true, 0x1f80...0x1fb4 => true, 0x1fb6...0x1fbc => true, 0x1fbd => true, 0x1fbe => true, 0x1fbf...0x1fc1 => true, 0x1fc2...0x1fc4 => true, 0x1fc6...0x1fcc => true, 0x1fcd...0x1fcf => true, 0x1fd0...0x1fd3 => true, 0x1fd6...0x1fdb => true, 0x1fdd...0x1fdf => true, 0x1fe0...0x1fec => true, 0x1fed...0x1fef => true, 0x1ff2...0x1ff4 => true, 0x1ff6...0x1ffc => true, 0x1ffd...0x1ffe => true, 0x2000...0x200a => true, 0x2010...0x2015 => true, 0x2016...0x2017 => true, 0x2018 => true, 0x2019 => true, 0x201a => true, 0x201b...0x201c => true, 0x201d => true, 0x201e => true, 0x201f => true, 0x2020...0x2027 => true, 0x202f => true, 0x2030...0x2038 => true, 0x2039 => true, 0x203a => true, 0x203b...0x203e => true, 0x203f...0x2040 => true, 0x2041...0x2043 => true, 0x2044 => true, 0x2045 => true, 0x2046 => true, 0x2047...0x2051 => true, 0x2052 => true, 0x2053 => true, 0x2054 => true, 0x2055...0x205e => true, 0x205f => true, 0x2070 => true, 0x2071 => true, 0x2074...0x2079 => true, 0x207a...0x207c => true, 0x207d => true, 0x207e => true, 0x207f => true, 0x2080...0x2089 => true, 0x208a...0x208c => true, 0x208d => true, 0x208e => true, 0x2090...0x209c => true, 0x20a0...0x20c0 => true, 0x2100...0x2101 => true, 0x2102 => true, 0x2103...0x2106 => true, 0x2107 => true, 0x2108...0x2109 => true, 0x210a...0x2113 => true, 0x2114 => true, 0x2115 => true, 0x2116...0x2117 => true, 0x2118 => true, 0x2119...0x211d => true, 0x211e...0x2123 => true, 0x2124 => true, 0x2125 => true, 0x2126 => true, 0x2127 => true, 0x2128 => true, 0x2129 => true, 0x212a...0x212d => true, 0x212e => true, 0x212f...0x2134 => true, 0x2135...0x2138 => true, 0x2139 => true, 0x213a...0x213b => true, 0x213c...0x213f => true, 0x2140...0x2144 => true, 0x2145...0x2149 => true, 0x214a => true, 0x214b => true, 0x214c...0x214d => true, 0x214e => true, 0x214f => true, 0x2150...0x215f => true, 0x2160...0x2182 => true, 0x2183...0x2184 => true, 0x2185...0x2188 => true, 0x2189 => true, 0x218a...0x218b => true, 0x2190...0x2194 => true, 0x2195...0x2199 => true, 0x219a...0x219b => true, 0x219c...0x219f => true, 0x21a0 => true, 0x21a1...0x21a2 => true, 0x21a3 => true, 0x21a4...0x21a5 => true, 0x21a6 => true, 0x21a7...0x21ad => true, 0x21ae => true, 0x21af...0x21cd => true, 0x21ce...0x21cf => true, 0x21d0...0x21d1 => true, 0x21d2 => true, 0x21d3 => true, 0x21d4 => true, 0x21d5...0x21f3 => true, 0x21f4...0x22ff => true, 0x2300...0x2307 => true, 0x2308 => true, 0x2309 => true, 0x230a => true, 0x230b => true, 0x230c...0x231f => true, 0x2320...0x2321 => true, 0x2322...0x2328 => true, 0x2329 => true, 0x232a => true, 0x232b...0x237b => true, 0x237c => true, 0x237d...0x239a => true, 0x239b...0x23b3 => true, 0x23b4...0x23db => true, 0x23dc...0x23e1 => true, 0x23e2...0x2426 => true, 0x2440...0x244a => true, 0x2460...0x249b => true, 0x249c...0x24e9 => true, 0x24ea...0x24ff => true, 0x2500...0x25b6 => true, 0x25b7 => true, 0x25b8...0x25c0 => true, 0x25c1 => true, 0x25c2...0x25f7 => true, 0x25f8...0x25ff => true, 0x2600...0x266e => true, 0x266f => true, 0x2670...0x2767 => true, 0x2768 => true, 0x2769 => true, 0x276a => true, 0x276b => true, 0x276c => true, 0x276d => true, 0x276e => true, 0x276f => true, 0x2770 => true, 0x2771 => true, 0x2772 => true, 0x2773 => true, 0x2774 => true, 0x2775 => true, 0x2776...0x2793 => true, 0x2794...0x27bf => true, 0x27c0...0x27c4 => true, 0x27c5 => true, 0x27c6 => true, 0x27c7...0x27e5 => true, 0x27e6 => true, 0x27e7 => true, 0x27e8 => true, 0x27e9 => true, 0x27ea => true, 0x27eb => true, 0x27ec => true, 0x27ed => true, 0x27ee => true, 0x27ef => true, 0x27f0...0x27ff => true, 0x2800...0x28ff => true, 0x2900...0x2982 => true, 0x2983 => true, 0x2984 => true, 0x2985 => true, 0x2986 => true, 0x2987 => true, 0x2988 => true, 0x2989 => true, 0x298a => true, 0x298b => true, 0x298c => true, 0x298d => true, 0x298e => true, 0x298f => true, 0x2990 => true, 0x2991 => true, 0x2992 => true, 0x2993 => true, 0x2994 => true, 0x2995 => true, 0x2996 => true, 0x2997 => true, 0x2998 => true, 0x2999...0x29d7 => true, 0x29d8 => true, 0x29d9 => true, 0x29da => true, 0x29db => true, 0x29dc...0x29fb => true, 0x29fc => true, 0x29fd => true, 0x29fe...0x2aff => true, 0x2b00...0x2b2f => true, 0x2b30...0x2b44 => true, 0x2b45...0x2b46 => true, 0x2b47...0x2b4c => true, 0x2b4d...0x2b73 => true, 0x2b76...0x2b95 => true, 0x2b97...0x2bff => true, 0x2c00...0x2c7b => true, 0x2c7c...0x2c7d => true, 0x2c7e...0x2ce4 => true, 0x2ce5...0x2cea => true, 0x2ceb...0x2cee => true, 0x2cf2...0x2cf3 => true, 0x2cf9...0x2cfc => true, 0x2cfd => true, 0x2cfe...0x2cff => true, 0x2d00...0x2d25 => true, 0x2d27 => true, 0x2d2d => true, 0x2d30...0x2d67 => true, 0x2d6f => true, 0x2d70 => true, 0x2d80...0x2d96 => true, 0x2da0...0x2da6 => true, 0x2da8...0x2dae => true, 0x2db0...0x2db6 => true, 0x2db8...0x2dbe => true, 0x2dc0...0x2dc6 => true, 0x2dc8...0x2dce => true, 0x2dd0...0x2dd6 => true, 0x2dd8...0x2dde => true, 0x2e00...0x2e01 => true, 0x2e02 => true, 0x2e03 => true, 0x2e04 => true, 0x2e05 => true, 0x2e06...0x2e08 => true, 0x2e09 => true, 0x2e0a => true, 0x2e0b => true, 0x2e0c => true, 0x2e0d => true, 0x2e0e...0x2e16 => true, 0x2e17 => true, 0x2e18...0x2e19 => true, 0x2e1a => true, 0x2e1b => true, 0x2e1c => true, 0x2e1d => true, 0x2e1e...0x2e1f => true, 0x2e20 => true, 0x2e21 => true, 0x2e22 => true, 0x2e23 => true, 0x2e24 => true, 0x2e25 => true, 0x2e26 => true, 0x2e27 => true, 0x2e28 => true, 0x2e29 => true, 0x2e2a...0x2e2e => true, 0x2e2f => true, 0x2e30...0x2e39 => true, 0x2e3a...0x2e3b => true, 0x2e3c...0x2e3f => true, 0x2e40 => true, 0x2e41 => true, 0x2e42 => true, 0x2e43...0x2e4f => true, 0x2e50...0x2e51 => true, 0x2e52...0x2e54 => true, 0x2e55 => true, 0x2e56 => true, 0x2e57 => true, 0x2e58 => true, 0x2e59 => true, 0x2e5a => true, 0x2e5b => true, 0x2e5c => true, 0x2e5d => true, 0x2e80...0x2e99 => true, 0x2e9b...0x2ef3 => true, 0x2f00...0x2fd5 => true, 0x2ff0...0x2ffb => true, 0x3000 => true, 0x3001...0x3003 => true, 0x3004 => true, 0x3005 => true, 0x3006 => true, 0x3007 => true, 0x3008 => true, 0x3009 => true, 0x300a => true, 0x300b => true, 0x300c => true, 0x300d => true, 0x300e => true, 0x300f => true, 0x3010 => true, 0x3011 => true, 0x3012...0x3013 => true, 0x3014 => true, 0x3015 => true, 0x3016 => true, 0x3017 => true, 0x3018 => true, 0x3019 => true, 0x301a => true, 0x301b => true, 0x301c => true, 0x301d => true, 0x301e...0x301f => true, 0x3020 => true, 0x3021...0x3029 => true, 0x3030 => true, 0x3031...0x3035 => true, 0x3036...0x3037 => true, 0x3038...0x303a => true, 0x303b => true, 0x303c => true, 0x303d => true, 0x303e...0x303f => true, 0x3041...0x3096 => true, 0x309b...0x309c => true, 0x309d...0x309e => true, 0x309f => true, 0x30a0 => true, 0x30a1...0x30fa => true, 0x30fb => true, 0x30fc...0x30fe => true, 0x30ff => true, 0x3105...0x312f => true, 0x3131...0x318e => true, 0x3190...0x3191 => true, 0x3192...0x3195 => true, 0x3196...0x319f => true, 0x31a0...0x31bf => true, 0x31c0...0x31e3 => true, 0x31f0...0x31ff => true, 0x3200...0x321e => true, 0x3220...0x3229 => true, 0x322a...0x3247 => true, 0x3248...0x324f => true, 0x3250 => true, 0x3251...0x325f => true, 0x3260...0x327f => true, 0x3280...0x3289 => true, 0x328a...0x32b0 => true, 0x32b1...0x32bf => true, 0x32c0...0x33ff => true, 0x3400...0x4dbf => true, 0x4dc0...0x4dff => true, 0x4e00...0xa014 => true, 0xa015 => true, 0xa016...0xa48c => true, 0xa490...0xa4c6 => true, 0xa4d0...0xa4f7 => true, 0xa4f8...0xa4fd => true, 0xa4fe...0xa4ff => true, 0xa500...0xa60b => true, 0xa60c => true, 0xa60d...0xa60f => true, 0xa610...0xa61f => true, 0xa620...0xa629 => true, 0xa62a...0xa62b => true, 0xa640...0xa66d => true, 0xa66e => true, 0xa673 => true, 0xa67e => true, 0xa67f => true, 0xa680...0xa69b => true, 0xa69c...0xa69d => true, 0xa6a0...0xa6e5 => true, 0xa6e6...0xa6ef => true, 0xa6f2...0xa6f7 => true, 0xa700...0xa716 => true, 0xa717...0xa71f => true, 0xa720...0xa721 => true, 0xa722...0xa76f => true, 0xa770 => true, 0xa771...0xa787 => true, 0xa788 => true, 0xa789...0xa78a => true, 0xa78b...0xa78e => true, 0xa78f => true, 0xa790...0xa7ca => true, 0xa7d0...0xa7d1 => true, 0xa7d3 => true, 0xa7d5...0xa7d9 => true, 0xa7f2...0xa7f4 => true, 0xa7f5...0xa7f6 => true, 0xa7f7 => true, 0xa7f8...0xa7f9 => true, 0xa7fa => true, 0xa7fb...0xa801 => true, 0xa803...0xa805 => true, 0xa807...0xa80a => true, 0xa80c...0xa822 => true, 0xa823...0xa824 => true, 0xa827 => true, 0xa828...0xa82b => true, 0xa830...0xa835 => true, 0xa836...0xa837 => true, 0xa838 => true, 0xa839 => true, 0xa840...0xa873 => true, 0xa874...0xa877 => true, 0xa880...0xa881 => true, 0xa882...0xa8b3 => true, 0xa8b4...0xa8c3 => true, 0xa8ce...0xa8cf => true, 0xa8d0...0xa8d9 => true, 0xa8f2...0xa8f7 => true, 0xa8f8...0xa8fa => true, 0xa8fb => true, 0xa8fc => true, 0xa8fd...0xa8fe => true, 0xa900...0xa909 => true, 0xa90a...0xa925 => true, 0xa92e...0xa92f => true, 0xa930...0xa946 => true, 0xa952...0xa953 => true, 0xa95f => true, 0xa960...0xa97c => true, 0xa983 => true, 0xa984...0xa9b2 => true, 0xa9b4...0xa9b5 => true, 0xa9ba...0xa9bb => true, 0xa9be...0xa9c0 => true, 0xa9c1...0xa9cd => true, 0xa9cf => true, 0xa9d0...0xa9d9 => true, 0xa9de...0xa9df => true, 0xa9e0...0xa9e4 => true, 0xa9e6 => true, 0xa9e7...0xa9ef => true, 0xa9f0...0xa9f9 => true, 0xa9fa...0xa9fe => true, 0xaa00...0xaa28 => true, 0xaa2f...0xaa30 => true, 0xaa33...0xaa34 => true, 0xaa40...0xaa42 => true, 0xaa44...0xaa4b => true, 0xaa4d => true, 0xaa50...0xaa59 => true, 0xaa5c...0xaa5f => true, 0xaa60...0xaa6f => true, 0xaa70 => true, 0xaa71...0xaa76 => true, 0xaa77...0xaa79 => true, 0xaa7a => true, 0xaa7b => true, 0xaa7d => true, 0xaa7e...0xaaaf => true, 0xaab1 => true, 0xaab5...0xaab6 => true, 0xaab9...0xaabd => true, 0xaac0 => true, 0xaac2 => true, 0xaadb...0xaadc => true, 0xaadd => true, 0xaade...0xaadf => true, 0xaae0...0xaaea => true, 0xaaeb => true, 0xaaee...0xaaef => true, 0xaaf0...0xaaf1 => true, 0xaaf2 => true, 0xaaf3...0xaaf4 => true, 0xaaf5 => true, 0xab01...0xab06 => true, 0xab09...0xab0e => true, 0xab11...0xab16 => true, 0xab20...0xab26 => true, 0xab28...0xab2e => true, 0xab30...0xab5a => true, 0xab5b => true, 0xab5c...0xab5f => true, 0xab60...0xab68 => true, 0xab69 => true, 0xab6a...0xab6b => true, 0xab70...0xabbf => true, 0xabc0...0xabe2 => true, 0xabe3...0xabe4 => true, 0xabe6...0xabe7 => true, 0xabe9...0xabea => true, 0xabeb => true, 0xabec => true, 0xabf0...0xabf9 => true, 0xac00...0xd7a3 => true, 0xd7b0...0xd7c6 => true, 0xd7cb...0xd7fb => true, 0xf900...0xfa6d => true, 0xfa70...0xfad9 => true, 0xfb00...0xfb06 => true, 0xfb13...0xfb17 => true, 0xfb1d => true, 0xfb1f...0xfb28 => true, 0xfb29 => true, 0xfb2a...0xfb36 => true, 0xfb38...0xfb3c => true, 0xfb3e => true, 0xfb40...0xfb41 => true, 0xfb43...0xfb44 => true, 0xfb46...0xfbb1 => true, 0xfbb2...0xfbc2 => true, 0xfbd3...0xfd3d => true, 0xfd3e => true, 0xfd3f => true, 0xfd40...0xfd4f => true, 0xfd50...0xfd8f => true, 0xfd92...0xfdc7 => true, 0xfdcf => true, 0xfdf0...0xfdfb => true, 0xfdfc => true, 0xfdfd...0xfdff => true, 0xfe10...0xfe16 => true, 0xfe17 => true, 0xfe18 => true, 0xfe19 => true, 0xfe30 => true, 0xfe31...0xfe32 => true, 0xfe33...0xfe34 => true, 0xfe35 => true, 0xfe36 => true, 0xfe37 => true, 0xfe38 => true, 0xfe39 => true, 0xfe3a => true, 0xfe3b => true, 0xfe3c => true, 0xfe3d => true, 0xfe3e => true, 0xfe3f => true, 0xfe40 => true, 0xfe41 => true, 0xfe42 => true, 0xfe43 => true, 0xfe44 => true, 0xfe45...0xfe46 => true, 0xfe47 => true, 0xfe48 => true, 0xfe49...0xfe4c => true, 0xfe4d...0xfe4f => true, 0xfe50...0xfe52 => true, 0xfe54...0xfe57 => true, 0xfe58 => true, 0xfe59 => true, 0xfe5a => true, 0xfe5b => true, 0xfe5c => true, 0xfe5d => true, 0xfe5e => true, 0xfe5f...0xfe61 => true, 0xfe62 => true, 0xfe63 => true, 0xfe64...0xfe66 => true, 0xfe68 => true, 0xfe69 => true, 0xfe6a...0xfe6b => true, 0xfe70...0xfe74 => true, 0xfe76...0xfefc => true, 0xff01...0xff03 => true, 0xff04 => true, 0xff05...0xff07 => true, 0xff08 => true, 0xff09 => true, 0xff0a => true, 0xff0b => true, 0xff0c => true, 0xff0d => true, 0xff0e...0xff0f => true, 0xff10...0xff19 => true, 0xff1a...0xff1b => true, 0xff1c...0xff1e => true, 0xff1f...0xff20 => true, 0xff21...0xff3a => true, 0xff3b => true, 0xff3c => true, 0xff3d => true, 0xff3e => true, 0xff3f => true, 0xff40 => true, 0xff41...0xff5a => true, 0xff5b => true, 0xff5c => true, 0xff5d => true, 0xff5e => true, 0xff5f => true, 0xff60 => true, 0xff61 => true, 0xff62 => true, 0xff63 => true, 0xff64...0xff65 => true, 0xff66...0xff6f => true, 0xff70 => true, 0xff71...0xff9d => true, 0xffa0...0xffbe => true, 0xffc2...0xffc7 => true, 0xffca...0xffcf => true, 0xffd2...0xffd7 => true, 0xffda...0xffdc => true, 0xffe0...0xffe1 => true, 0xffe2 => true, 0xffe3 => true, 0xffe4 => true, 0xffe5...0xffe6 => true, 0xffe8 => true, 0xffe9...0xffec => true, 0xffed...0xffee => true, 0xfffc...0xfffd => true, 0x10000...0x1000b => true, 0x1000d...0x10026 => true, 0x10028...0x1003a => true, 0x1003c...0x1003d => true, 0x1003f...0x1004d => true, 0x10050...0x1005d => true, 0x10080...0x100fa => true, 0x10100...0x10102 => true, 0x10107...0x10133 => true, 0x10137...0x1013f => true, 0x10140...0x10174 => true, 0x10175...0x10178 => true, 0x10179...0x10189 => true, 0x1018a...0x1018b => true, 0x1018c...0x1018e => true, 0x10190...0x1019c => true, 0x101a0 => true, 0x101d0...0x101fc => true, 0x10280...0x1029c => true, 0x102a0...0x102d0 => true, 0x102e1...0x102fb => true, 0x10300...0x1031f => true, 0x10320...0x10323 => true, 0x1032d...0x10340 => true, 0x10341 => true, 0x10342...0x10349 => true, 0x1034a => true, 0x10350...0x10375 => true, 0x10380...0x1039d => true, 0x1039f => true, 0x103a0...0x103c3 => true, 0x103c8...0x103cf => true, 0x103d0 => true, 0x103d1...0x103d5 => true, 0x10400...0x1044f => true, 0x10450...0x1049d => true, 0x104a0...0x104a9 => true, 0x104b0...0x104d3 => true, 0x104d8...0x104fb => true, 0x10500...0x10527 => true, 0x10530...0x10563 => true, 0x1056f => true, 0x10570...0x1057a => true, 0x1057c...0x1058a => true, 0x1058c...0x10592 => true, 0x10594...0x10595 => true, 0x10597...0x105a1 => true, 0x105a3...0x105b1 => true, 0x105b3...0x105b9 => true, 0x105bb...0x105bc => true, 0x10600...0x10736 => true, 0x10740...0x10755 => true, 0x10760...0x10767 => true, 0x10780...0x10785 => true, 0x10787...0x107b0 => true, 0x107b2...0x107ba => true, 0x10800...0x10805 => true, 0x10808 => true, 0x1080a...0x10835 => true, 0x10837...0x10838 => true, 0x1083c => true, 0x1083f...0x10855 => true, 0x10857 => true, 0x10858...0x1085f => true, 0x10860...0x10876 => true, 0x10877...0x10878 => true, 0x10879...0x1087f => true, 0x10880...0x1089e => true, 0x108a7...0x108af => true, 0x108e0...0x108f2 => true, 0x108f4...0x108f5 => true, 0x108fb...0x108ff => true, 0x10900...0x10915 => true, 0x10916...0x1091b => true, 0x1091f => true, 0x10920...0x10939 => true, 0x1093f => true, 0x10980...0x109b7 => true, 0x109bc...0x109bd => true, 0x109be...0x109bf => true, 0x109c0...0x109cf => true, 0x109d2...0x109ff => true, 0x10a00 => true, 0x10a10...0x10a13 => true, 0x10a15...0x10a17 => true, 0x10a19...0x10a35 => true, 0x10a40...0x10a48 => true, 0x10a50...0x10a58 => true, 0x10a60...0x10a7c => true, 0x10a7d...0x10a7e => true, 0x10a7f => true, 0x10a80...0x10a9c => true, 0x10a9d...0x10a9f => true, 0x10ac0...0x10ac7 => true, 0x10ac8 => true, 0x10ac9...0x10ae4 => true, 0x10aeb...0x10aef => true, 0x10af0...0x10af6 => true, 0x10b00...0x10b35 => true, 0x10b39...0x10b3f => true, 0x10b40...0x10b55 => true, 0x10b58...0x10b5f => true, 0x10b60...0x10b72 => true, 0x10b78...0x10b7f => true, 0x10b80...0x10b91 => true, 0x10b99...0x10b9c => true, 0x10ba9...0x10baf => true, 0x10c00...0x10c48 => true, 0x10c80...0x10cb2 => true, 0x10cc0...0x10cf2 => true, 0x10cfa...0x10cff => true, 0x10d00...0x10d23 => true, 0x10d30...0x10d39 => true, 0x10e60...0x10e7e => true, 0x10e80...0x10ea9 => true, 0x10ead => true, 0x10eb0...0x10eb1 => true, 0x10f00...0x10f1c => true, 0x10f1d...0x10f26 => true, 0x10f27 => true, 0x10f30...0x10f45 => true, 0x10f51...0x10f54 => true, 0x10f55...0x10f59 => true, 0x10f70...0x10f81 => true, 0x10f86...0x10f89 => true, 0x10fb0...0x10fc4 => true, 0x10fc5...0x10fcb => true, 0x10fe0...0x10ff6 => true, 0x11000 => true, 0x11002 => true, 0x11003...0x11037 => true, 0x11047...0x1104d => true, 0x11052...0x11065 => true, 0x11066...0x1106f => true, 0x11071...0x11072 => true, 0x11075 => true, 0x11082 => true, 0x11083...0x110af => true, 0x110b0...0x110b2 => true, 0x110b7...0x110b8 => true, 0x110bb...0x110bc => true, 0x110be...0x110c1 => true, 0x110d0...0x110e8 => true, 0x110f0...0x110f9 => true, 0x11103...0x11126 => true, 0x1112c => true, 0x11136...0x1113f => true, 0x11140...0x11143 => true, 0x11144 => true, 0x11145...0x11146 => true, 0x11147 => true, 0x11150...0x11172 => true, 0x11174...0x11175 => true, 0x11176 => true, 0x11182 => true, 0x11183...0x111b2 => true, 0x111b3...0x111b5 => true, 0x111bf...0x111c0 => true, 0x111c1...0x111c4 => true, 0x111c5...0x111c8 => true, 0x111cd => true, 0x111ce => true, 0x111d0...0x111d9 => true, 0x111da => true, 0x111db => true, 0x111dc => true, 0x111dd...0x111df => true, 0x111e1...0x111f4 => true, 0x11200...0x11211 => true, 0x11213...0x1122b => true, 0x1122c...0x1122e => true, 0x11232...0x11233 => true, 0x11235 => true, 0x11238...0x1123d => true, 0x11280...0x11286 => true, 0x11288 => true, 0x1128a...0x1128d => true, 0x1128f...0x1129d => true, 0x1129f...0x112a8 => true, 0x112a9 => true, 0x112b0...0x112de => true, 0x112e0...0x112e2 => true, 0x112f0...0x112f9 => true, 0x11302...0x11303 => true, 0x11305...0x1130c => true, 0x1130f...0x11310 => true, 0x11313...0x11328 => true, 0x1132a...0x11330 => true, 0x11332...0x11333 => true, 0x11335...0x11339 => true, 0x1133d => true, 0x1133f => true, 0x11341...0x11344 => true, 0x11347...0x11348 => true, 0x1134b...0x1134d => true, 0x11350 => true, 0x1135d...0x11361 => true, 0x11362...0x11363 => true, 0x11400...0x11434 => true, 0x11435...0x11437 => true, 0x11440...0x11441 => true, 0x11445 => true, 0x11447...0x1144a => true, 0x1144b...0x1144f => true, 0x11450...0x11459 => true, 0x1145a...0x1145b => true, 0x1145d => true, 0x1145f...0x11461 => true, 0x11480...0x114af => true, 0x114b1...0x114b2 => true, 0x114b9 => true, 0x114bb...0x114bc => true, 0x114be => true, 0x114c1 => true, 0x114c4...0x114c5 => true, 0x114c6 => true, 0x114c7 => true, 0x114d0...0x114d9 => true, 0x11580...0x115ae => true, 0x115b0...0x115b1 => true, 0x115b8...0x115bb => true, 0x115be => true, 0x115c1...0x115d7 => true, 0x115d8...0x115db => true, 0x11600...0x1162f => true, 0x11630...0x11632 => true, 0x1163b...0x1163c => true, 0x1163e => true, 0x11641...0x11643 => true, 0x11644 => true, 0x11650...0x11659 => true, 0x11660...0x1166c => true, 0x11680...0x116aa => true, 0x116ac => true, 0x116ae...0x116af => true, 0x116b6 => true, 0x116b8 => true, 0x116b9 => true, 0x116c0...0x116c9 => true, 0x11700...0x1171a => true, 0x11720...0x11721 => true, 0x11726 => true, 0x11730...0x11739 => true, 0x1173a...0x1173b => true, 0x1173c...0x1173e => true, 0x1173f => true, 0x11740...0x11746 => true, 0x11800...0x1182b => true, 0x1182c...0x1182e => true, 0x11838 => true, 0x1183b => true, 0x118a0...0x118df => true, 0x118e0...0x118e9 => true, 0x118ea...0x118f2 => true, 0x118ff...0x11906 => true, 0x11909 => true, 0x1190c...0x11913 => true, 0x11915...0x11916 => true, 0x11918...0x1192f => true, 0x11931...0x11935 => true, 0x11937...0x11938 => true, 0x1193d => true, 0x1193f => true, 0x11940 => true, 0x11941 => true, 0x11942 => true, 0x11944...0x11946 => true, 0x11950...0x11959 => true, 0x119a0...0x119a7 => true, 0x119aa...0x119d0 => true, 0x119d1...0x119d3 => true, 0x119dc...0x119df => true, 0x119e1 => true, 0x119e2 => true, 0x119e3 => true, 0x119e4 => true, 0x11a00 => true, 0x11a0b...0x11a32 => true, 0x11a39 => true, 0x11a3a => true, 0x11a3f...0x11a46 => true, 0x11a50 => true, 0x11a57...0x11a58 => true, 0x11a5c...0x11a89 => true, 0x11a97 => true, 0x11a9a...0x11a9c => true, 0x11a9d => true, 0x11a9e...0x11aa2 => true, 0x11ab0...0x11af8 => true, 0x11c00...0x11c08 => true, 0x11c0a...0x11c2e => true, 0x11c2f => true, 0x11c3e => true, 0x11c40 => true, 0x11c41...0x11c45 => true, 0x11c50...0x11c59 => true, 0x11c5a...0x11c6c => true, 0x11c70...0x11c71 => true, 0x11c72...0x11c8f => true, 0x11ca9 => true, 0x11cb1 => true, 0x11cb4 => true, 0x11d00...0x11d06 => true, 0x11d08...0x11d09 => true, 0x11d0b...0x11d30 => true, 0x11d46 => true, 0x11d50...0x11d59 => true, 0x11d60...0x11d65 => true, 0x11d67...0x11d68 => true, 0x11d6a...0x11d89 => true, 0x11d8a...0x11d8e => true, 0x11d93...0x11d94 => true, 0x11d96 => true, 0x11d98 => true, 0x11da0...0x11da9 => true, 0x11ee0...0x11ef2 => true, 0x11ef5...0x11ef6 => true, 0x11ef7...0x11ef8 => true, 0x11fb0 => true, 0x11fc0...0x11fd4 => true, 0x11fd5...0x11fdc => true, 0x11fdd...0x11fe0 => true, 0x11fe1...0x11ff1 => true, 0x11fff => true, 0x12000...0x12399 => true, 0x12400...0x1246e => true, 0x12470...0x12474 => true, 0x12480...0x12543 => true, 0x12f90...0x12ff0 => true, 0x12ff1...0x12ff2 => true, 0x13000...0x1342e => true, 0x14400...0x14646 => true, 0x16800...0x16a38 => true, 0x16a40...0x16a5e => true, 0x16a60...0x16a69 => true, 0x16a6e...0x16a6f => true, 0x16a70...0x16abe => true, 0x16ac0...0x16ac9 => true, 0x16ad0...0x16aed => true, 0x16af5 => true, 0x16b00...0x16b2f => true, 0x16b37...0x16b3b => true, 0x16b3c...0x16b3f => true, 0x16b40...0x16b43 => true, 0x16b44 => true, 0x16b45 => true, 0x16b50...0x16b59 => true, 0x16b5b...0x16b61 => true, 0x16b63...0x16b77 => true, 0x16b7d...0x16b8f => true, 0x16e40...0x16e7f => true, 0x16e80...0x16e96 => true, 0x16e97...0x16e9a => true, 0x16f00...0x16f4a => true, 0x16f50 => true, 0x16f51...0x16f87 => true, 0x16f93...0x16f9f => true, 0x16fe0...0x16fe1 => true, 0x16fe2 => true, 0x16fe3 => true, 0x16ff0...0x16ff1 => true, 0x17000...0x187f7 => true, 0x18800...0x18cd5 => true, 0x18d00...0x18d08 => true, 0x1aff0...0x1aff3 => true, 0x1aff5...0x1affb => true, 0x1affd...0x1affe => true, 0x1b000...0x1b122 => true, 0x1b150...0x1b152 => true, 0x1b164...0x1b167 => true, 0x1b170...0x1b2fb => true, 0x1bc00...0x1bc6a => true, 0x1bc70...0x1bc7c => true, 0x1bc80...0x1bc88 => true, 0x1bc90...0x1bc99 => true, 0x1bc9c => true, 0x1bc9f => true, 0x1cf50...0x1cfc3 => true, 0x1d000...0x1d0f5 => true, 0x1d100...0x1d126 => true, 0x1d129...0x1d164 => true, 0x1d166 => true, 0x1d16a...0x1d16c => true, 0x1d16d => true, 0x1d183...0x1d184 => true, 0x1d18c...0x1d1a9 => true, 0x1d1ae...0x1d1ea => true, 0x1d200...0x1d241 => true, 0x1d245 => true, 0x1d2e0...0x1d2f3 => true, 0x1d300...0x1d356 => true, 0x1d360...0x1d378 => true, 0x1d400...0x1d454 => true, 0x1d456...0x1d49c => true, 0x1d49e...0x1d49f => true, 0x1d4a2 => true, 0x1d4a5...0x1d4a6 => true, 0x1d4a9...0x1d4ac => true, 0x1d4ae...0x1d4b9 => true, 0x1d4bb => true, 0x1d4bd...0x1d4c3 => true, 0x1d4c5...0x1d505 => true, 0x1d507...0x1d50a => true, 0x1d50d...0x1d514 => true, 0x1d516...0x1d51c => true, 0x1d51e...0x1d539 => true, 0x1d53b...0x1d53e => true, 0x1d540...0x1d544 => true, 0x1d546 => true, 0x1d54a...0x1d550 => true, 0x1d552...0x1d6a5 => true, 0x1d6a8...0x1d6c0 => true, 0x1d6c1 => true, 0x1d6c2...0x1d6da => true, 0x1d6db => true, 0x1d6dc...0x1d6fa => true, 0x1d6fb => true, 0x1d6fc...0x1d714 => true, 0x1d715 => true, 0x1d716...0x1d734 => true, 0x1d735 => true, 0x1d736...0x1d74e => true, 0x1d74f => true, 0x1d750...0x1d76e => true, 0x1d76f => true, 0x1d770...0x1d788 => true, 0x1d789 => true, 0x1d78a...0x1d7a8 => true, 0x1d7a9 => true, 0x1d7aa...0x1d7c2 => true, 0x1d7c3 => true, 0x1d7c4...0x1d7cb => true, 0x1d7ce...0x1d7ff => true, 0x1d800...0x1d9ff => true, 0x1da37...0x1da3a => true, 0x1da6d...0x1da74 => true, 0x1da76...0x1da83 => true, 0x1da85...0x1da86 => true, 0x1da87...0x1da8b => true, 0x1df00...0x1df09 => true, 0x1df0a => true, 0x1df0b...0x1df1e => true, 0x1e100...0x1e12c => true, 0x1e137...0x1e13d => true, 0x1e140...0x1e149 => true, 0x1e14e => true, 0x1e14f => true, 0x1e290...0x1e2ad => true, 0x1e2c0...0x1e2eb => true, 0x1e2f0...0x1e2f9 => true, 0x1e2ff => true, 0x1e7e0...0x1e7e6 => true, 0x1e7e8...0x1e7eb => true, 0x1e7ed...0x1e7ee => true, 0x1e7f0...0x1e7fe => true, 0x1e800...0x1e8c4 => true, 0x1e8c7...0x1e8cf => true, 0x1e900...0x1e943 => true, 0x1e94b => true, 0x1e950...0x1e959 => true, 0x1e95e...0x1e95f => true, 0x1ec71...0x1ecab => true, 0x1ecac => true, 0x1ecad...0x1ecaf => true, 0x1ecb0 => true, 0x1ecb1...0x1ecb4 => true, 0x1ed01...0x1ed2d => true, 0x1ed2e => true, 0x1ed2f...0x1ed3d => true, 0x1ee00...0x1ee03 => true, 0x1ee05...0x1ee1f => true, 0x1ee21...0x1ee22 => true, 0x1ee24 => true, 0x1ee27 => true, 0x1ee29...0x1ee32 => true, 0x1ee34...0x1ee37 => true, 0x1ee39 => true, 0x1ee3b => true, 0x1ee42 => true, 0x1ee47 => true, 0x1ee49 => true, 0x1ee4b => true, 0x1ee4d...0x1ee4f => true, 0x1ee51...0x1ee52 => true, 0x1ee54 => true, 0x1ee57 => true, 0x1ee59 => true, 0x1ee5b => true, 0x1ee5d => true, 0x1ee5f => true, 0x1ee61...0x1ee62 => true, 0x1ee64 => true, 0x1ee67...0x1ee6a => true, 0x1ee6c...0x1ee72 => true, 0x1ee74...0x1ee77 => true, 0x1ee79...0x1ee7c => true, 0x1ee7e => true, 0x1ee80...0x1ee89 => true, 0x1ee8b...0x1ee9b => true, 0x1eea1...0x1eea3 => true, 0x1eea5...0x1eea9 => true, 0x1eeab...0x1eebb => true, 0x1eef0...0x1eef1 => true, 0x1f000...0x1f02b => true, 0x1f030...0x1f093 => true, 0x1f0a0...0x1f0ae => true, 0x1f0b1...0x1f0bf => true, 0x1f0c1...0x1f0cf => true, 0x1f0d1...0x1f0f5 => true, 0x1f100...0x1f10c => true, 0x1f10d...0x1f1ad => true, 0x1f1e6...0x1f202 => true, 0x1f210...0x1f23b => true, 0x1f240...0x1f248 => true, 0x1f250...0x1f251 => true, 0x1f260...0x1f265 => true, 0x1f300...0x1f3fa => true, 0x1f3fb...0x1f3ff => true, 0x1f400...0x1f6d7 => true, 0x1f6dd...0x1f6ec => true, 0x1f6f0...0x1f6fc => true, 0x1f700...0x1f773 => true, 0x1f780...0x1f7d8 => true, 0x1f7e0...0x1f7eb => true, 0x1f7f0 => true, 0x1f800...0x1f80b => true, 0x1f810...0x1f847 => true, 0x1f850...0x1f859 => true, 0x1f860...0x1f887 => true, 0x1f890...0x1f8ad => true, 0x1f8b0...0x1f8b1 => true, 0x1f900...0x1fa53 => true, 0x1fa60...0x1fa6d => true, 0x1fa70...0x1fa74 => true, 0x1fa78...0x1fa7c => true, 0x1fa80...0x1fa86 => true, 0x1fa90...0x1faac => true, 0x1fab0...0x1faba => true, 0x1fac0...0x1fac5 => true, 0x1fad0...0x1fad9 => true, 0x1fae0...0x1fae7 => true, 0x1faf0...0x1faf6 => true, 0x1fb00...0x1fb92 => true, 0x1fb94...0x1fbca => true, 0x1fbf0...0x1fbf9 => true, 0x20000...0x2a6df => true, 0x2a700...0x2b738 => true, 0x2b740...0x2b81d => true, 0x2b820...0x2cea1 => true, 0x2ceb0...0x2ebe0 => true, 0x2f800...0x2fa1d => true, 0x30000...0x3134a => true, else => false, }; } pub fn isGraphemeLink(cp: u21) bool { if (cp < 0x94d or cp > 0x11d97) return false; return switch (cp) { 0x94d => true, 0x9cd => true, 0xa4d => true, 0xacd => true, 0xb4d => true, 0xbcd => true, 0xc4d => true, 0xccd => true, 0xd3b...0xd3c => true, 0xd4d => true, 0xdca => true, 0xe3a => true, 0xeba => true, 0xf84 => true, 0x1039...0x103a => true, 0x1714 => true, 0x1715 => true, 0x1734 => true, 0x17d2 => true, 0x1a60 => true, 0x1b44 => true, 0x1baa => true, 0x1bab => true, 0x1bf2...0x1bf3 => true, 0x2d7f => true, 0xa806 => true, 0xa82c => true, 0xa8c4 => true, 0xa953 => true, 0xa9c0 => true, 0xaaf6 => true, 0xabed => true, 0x10a3f => true, 0x11046 => true, 0x11070 => true, 0x1107f => true, 0x110b9 => true, 0x11133...0x11134 => true, 0x111c0 => true, 0x11235 => true, 0x112ea => true, 0x1134d => true, 0x11442 => true, 0x114c2 => true, 0x115bf => true, 0x1163f => true, 0x116b6 => true, 0x1172b => true, 0x11839 => true, 0x1193d => true, 0x1193e => true, 0x119e0 => true, 0x11a34 => true, 0x11a47 => true, 0x11a99 => true, 0x11c3f => true, 0x11d44...0x11d45 => true, 0x11d97 => true, else => false, }; }
.gyro/ziglyph-jecolon-github.com-c37d93b6/pkg/src/autogen/derived_core_properties.zig
const combn = @import("../combn/combn.zig"); const Result = combn.gllparser.Result; const Parser = combn.gllparser.Parser; const Error = combn.gllparser.Error; const Context = combn.gllparser.Context; const PosKey = combn.gllparser.PosKey; const ParserPath = combn.gllparser.ParserPath; const Sequence = combn.combinator.Sequence; const SequenceValue = combn.combinator.sequence.Value; const Repeated = combn.combinator.Repeated; const RepeatedValue = combn.combinator.repeated.Value; const Literal = combn.parser.Literal; const LiteralValue = combn.parser.literal.Value; const OneOf = combn.combinator.OneOf; const MapTo = combn.combinator.MapTo; const Optional = combn.combinator.Optional; const String = @import("String.zig"); const Node = @import("Node.zig"); const Compilation = @import("Compilation.zig"); const Identifier = @import("identifier.zig").Identifier; const CompilerContext = @import("CompilerContext.zig"); const pattern_grammar = @import("pattern_grammar.zig"); const std = @import("std"); const mem = std.mem; const testing = std.testing; const assert = std.debug.assert; pub fn mapLiteralToNone(in: Result(LiteralValue), compiler_context: *CompilerContext, _allocator: mem.Allocator, key: PosKey, path: ParserPath) Error!?Result(?Compilation) { _ = compiler_context; _ = _allocator; _ = path; _ = key; return switch (in.result) { .err => Result(?Compilation).initError(in.offset, in.result.err), else => Result(?Compilation).init(in.offset, null), }; } /// Maps a SequenceValue(*Node) -> singular *Node with no name and children (each of the nodes in /// the sequence.) fn mapNodeSequence(in: Result(SequenceValue(*Node)), program_context: void, _allocator: mem.Allocator, key: PosKey, path: ParserPath) Error!?Result(*Node) { _ = program_context; switch (in.result) { .err => return Result(*Node).initError(in.offset, in.result.err), else => { var sequence = in.result.value; // Collect all the children nodes. var children = std.ArrayList(*Node).init(_allocator); errdefer children.deinit(); var sub = sequence.results.subscribe(key, path, Result(*Node).initError(in.offset, "matches only the empty language")); var offset = in.offset; while (sub.next()) |next| { offset = next.offset; try children.append(next.result.value.ref()); } const node = try Node.init(_allocator, String.init("unknown"), null); node.children = children.toOwnedSlice(); return Result(*Node).init(in.offset, node); }, } } /// Maps a SequenceValue(?Compilation) -> singular ?Compilation which parses all compilations in sequence, /// emitting a single unnamed Node with children. fn mapCompilationSequence(in: Result(SequenceValue(?Compilation)), compiler_context: *CompilerContext, _allocator: mem.Allocator, key: PosKey, path: ParserPath) Error!?Result(?Compilation) { _ = compiler_context; switch (in.result) { .err => return Result(?Compilation).initError(in.offset, in.result.err), else => { var sequence = in.result.value; // Collect all the parser compilations. var parsers = std.ArrayList(*Parser(void, *Node)).init(_allocator); var sub = sequence.results.subscribe(key, path, Result(?Compilation).initError(in.offset, "matches only the empty language")); var offset = in.offset; while (sub.next()) |next| { offset = next.offset; const compilation = next.result.value; if (compilation) |c| { try parsers.append(c.value.parser.ptr.ref()); } } var slice = parsers.toOwnedSlice(); // Build a parser which maps the many Parser(void, *Node) compilations into a // single Parser(void, *Node) which has each node as a child. var mapped = try MapTo(void, SequenceValue(*Node), *Node).init(_allocator, .{ .parser = (try Sequence(void, *Node).init(_allocator, slice, .borrowed)).ref(), .mapTo = mapNodeSequence, }); var result_compilation = Compilation.initParser(Compilation.CompiledParser{ .ptr = mapped.ref(), .slice = slice, }); return Result(?Compilation).init(offset, result_compilation); }, } } pub fn whitespaceOneOrMore(allocator: mem.Allocator) !*Parser(*CompilerContext, ?Compilation) { const newline = try MapTo(*CompilerContext, LiteralValue, ?Compilation).init(allocator, .{ .parser = (try OneOf(*CompilerContext, LiteralValue).init(allocator, &.{ (try Literal(*CompilerContext).init(allocator, "\r\n")).ref(), (try Literal(*CompilerContext).init(allocator, "\r")).ref(), (try Literal(*CompilerContext).init(allocator, "\n")).ref(), }, .copy)).ref(), .mapTo = mapLiteralToNone, }); const space = try MapTo(*CompilerContext, LiteralValue, ?Compilation).init(allocator, .{ .parser = (try OneOf(*CompilerContext, LiteralValue).init(allocator, &.{ (try Literal(*CompilerContext).init(allocator, " ")).ref(), (try Literal(*CompilerContext).init(allocator, "\t")).ref(), }, .copy)).ref(), .mapTo = mapLiteralToNone, }); const whitespace = try OneOf(*CompilerContext, ?Compilation).init(allocator, &.{ newline.ref(), space.ref(), }, .copy); // Whitespace+ return try MapTo(*CompilerContext, RepeatedValue(?Compilation), ?Compilation).init(allocator, .{ .parser = (try Repeated(*CompilerContext, ?Compilation).init(allocator, .{ .parser = whitespace.ref(), .min = 1, .max = -1, })).ref(), .mapTo = struct { fn mapTo(in: Result(RepeatedValue(?Compilation)), compiler_context: *CompilerContext, _allocator: mem.Allocator, key: PosKey, path: ParserPath) callconv(.Async) Error!?Result(?Compilation) { _ = compiler_context; _ = _allocator; _ = key; _ = path; switch (in.result) { .err => return Result(?Compilation).initError(in.offset, in.result.err), else => { // optimization: newline and space parsers produce no compilations, so no // need for us to pay any attention to repeated results. return Result(?Compilation).init(in.offset, null); }, } } }.mapTo, }); } pub fn init(allocator: mem.Allocator) !*Parser(*CompilerContext, Compilation) { // DSL grammar // // ```ebnf // Newline = "\r\n" | "\r" | "\n" ; // Space = " " | "\t" ; // Whitespace = Newline | Space ; // Assignment = "=" ; // Semicolon = ";" ; // Identifier = /[A-Z][[:alnum:]_]*/ ; // NestedPattern = "/", Pattern, "/" ; // Expr = NestedPattern | Identifier ; // ExprList = (ExprList, ",")? , Expr ; // Definition = Identifier , Whitespace+, Assignment, Whitespace+, ExprList, Semicolon ; // Grammar = (Definition | Expr | Whitespace+)+, EOF ; // ``` // // TODO(dsl): Expr logical OR / alternation // TODO(dsl): Expr optional // TODO(dsl): Expr zero-or-more // TODO(dsl): Expr one-or-more // TODO(dsl): Expr repetition {x,y} // TODO(dsl): Expr grouping (...) // TODO(dsl): terminal string literals // TODO(dsl): comments // TODO(dsl): exception? "-" // TODO(dsl): positive/negative lookahead? Python: & followed by a symbol, token or parenthesized group indicates a positive lookahead (i.e., is required to match but not consumed), while ! indicates a negative lookahead (i.e., is required _not_ to match). const whitespace_one_or_more = try whitespaceOneOrMore(allocator); var assignment = try MapTo(*CompilerContext, LiteralValue, ?Compilation).init(allocator, .{ .parser = (try Literal(*CompilerContext).init(allocator, "=")).ref(), .mapTo = mapLiteralToNone, }); var semicolon = try MapTo(*CompilerContext, LiteralValue, ?Compilation).init(allocator, .{ .parser = (try Literal(*CompilerContext).init(allocator, ";")).ref(), .mapTo = mapLiteralToNone, }); var forward_slash = try MapTo(*CompilerContext, LiteralValue, ?Compilation).init(allocator, .{ .parser = (try Literal(*CompilerContext).init(allocator, "/")).ref(), .mapTo = mapLiteralToNone, }); var nested_pattern = try MapTo(*CompilerContext, SequenceValue(?Compilation), ?Compilation).init(allocator, .{ .parser = (try Sequence(*CompilerContext, ?Compilation).init(allocator, &.{ forward_slash.ref(), (try pattern_grammar.init(allocator)).ref(), forward_slash.ref(), }, .copy)).ref(), .mapTo = struct { fn mapTo(in: Result(SequenceValue(?Compilation)), compiler_context: *CompilerContext, _allocator: mem.Allocator, key: PosKey, path: ParserPath) callconv(.Async) Error!?Result(?Compilation) { _ = compiler_context; _ = key; _ = path; switch (in.result) { .err => return Result(?Compilation).initError(in.offset, in.result.err), else => { var sequence = in.result.value; _ = sequence; // TODO(slimsag): actually compose the compilation to parse this regexp! const node = try Node.init(_allocator, String.init("TODO(slimsag): value from parsing regexp!"), null); const success = Result(*Node).init(in.offset, node); var always_success = try combn.combinator.Always(void, *Node).init(_allocator, success); var result_compilation = Compilation.initParser(Compilation.CompiledParser{ .ptr = always_success.ref(), .slice = null, }); return Result(?Compilation).init(in.offset, result_compilation); }, } } }.mapTo, }); var identifier_expr = try MapTo(*CompilerContext, ?Compilation, ?Compilation).init(allocator, .{ .parser = (try Identifier.init(allocator)).ref(), .mapTo = struct { fn mapTo(in: Result(?Compilation), compiler_context: *CompilerContext, _allocator: mem.Allocator, key: PosKey, path: ParserPath) callconv(.Async) Error!?Result(?Compilation) { _ = _allocator; _ = key; _ = path; switch (in.result) { .err => return Result(?Compilation).initError(in.offset, in.result.err), else => { // Lookup this identifier, which was previously defined. // TODO(slimsag): make it possible to reference future-definitions? var compilation = compiler_context.identifiers.get(in.result.value.?); if (compilation == null) { // TODO(slimsag): include name of definition that was not found in error. return Result(?Compilation).initError(in.offset, "definition not found"); } return Result(?Compilation).init(in.offset, compilation.?).toUnowned(); }, } } }.mapTo, }); var expr = try OneOf(*CompilerContext, ?Compilation).init(allocator, &.{ nested_pattern.ref(), identifier_expr.ref(), }, .copy); // ExprList = (ExprList, ",")? , Expr ; var expr_list_parsers = try allocator.alloc(*Parser(*CompilerContext, ?Compilation), 2); expr_list_parsers[1] = expr.ref(); // position 0 will be for left-recursive `(ExprList, ",")?` set later var expr_list = try MapTo(*CompilerContext, SequenceValue(?Compilation), ?Compilation).init(allocator, .{ .parser = (try Sequence(*CompilerContext, ?Compilation).init(allocator, expr_list_parsers, .owned)).ref(), .mapTo = mapCompilationSequence, }); // (ExprList, ",") var comma = try MapTo(*CompilerContext, LiteralValue, ?Compilation).init(allocator, .{ .parser = (try Literal(*CompilerContext).init(allocator, ",")).ref(), .mapTo = mapLiteralToNone, }); var expr_list_inner_left = try MapTo(*CompilerContext, SequenceValue(?Compilation), ?Compilation).init(allocator, .{ .parser = (try Sequence(*CompilerContext, ?Compilation).init(allocator, &.{ expr_list.ref(), comma.ref(), }, .copy)).ref(), .mapTo = struct { fn mapTo(in: Result(SequenceValue(?Compilation)), compiler_context: *CompilerContext, _allocator: mem.Allocator, key: PosKey, path: ParserPath) callconv(.Async) Error!?Result(?Compilation) { _ = compiler_context; _ = _allocator; switch (in.result) { .err => return Result(?Compilation).initError(in.offset, in.result.err), else => { var sequence = in.result.value; var sub = sequence.results.subscribe(key, path, Result(?Compilation).initError(in.offset, "matches only the empty language")); var _expr_list = sub.next().?; _ = sub.next().?; // non-capturing compilation for comma assert(sub.next() == null); return _expr_list.toUnowned(); }, } } }.mapTo, }); var optional_expr_list_inner_left = try MapTo(*CompilerContext, ??Compilation, ?Compilation).init(allocator, .{ .parser = (try Optional(*CompilerContext, ?Compilation).init(allocator, expr_list_inner_left.ref())).ref(), .mapTo = struct { fn mapTo(in: Result(??Compilation), compiler_context: *CompilerContext, _allocator: mem.Allocator, key: PosKey, path: ParserPath) callconv(.Async) Error!?Result(?Compilation) { _ = compiler_context; _ = _allocator; _ = key; _ = path; switch (in.result) { .err => return Result(?Compilation).initError(in.offset, in.result.err), else => { if (in.result.value == null) { return Result(?Compilation).init(in.offset, null); } return Result(?Compilation).init(in.offset, in.result.value.?).toUnowned(); }, } } }.mapTo, }); expr_list_parsers[0] = optional_expr_list_inner_left.ref(); var definition = try MapTo(*CompilerContext, SequenceValue(?Compilation), ?Compilation).init(allocator, .{ .parser = (try Sequence(*CompilerContext, ?Compilation).init(allocator, &.{ (try Identifier.init(allocator)).ref(), whitespace_one_or_more.ref(), assignment.ref(), whitespace_one_or_more.ref(), expr_list.ref(), semicolon.ref(), }, .copy)).ref(), .mapTo = struct { fn mapTo(in: Result(SequenceValue(?Compilation)), compiler_context: *CompilerContext, _allocator: mem.Allocator, key: PosKey, path: ParserPath) callconv(.Async) Error!?Result(?Compilation) { _ = _allocator; switch (in.result) { .err => return Result(?Compilation).initError(in.offset, in.result.err), else => { var sequence = in.result.value; var sub = sequence.results.subscribe(key, path, Result(?Compilation).initError(in.offset, "matches only the empty language")); var identifier = sub.next().?; _ = sub.next().?; // non-capturing compilation for whitespace _ = sub.next().?; // non-capturing compilation for assignment `=` operator _ = sub.next().?; // non-capturing compilation for whitespace var _expr_list = sub.next().?; var last = sub.next().?; // non-capturing compilation for semicolon assert(sub.next() == null); // Set identifier = _expr_list, so that future identifier expressions can // lookup the resulting expression compilation for the identifier. const v = try compiler_context.identifiers.getOrPut(identifier.result.value.?); if (v.found_existing) { // TODO(slimsag): include name of definition in error message return Result(?Compilation).initError(last.offset, "definition redefined"); } v.value_ptr.* = _expr_list.result.value.?; // A definition assignment yields no nodes. return Result(?Compilation).init(in.offset, null); }, } } }.mapTo, }); var definition_or_expr_or_whitespace = try OneOf(*CompilerContext, ?Compilation).init(allocator, &.{ definition.ref(), expr.ref(), whitespace_one_or_more.ref(), }, .copy); const non_null_root_compilation = try MapTo(*CompilerContext, RepeatedValue(?Compilation), ?Compilation).init(allocator, .{ .parser = (try Repeated(*CompilerContext, ?Compilation).init(allocator, .{ .parser = definition_or_expr_or_whitespace.ref(), .min = 1, .max = -1, })).ref(), .mapTo = struct { fn mapTo(in: Result(RepeatedValue(?Compilation)), compiler_context: *CompilerContext, _allocator: mem.Allocator, key: PosKey, path: ParserPath) callconv(.Async) Error!?Result(?Compilation) { _ = compiler_context; _ = _allocator; switch (in.result) { .err => return Result(?Compilation).initError(in.offset, in.result.err), else => { var repeated = in.result.value; var sub = repeated.results.subscribe(key, path, Result(?Compilation).initError(in.offset, "matches only the empty language")); var offset = in.offset; var compilation: ?Result(?Compilation) = null; while (sub.next()) |next| { offset = next.offset; switch (next.result) { .value => |v| { if (v != null) { if (compilation == null) { compilation = Result(?Compilation).init(next.offset, v.?); } else { // another parse path yielded a compilation, i.e. our grammar was ambiguous - // and it definitely shouldn't be! unreachable; } } }, .err => |e| return Result(?Compilation).initError(offset, e), } } if (compilation == null) { // Grammar does not have a root expression return Result(?Compilation).initError(offset, "root expression missing"); } return compilation.?.toUnowned(); }, } } }.mapTo, }); const end = try MapTo(*CompilerContext, combn.parser.end.Value, ?Compilation).init(allocator, .{ .parser = (try combn.parser.End(*CompilerContext).init(allocator)).ref(), .mapTo = struct { fn mapTo(in: Result(combn.parser.end.Value), compiler_context: *CompilerContext, _allocator: mem.Allocator, key: PosKey, path: ParserPath) callconv(.Async) Error!?Result(?Compilation) { _ = compiler_context; _ = _allocator; _ = key; _ = path; switch (in.result) { .err => return Result(?Compilation).initError(in.offset, in.result.err), else => return Result(?Compilation).init(in.offset, null), } } }.mapTo, }); const grammar_then_end = try Sequence(*CompilerContext, ?Compilation).init(allocator, &.{ non_null_root_compilation.ref(), end.ref(), }, .copy); return try MapTo(*CompilerContext, SequenceValue(?Compilation), Compilation).init(allocator, .{ .parser = grammar_then_end.ref(), .mapTo = struct { fn mapTo(in: Result(SequenceValue(?Compilation)), compiler_context: *CompilerContext, _allocator: mem.Allocator, key: PosKey, path: ParserPath) callconv(.Async) Error!?Result(Compilation) { _ = compiler_context; _ = _allocator; _ = key; _ = path; switch (in.result) { .err => return Result(Compilation).initError(in.offset, in.result.err), else => { var sequence = in.result.value; var sub = sequence.results.subscribe(key, path, Result(?Compilation).initError(in.offset, "matches only the empty language")); const root_compilation = sub.next(); assert(root_compilation != null); const _end = sub.next(); assert(_end != null); assert(sub.next() == null); return Result(Compilation).init(in.offset, root_compilation.?.result.value.?).toUnowned(); }, } } }.mapTo, }); }
src/dsl/grammar.zig
const std = @import("std"); const stdx = @import("stdx"); const log = stdx.log.scoped(.graphics_test); const graphics = @import("../../graphics.zig"); const Glyph = graphics.gpu.Glyph; const Tessellator = graphics.tessellator.Tessellator; pub const Graphics = struct { const Self = @This(); default_font_id: graphics.FontId, default_font_gid: graphics.FontGroupId, default_font_size: f32, default_font_glyph_advance_width: f32, default_font_metrics: graphics.VMetrics, tessellator: Tessellator, getOrLoadFontGlyphFn: fn (*Self, font: *graphics.Font, cp: u21) ?*Glyph, pub fn init(self: *Self, alloc: std.mem.Allocator) void { _ = alloc; self.* = .{ .default_font_id = 1, .default_font_gid = 1, .default_font_size = 20, .getOrLoadFontGlyphFn = undefined, .default_font_glyph_advance_width = 10, .default_font_metrics = .{ .ascender = 10, .descender = 0, .line_gap = 0, .height = 10, }, .tessellator = undefined, }; } fn getOrLoadFontGlyph(self: *Self, font: *graphics.Font, cp: u21) ?*Glyph { return self.getOrLoadFontGlyphFn(font, cp); } pub fn getFontGroupBySingleFontName(self: *Self, name: []const u8) graphics.FontGroupId { _ = name; return self.default_font_gid; } }; pub const TextGlyphIterator = struct { cp_iter: std.unicode.Utf8Iterator, g: *Graphics, font_size: f32, const Self = @This(); pub fn init(str: []const u8, font_size: f32, g: *Graphics) Self { return .{ .cp_iter = std.unicode.Utf8View.initUnchecked(str).iterator(), .g = g, .font_size = font_size, }; } pub fn nextCodepoint(self: *Self, state: *graphics.TextGlyphIterator.State) bool { state.start_idx = self.cp_iter.i; state.cp = self.cp_iter.nextCodepoint() orelse return false; state.end_idx = self.cp_iter.i; state.kern = 0; const factor = self.font_size / self.g.default_font_size; state.advance_width = factor * self.g.default_font_glyph_advance_width; state.ascent = factor * self.g.default_font_metrics.ascender; state.descent = 0; state.height = factor * self.g.default_font_metrics.height; return true; } pub fn setIndex(self: *Self, i: usize) void { self.cp_iter.i = i; } };
graphics/src/backend/test/graphics.zig
const std = @import("std"); const stdx = @import("stdx"); const graphics = @import("graphics"); const Color = graphics.Color; const platform = @import("platform"); const ui = @import("../ui.zig"); const Sized = ui.widgets.Sized; const ScrollList = ui.widgets.ScrollList; const Text = ui.widgets.Text; const Row = ui.widgets.Row; const Column = ui.widgets.Column; const Flex = ui.widgets.Flex; const TextButton = ui.widgets.TextButton; const log = stdx.log.scoped(.file_dialog); pub const FileDialog = struct { props: struct { init_cwd: []const u8, onResult: ?stdx.Function(fn (path: []const u8) void) = null, }, alloc: std.mem.Allocator, cwd: std.ArrayList(u8), files: std.ArrayList(FileItem), window: *ui.widgets.ModalOverlay, scroll_list: ui.WidgetRef(ScrollList), const Self = @This(); pub fn init(self: *Self, c: *ui.InitContext) void { self.alloc = c.alloc; self.cwd = std.ArrayList(u8).init(c.alloc); self.files = std.ArrayList(FileItem).init(c.alloc); self.window = c.node.parent.?.getWidget(ui.widgets.ModalOverlay); self.gotoDir(self.props.init_cwd); } pub fn deinit(node: *ui.Node, _: std.mem.Allocator) void { const self = node.getWidget(Self); self.cwd.deinit(); for (self.files.items) |it| { it.deinit(self.alloc); } self.files.deinit(); } pub fn build(self: *Self, c: *ui.BuildContext) ui.FrameId { const S = struct { fn buildItem(self_: *Self, c_: *ui.BuildContext, i: u32) ui.FrameId { return c_.decl(Text, .{ .text = self_.files.items[i].name, .color = Color.White, }); } fn onClickCancel(self_: *Self, e: platform.MouseUpEvent) void { _ = e; self_.window.requestClose(); } fn onClickSave(self_: *Self, e: platform.MouseUpEvent) void { _ = e; const list = self_.scroll_list.getWidget(); const idx = list.getSelectedIdx(); if (idx != ui.NullId) { if (self_.props.onResult) |cb| { const name = self_.files.items[idx].name; const path = std.fs.path.join(self_.alloc, &.{ self_.cwd.items, name }) catch @panic("error"); defer self_.alloc.free(path); cb.call(.{ path }); } self_.window.requestClose(); } } }; return c.decl(Sized, .{ .width = 500, .height = 400, .child = c.decl(Column, .{ .children = c.list(.{ c.decl(Flex, .{ .stretch_width = true, .child = c.decl(ScrollList, .{ .bind = &self.scroll_list, .bg_color = Color.init(50, 50, 50, 255), .children = c.range(self.files.items.len, self, S.buildItem), }), }), c.decl(Row, .{ .halign = .Right, .children = c.list(.{ c.decl(TextButton, .{ .text = "Cancel", .onClick = c.funcExt(self, S.onClickCancel), }), c.decl(TextButton, .{ .text = "Open", .onClick = c.funcExt(self, S.onClickSave), }), }), }), }), }), }); } fn gotoDir(self: *Self, cwd: []const u8) void { self.cwd.clearRetainingCapacity(); self.cwd.appendSlice(cwd) catch @panic("error"); var dir = std.fs.openDirAbsolute(self.cwd.items, .{ .iterate = true }) catch @panic("error"); defer dir.close(); var iter = dir.iterate(); while (iter.next() catch @panic("error")) |entry| { self.files.append(.{ .name = self.alloc.dupe(u8, entry.name) catch @panic("error"), .kind = entry.kind, }) catch @panic("error"); } } }; const FileItem = struct { kind: std.fs.File.Kind, name: []const u8, pub fn deinit(self: @This(), alloc: std.mem.Allocator) void { alloc.free(self.name); } };
ui/src/widgets/file_dialog.zig
const std = @import("std"); const utility = @import("utility.zig"); // Import modules to reduce file size usingnamespace @import("ir.zig"); usingnamespace @import("compile-unit.zig"); /// A struct that allows decoding data from LoLa IR code. pub const Decoder = struct { const Self = @This(); data: []const u8, // we are restricted to 4GB code size in the binary format, the decoder itself can use the same restriction offset: u32, pub fn init(source: []const u8) Self { return Self{ .data = source, .offset = 0, }; } pub fn isEof(self: Self) bool { return self.offset >= self.data.len; } pub fn readRaw(self: *Self, dest: []u8) !void { if (self.offset == self.data.len) return error.EndOfStream; if (self.offset + dest.len > self.data.len) return error.NotEnoughData; std.mem.copy(u8, dest, self.data[self.offset .. self.offset + dest.len]); self.offset += @intCast(u32, dest.len); } pub fn readBytes(self: *Self, comptime count: comptime_int) ![count]u8 { var data: [count]u8 = undefined; try self.readRaw(&data); return data; } /// Reads a value of the given type from the data stream. /// Allowed types are `u8`, `u16`, `u32`, `f64`, `Instruction`. pub fn read(self: *Self, comptime T: type) !T { if (T == Instruction) { return readInstruction(self); } const data = try self.readBytes(@sizeOf(T)); switch (T) { u8, u16, u32 => return std.mem.readIntLittle(T, &data), f64 => return @bitCast(f64, data), InstructionName => return try std.meta.intToEnum(InstructionName, data[0]), else => @compileError("Unsupported type " ++ @typeName(T) ++ " for Decoder.read!"), } } /// Reads a variable-length string from the data stream. /// Note that the returned handle is only valid as long as Decoder.data is valid. pub fn readVarString(self: *Self) ![]const u8 { const len = try self.read(u16); if (self.offset + len > self.data.len) return error.NotEnoughData; // this is when a string tells you it's longer than the actual data storage. const string = self.data[self.offset .. self.offset + len]; self.offset += len; return string; } /// Reads a fixed-length string from the data. The string may either be 0-terminated /// or use the available length completly. /// Note that the returned handle is only valid as long as Decoder.data is valid. pub fn readFixedString(self: *Self, comptime len: comptime_int) ![]const u8 { if (self.offset == self.data.len) return error.EndOfStream; if (self.offset + len > self.data.len) return error.NotEnoughData; const fullMem = self.data[self.offset .. self.offset + len]; self.offset += len; return utility.clampFixedString(fullMem); } /// Reads a a full instruction from the source. /// This will provide full decoding and error checking. fn readInstruction(self: *Self) !Instruction { if (self.isEof()) return error.EndOfStream; const instr = try self.read(InstructionName); inline for (std.meta.fields(Instruction)) |fld| { if (instr == @field(InstructionName, fld.name)) { if (fld.field_type == Instruction.Deprecated) { return error.DeprecatedInstruction; } else if (fld.field_type == Instruction.NoArg) { return @unionInit(Instruction, fld.name, .{}); } else if (fld.field_type == Instruction.CallArg) { const fun = self.readVarString() catch |err| return mapEndOfStreamToNotEnoughData(err); const argc = self.read(u8) catch |err| return mapEndOfStreamToNotEnoughData(err); return @unionInit(Instruction, fld.name, Instruction.CallArg{ .function = fun, .argc = argc, }); } else { const ValType = std.meta.fieldInfo(fld.field_type, "value").field_type; if (ValType == []const u8) { return @unionInit(Instruction, fld.name, fld.field_type{ .value = self.readVarString() catch |err| return mapEndOfStreamToNotEnoughData(err), }); } else { return @unionInit(Instruction, fld.name, fld.field_type{ .value = self.read(ValType) catch |err| return mapEndOfStreamToNotEnoughData(err), }); } } } } return error.InvalidInstruction; } fn mapEndOfStreamToNotEnoughData(err: anytype) @TypeOf(err) { return switch (err) { error.EndOfStream => error.NotEnoughData, else => err, }; } }; // zig fmt: off const decoderTestBlob = [_]u8{ 1,2,3, // "[3]u8" 8, // u8, 16, 0, // u16 32, 0, 0, 0, // u32 12, // Instruction "add" 5, 00, 'H', 'e', 'l', 'l', 'o', // String(*) "Hello" 0x1F, 0x85, 0xEB, 0x51, 0xB8, 0x1E, 0x09, 0x40, // f64 = 3.14000000000000012434 == 0x40091EB851EB851F 'B', 'y', 'e', 0, 0, 0, 0, 0, // String(8) "Bye" }; // zig fmt: on test "Decoder" { var decoder = Decoder.init(&decoderTestBlob); std.debug.assert(std.mem.eql(u8, &(try decoder.readBytes(3)), &[3]u8{ 1, 2, 3 })); std.debug.assert((try decoder.read(u8)) == 8); std.debug.assert((try decoder.read(u16)) == 16); std.debug.assert((try decoder.read(u32)) == 32); std.debug.assert((try decoder.read(InstructionName)) == .add); std.debug.assert(std.mem.eql(u8, try decoder.readVarString(), "Hello")); std.debug.assert((try decoder.read(f64)) == 3.14000000000000012434); std.debug.assert(std.mem.eql(u8, try decoder.readFixedString(8), "Bye")); if (decoder.readBytes(1)) |_| { std.debug.assert(false); } else |err| { std.debug.assert(err == error.EndOfStream); } } test "Decoder.NotEnoughData" { const blob = [_]u8{1}; var decoder = Decoder.init(&blob); if (decoder.read(u16)) |_| { std.debug.assert(false); } else |err| { std.debug.assert(err == error.NotEnoughData); } } test "Decoder.NotEnoughData (string)" { const blob = [_]u8{ 1, 0 }; var decoder = Decoder.init(&blob); if (decoder.readVarString()) |_| { std.debug.assert(false); } else |err| { std.debug.assert(err == error.NotEnoughData); } } test "Decoder.read(Instruction)" { const Pattern = struct { const ResultType = std.meta.declarationInfo(Decoder, "readInstruction").data.Fn.return_type; text: []const u8, instr: ResultType, fn isMatch(self: @This(), testee: ResultType) bool { if (self.instr) |a_p| { if (testee) |b_p| return eql(a_p, b_p) else |_| return false; } else |a_e| { if (testee) |_| return false else |b_e| return a_e == b_e; } } fn eql(a: Instruction, b: Instruction) bool { @setEvalBranchQuota(5000); const activeField = @as(InstructionName, a); if (activeField != @as(InstructionName, b)) return false; inline for (std.meta.fields(InstructionName)) |fld| { if (activeField == @field(InstructionName, fld.name)) { const FieldType = std.meta.fieldInfo(Instruction, fld.name).field_type; const lhs = @field(a, fld.name); const rhs = @field(b, fld.name); if ((FieldType == Instruction.Deprecated) or (FieldType == Instruction.NoArg)) { return true; } else if (FieldType == Instruction.CallArg) { return lhs.argc == rhs.argc and std.mem.eql(u8, lhs.function, rhs.function); } else { const ValType = std.meta.fieldInfo(FieldType, "value").field_type; if (ValType == []const u8) { return std.mem.eql(u8, lhs.value, rhs.value); } else { return lhs.value == rhs.value; } } } } unreachable; } }; const patterns = [_]Pattern{ .{ .text = "\x00", .instr = Instruction{ .nop = .{} } }, .{ .text = "\x01", .instr = error.DeprecatedInstruction }, .{ .text = "\x02", .instr = error.DeprecatedInstruction }, .{ .text = "\x03", .instr = error.DeprecatedInstruction }, .{ .text = "\x06\x03\x00ABC", .instr = Instruction{ .push_str = .{ .value = "ABC" } } }, .{ .text = "\x07\x00\x00\x00\x00\x00\x00\x00\x00", .instr = Instruction{ .push_num = .{ .value = 0 } } }, .{ .text = "\x08\x00\x10", .instr = Instruction{ .array_pack = .{ .value = 0x1000 } } }, .{ .text = "\x09\x01\x00x\x01", .instr = Instruction{ .call_fn = .{ .function = "x", .argc = 1 } } }, .{ .text = "\x0A\x02\x00yz\x03", .instr = Instruction{ .call_obj = .{ .function = "yz", .argc = 3 } } }, .{ .text = "\x0B", .instr = Instruction{ .pop = .{} } }, .{ .text = "\x0C", .instr = Instruction{ .add = .{} } }, .{ .text = "\x0D", .instr = Instruction{ .sub = .{} } }, .{ .text = "\x0E", .instr = Instruction{ .mul = .{} } }, .{ .text = "\x0F", .instr = Instruction{ .div = .{} } }, .{ .text = "\x10", .instr = Instruction{ .mod = .{} } }, .{ .text = "\x11", .instr = Instruction{ .bool_and = .{} } }, .{ .text = "\x12", .instr = Instruction{ .bool_or = .{} } }, .{ .text = "\x13", .instr = Instruction{ .bool_not = .{} } }, .{ .text = "\x14", .instr = Instruction{ .negate = .{} } }, .{ .text = "\x15", .instr = Instruction{ .eq = .{} } }, .{ .text = "\x16", .instr = Instruction{ .neq = .{} } }, .{ .text = "\x17", .instr = Instruction{ .less_eq = .{} } }, .{ .text = "\x18", .instr = Instruction{ .greater_eq = .{} } }, .{ .text = "\x19", .instr = Instruction{ .less = .{} } }, .{ .text = "\x1A", .instr = Instruction{ .greater = .{} } }, .{ .text = "\x1B\x00\x11\x22\x33", .instr = Instruction{ .jmp = .{ .value = 0x33221100 } } }, .{ .text = "\x1C\x44\x33\x22\x11", .instr = Instruction{ .jnf = .{ .value = 0x11223344 } } }, .{ .text = "\x1D", .instr = Instruction{ .iter_make = .{} } }, .{ .text = "\x1E", .instr = Instruction{ .iter_next = .{} } }, .{ .text = "\x1F", .instr = Instruction{ .array_store = .{} } }, .{ .text = "\x20", .instr = Instruction{ .array_load = .{} } }, .{ .text = "\x21", .instr = Instruction{ .ret = .{} } }, .{ .text = "\x22\xDE\xBA", .instr = Instruction{ .store_local = .{ .value = 0xBADE } } }, .{ .text = "\x23\xFE\xAF", .instr = Instruction{ .load_local = .{ .value = 0xAFFE } } }, .{ .text = "\x25", .instr = Instruction{ .retval = .{} } }, .{ .text = "\x26\x00\x12\x34\x56", .instr = Instruction{ .jif = .{ .value = 0x56341200 } } }, .{ .text = "\x27\x34\x12", .instr = Instruction{ .store_global_idx = .{ .value = 0x1234 } } }, .{ .text = "\x28\x21\x43", .instr = Instruction{ .load_global_idx = .{ .value = 0x4321 } } }, .{ .text = "\x29", .instr = Instruction{ .push_true = .{} } }, .{ .text = "\x2A", .instr = Instruction{ .push_false = .{} } }, .{ .text = "\x2B", .instr = Instruction{ .push_void = .{} } }, .{ .text = "", .instr = error.EndOfStream }, .{ .text = "\x26", .instr = error.NotEnoughData }, .{ .text = "\x09\xFF", .instr = error.NotEnoughData }, .{ .text = "\x26\x00\x00", .instr = error.NotEnoughData }, .{ .text = "\x09\xFF\xFF", .instr = error.NotEnoughData }, }; for (patterns) |pattern| { var decoder = Decoder.init(pattern.text); const instruction = decoder.read(Instruction); if (!pattern.isMatch(instruction)) { std.debug.warn("expected {}, got {}\n", .{ pattern.instr, instruction }); std.debug.assert(false); } } }
src/library/common/decoder.zig
const Intcode = @import("aoc").aoc2019.Intcode; const std = @import("std"); test "addition multiplication 1" { var intcode = try Intcode.init(std.testing.allocator, "1,9,10,3,2,3,11,0,99,30,40,50"); defer intcode.deinit(); _ = try intcode.run(); std.testing.expectEqual(intcode.getMemory(0), 3500); std.testing.expectEqual(intcode.getMemory(3), 70); } test "addition multiplication 2" { var intcode = try Intcode.init(std.testing.allocator, "1,0,0,0,99"); defer intcode.deinit(); _ = try intcode.run(); std.testing.expectEqual(intcode.getMemory(0), 2); } test "addition multiplication 3" { var intcode = try Intcode.init(std.testing.allocator, "2,3,0,3,99"); defer intcode.deinit(); _ = try intcode.run(); std.testing.expectEqual(intcode.getMemory(3), 6); } test "addition multiplication 4" { var intcode = try Intcode.init(std.testing.allocator, "2,4,4,5,99,0"); defer intcode.deinit(); _ = try intcode.run(); std.testing.expectEqual(intcode.getMemory(5), 9801); } test "addition multiplication 5" { var intcode = try Intcode.init(std.testing.allocator, "1,1,1,4,99,5,6,0,99"); defer intcode.deinit(); _ = try intcode.run(); std.testing.expectEqual(intcode.getMemory(0), 30); std.testing.expectEqual(intcode.getMemory(4), 2); } test "jumps compares" { var intcode = try Intcode.init(std.testing.allocator, \\3,21,1008,21,8,20,1005,20,22,107,8,21,20,1006,20,31, \\1106,0,36,98,0,0,1002,21,125,20,4,20,1105,1,46,104, \\999,1105,1,46,1101,1000,1,20,4,20,1105,1,46,98,99 ); defer intcode.deinit(); var input: Intcode.TapeElement = 0; while (input < 20) : (input += 1) { intcode.input = input; const expected_output: Intcode.TapeElement = switch (std.math.order(input, 8)) { .lt => 999, .eq => 1000, .gt => 1001 }; std.testing.expectEqual(try intcode.run(), expected_output); intcode.reset(); } }
src/test/zig/test_intcode.zig
const std = @import("std"); const mem = std.mem; // A simplified hash pub const Hash = u32; // A counter to disrupt flash operations. This is loaned to each // flash device so that the counts are shared across multiple // partitions/devices. pub const Counter = struct { const Self = @This(); // The number of operations remaining. When this reaches zero, // any flash operations will return error.Expired. current: usize, limit: ?usize, pub fn init(limit: usize) Counter { return .{ .current = 0, .limit = limit, }; } // Reset the current count. pub fn reset(self: *Self) void { self.current = 0; } // Perform an action. Decrements the counter if possible. If the // counter has expired, returns error.Expired. pub fn act(self: *Self) !void { if (self.limit) |limit| { if (self.current < limit) { self.current += 1; } else { return error.Expired; } } else { self.current += 1; } } // Set a limit. May return error.Expired if the new value exceeds // the limit. pub fn setLimit(self: *Self, limit: usize) !void { self.limit = limit; if (self.current >= limit) return error.Expired; } // Set no limit. pub fn noLimit(self: *Self) void { self.limit = null; } }; // States that a given sector can be in. pub const StateType = enum { // Unsafe indicates the flash should appear erased, but that it // wasn't completed. Unsafe, // Unwritten indicates that a write was interrupted. Unwritten, // Erased is a normal completed erase. Erased, // Written is a normal completed write. Written, }; pub const State = union(StateType) { const Self = @This(); Unsafe: void, Unwritten: Hash, Erased: void, Written: Hash, // Compare this state with another, returning true if they // represent the same written hash. Any other types will return // an error. pub fn sameHash(self: *const Self, other: *const Self) bool { switch (self.*) { .Written => |h1| { switch (other.*) { .Written => |h2| { return h1 == h2; }, else => return false, } }, else => return false, } } // Does this state indicate written data with the given has? pub fn isWritten(self: *const Self, hash: Hash) bool { switch (self.*) { .Written => |h| { return h == hash; }, else => {}, } return false; } }; // All operations are done at a sector level. Real devices would // likely perform multiple writes within each erase, but we only care // about state pub const Flash = struct { const Self = @This(); allocator: mem.Allocator, state: []State, counter: *Counter, pub fn init(allocator: mem.Allocator, total_sectors: usize, counter: *Counter) !Flash { var state = try allocator.alloc(State, total_sectors); mem.set(State, state, .Unsafe); return Flash{ .allocator = allocator, .state = state, .counter = counter, }; } pub fn deinit(self: *Self) void { self.allocator.free(self.state); } // Retrieve the given state, it is safe to read this state. pub fn readState(self: *const Self, sector: usize) State { switch (self.state[sector]) { .Unsafe => return .Erased, .Unwritten => |h| return .{ .Written = h }, else => |st| return st, } } // Perform an erase operation. pub fn erase(self: *Self, sector: usize) !void { self.state[sector] = .Unsafe; try self.counter.act(); self.state[sector] = .Erased; } // Perform a write operation. pub fn write(self: *Self, sector: usize, hash: Hash) !void { if (self.state[sector] != .Erased) { return error.InvalidWrite; } self.state[sector] = .{ .Unwritten = hash }; try self.counter.act(); self.state[sector] = .{ .Written = hash }; } // Perform a read operation. pub fn read(self: *Self, sector: usize) !Hash { switch (self.state[sector]) { .Written => |hash| return hash, else => return error.InvalidRead, } } };
nswap/src/flash.zig
const std = @import("std"); const testing = std.testing; const darts = @import("darts.zig"); test "missed target" { const coordinate = comptime darts.Coordinate.init(-9.0, 9.0); const expected = 0; const actual = comptime coordinate.score(); comptime testing.expectEqual(expected, actual); } test "on the outer circle" { const coordinate = comptime darts.Coordinate.init(0.0, 10.0); const expected = 1; const actual = comptime coordinate.score(); comptime testing.expectEqual(expected, actual); } test "on the middle circle" { const coordinate = comptime darts.Coordinate.init(-5.0, 0.0); const expected = 5; const actual = comptime coordinate.score(); comptime testing.expectEqual(expected, actual); } test "on the inner circle" { const coordinate = comptime darts.Coordinate.init(0.0, -1.0); const expected = 10; const actual = comptime coordinate.score(); comptime testing.expectEqual(expected, actual); } test "exactly on center" { const coordinate = comptime darts.Coordinate.init(0.0, 0.0); const expected = 10; const actual = comptime coordinate.score(); comptime testing.expectEqual(expected, actual); } test "near the center" { const coordinate = comptime darts.Coordinate.init(-0.1, -0.1); const expected = 10; const actual = comptime coordinate.score(); comptime testing.expectEqual(expected, actual); } test "just within the inner circle" { const coordinate = comptime darts.Coordinate.init(0.7, 0.7); const expected = 10; const actual = comptime coordinate.score(); comptime testing.expectEqual(expected, actual); } test "just outside the inner circle" { const coordinate = comptime darts.Coordinate.init(0.8, -0.8); const expected = 5; const actual = comptime coordinate.score(); comptime testing.expectEqual(expected, actual); } test "just within the middle circle" { const coordinate = comptime darts.Coordinate.init(3.5, -3.5); const expected = 5; const actual = comptime coordinate.score(); comptime testing.expectEqual(expected, actual); } test "just outside the middle circle" { const coordinate = comptime darts.Coordinate.init(-3.6, -3.6); const expected = 1; const actual = comptime coordinate.score(); comptime testing.expectEqual(expected, actual); } test "just within the outer circle" { const coordinate = comptime darts.Coordinate.init(-7.0, 7.0); const expected = 1; const actual = comptime coordinate.score(); comptime testing.expectEqual(expected, actual); } test "just outside the outer circle" { const coordinate = comptime darts.Coordinate.init(7.1, -7.1); const expected = 0; const actual = comptime coordinate.score(); comptime testing.expectEqual(expected, actual); } test "asymmetric position between the inner and middle circles" { const coordinate = comptime darts.Coordinate.init(0.5, -4.0); const expected = 5; const actual = comptime coordinate.score(); comptime testing.expectEqual(expected, actual); }
exercises/practice/darts/test_darts.zig
const std = @import("std"); const example_input = @embedFile("./example_input.txt"); const puzzle_input = @embedFile("./puzzle_input.txt"); pub fn main() !void { std.debug.print("--- Part One ---\n", .{}); std.debug.print("Result: {d}\n", .{part1(puzzle_input)}); std.debug.print("--- Part Two ---\n", .{}); std.debug.print("Result: {d}\n", .{part2(puzzle_input)}); } fn part1(input: []const u8) usize { var lines = std.mem.tokenize(u8, input, "\n"); var unique_digit_count: usize = 0; while (lines.next()) |line| { var parts = std.mem.split(u8, line, " | "); _ = parts.next(); var output_signals = std.mem.split(u8, parts.next().?, " "); while (output_signals.next()) |output_signal| { if (output_signal.len == 2 or output_signal.len == 3 or output_signal.len == 4 or output_signal.len == 7) { unique_digit_count += 1; } } } return unique_digit_count; } test "day08 part1 - example input" { try std.testing.expectEqual(@as(usize, 26), part1(example_input)); } test "day08 part1 - puzzle input" { try std.testing.expectEqual(@as(usize, 284), part1(puzzle_input)); } fn getSegments(input: []const u8) u7 { var segments: u7 = 0; for (input) |char| { segments |= @as(u7, 1) << @intCast(u3, char - 'a'); } return segments; } fn part2(input: []const u8) usize { var lines = std.mem.tokenize(u8, input, "\n"); var sum: usize = 0; while (lines.next()) |line| { var parts = std.mem.split(u8, line, " | "); var unique_signals = std.mem.split(u8, parts.next().?, " "); var one_pattern: u7 = undefined; var four_pattern: u7 = undefined; var seven_pattern: u7 = undefined; var eight_pattern: u7 = undefined; while (unique_signals.next()) |unique_signal| { const segments = getSegments(unique_signal); const bits_set = @popCount(u7, segments); if (bits_set == 2) one_pattern = segments; if (bits_set == 4) four_pattern = segments; if (bits_set == 3) seven_pattern = segments; if (bits_set == 7) eight_pattern = segments; } const cf_pattern: u7 = one_pattern; const eg_pattern: u7 = ~(seven_pattern | four_pattern); var digits: usize = 0; var base: usize = 1000; var output_signals = std.mem.split(u8, parts.next().?, " "); while (output_signals.next()) |output_signal| { const segments = getSegments(output_signal); const bits_set = @popCount(u7, segments); var digit: usize = blk: { if (segments == one_pattern) break :blk 1; if (segments == four_pattern) break :blk 4; if (segments == seven_pattern) break :blk 7; if (segments == eight_pattern) break :blk 8; if (bits_set == 5) { if (segments & eg_pattern == eg_pattern) { break :blk 2; } else { if (segments & cf_pattern == cf_pattern) { break :blk 3; } else { break :blk 5; } } } if (bits_set == 6) { if (segments & eg_pattern == eg_pattern) { if (segments & cf_pattern == cf_pattern) { break :blk 0; } else { break :blk 6; } } else { break :blk 9; } } unreachable; }; digits += digit * base; base /= 10; } sum += digits; } return sum; } test "day08 part2 - example input" { try std.testing.expectEqual(@as(usize, 61229), part2(example_input)); } test "day08 part2 - puzzle input" { try std.testing.expectEqual(@as(usize, 973_499), part2(puzzle_input)); }
src/day08/day08.zig
const std = @import("std"); const simd = @import("simd.zig"); const Allocator = std.mem.Allocator; const testing = std.testing; pub const Cookies = struct { pub const Cookie = struct { key: []const u8, value: []const u8, }; pub const List = std.ArrayList(Cookie); cookies: List, parsed: bool = false, pub fn init(allocator: *Allocator) Cookies { return Cookies{.cookies = List.init(allocator)}; } pub fn initCapacity(allocator: *Allocator, capacity: usize) !Cookies { return Cookies{ .cookies = try List.initCapacity(allocator, capacity), }; } // Parse up to capacity cookies pub fn parse(self: *Cookies, header: []const u8) !void { var it = simd.split(header, "; "); defer self.parsed = true; while (self.cookies.items.len < self.cookies.capacity) { const pair = it.next() orelse break; // Errors are ignored const pos = simd.indexOf(u8, pair, "=") orelse continue; const key = pair[0..pos]; const end = pos+1; if (pair.len > end) { const value = pair[end..]; self.cookies.appendAssumeCapacity( Cookie{.key=key, .value=value}); } } } pub fn lookup(self: Cookies, key: []const u8) !usize { for (self.cookies.items) |cookie, i| { if (std.mem.eql(u8, cookie.key, key)) return i; } return error.KeyError; } pub fn get(self: *Cookies, key: []const u8) ![]const u8 { const i = try self.lookup(key); return self.cookies.items[i].value; } pub fn getOptional(self: *Cookies, key: []const u8) ?[]const u8 { return self.get(key) catch null; } pub fn getDefault(self: *Cookies, key: []const u8, default: []const u8) []const u8 { return self.get(key) catch default; } pub fn contains(self: *Cookies, key: []const u8) bool { const v = self.lookup(key) catch |err| return false; return true; } pub fn reset(self: *Cookies) void { self.cookies.items.len = 0; self.parsed = false; } pub fn deinit(self: *Cookies) void { self.cookies.deinit(); } }; test "cookie-parse-api" { const header = "azk=ue1-5eb08aeed9a7401c9195cb933eb7c966"; var cookies = try Cookies.initCapacity(std.testing.allocator, 32); defer cookies.deinit(); try cookies.parse(header); // Not case sensitive try testing.expect(cookies.contains("azk")); try testing.expect(!cookies.contains("AZK")); try testing.expectEqualStrings( "ue1-5eb08aeed9a7401c9195cb933eb7c966", try cookies.get("azk")); try testing.expectEqual(cookies.getOptional("user"), null); try testing.expectEqualStrings("default", cookies.getDefault("user", "default")); } test "cookie-parse-multiple" { const header = "S_9994987=6754579095859875029; A4=01fmFvgRnI09SF00000; u2=d1263d39-874b-4a89-86cd-a2ab0860ed4e3Zl040"; var cookies = try Cookies.initCapacity(std.testing.allocator, 32); defer cookies.deinit(); try cookies.parse(header); try testing.expectEqualStrings("6754579095859875029", try cookies.get("S_9994987")); try testing.expectEqualStrings("01fmFvgRnI09SF00000", try cookies.get("A4")); try testing.expectEqualStrings("d1263d39-874b-4a89-86cd-a2ab0860ed4e3Zl040", try cookies.get("u2")); } test "cookie-parse-empty-ignored" { const header = "S_9994987=6754579095859875029; ; u2=d1263d39-874b-4a89-86cd-a2ab0860ed4e3Zl040"; var cookies = try Cookies.initCapacity(std.testing.allocator, 32); defer cookies.deinit(); try cookies.parse(header); try testing.expectEqualStrings("6754579095859875029", try cookies.get("S_9994987")); try testing.expectEqualStrings("d1263d39-874b-4a89-86cd-a2ab0860ed4e3Zl040", try cookies.get("u2")); }
packages/zhp/src/cookies.zig
const std = @import("std"); const ast = std.zig.ast; const mem = std.mem; /// Gets a declaration's doc comments, caller must free memory when a value is returned /// Like: ///```zig ///var comments = getFunctionDocComments(allocator, tree, func); ///defer if (comments) |comments_pointer| allocator.free(comments_pointer); ///``` pub fn getDocComments( allocator: *std.mem.Allocator, tree: ast.Tree, node: ast.Node.Index, ) !?[]const u8 { if (getDocCommentTokenIndex(tree, node)) |doc_comment_index| { return try collectDocComments(allocator, tree, doc_comment_index); } return null; } pub fn collectDocComments( allocator: *std.mem.Allocator, tree: ast.Tree, doc_comments: ast.TokenIndex, ) ![]const u8 { var lines = std.ArrayList([]const u8).init(allocator); defer lines.deinit(); const token_tags = tree.tokens.items(.tag); var curr_line_tok = doc_comments; while (true) : (curr_line_tok += 1) { switch (token_tags[curr_line_tok]) { .doc_comment, .container_doc_comment => { try lines.append(std.mem.trim(u8, tree.tokenSlice(curr_line_tok)[3..], &std.ascii.spaces)); }, else => break, } } return std.mem.join(allocator, "\n", lines.items); } pub fn getDocCommentTokenIndex(tree: ast.Tree, node: ast.Node.Index) ?ast.TokenIndex { const tags = tree.nodes.items(.tag); const tokens = tree.tokens.items(.tag); const current = tree.nodes.items(.main_token)[node]; var idx = current; if (idx == 0) return null; switch (tags[node]) { .fn_proto, .fn_proto_one, .fn_proto_simple, .fn_proto_multi, .fn_decl, => { idx -= 1; if (tokens[idx] == .keyword_extern and idx > 0) idx -= 1; if (tokens[idx] == .keyword_pub and idx > 0) idx -= 1; }, .local_var_decl, .global_var_decl, .aligned_var_decl, .simple_var_decl, => { idx -= 1; if (tokens[idx] == .keyword_pub and idx > 0) idx -= 1; }, else => idx -= 1, } // Find first doc comment token if (tokens[idx] == .doc_comment or tokens[idx] == .container_doc_comment) { while (idx > 0 and (tokens[idx] == .doc_comment or tokens[idx] == .container_doc_comment)) { idx -= 1; } return idx + @boolToInt(tokens[idx] != .doc_comment and tokens[idx] != .container_doc_comment); } return null; } /// Gets a function signature (keywords, name, return value) pub fn getFunctionSignature(tree: ast.Tree, func: ast.full.FnProto) []const u8 { const start = if (func.extern_export_inline_token) |ex| tokenLocation(tree, ex) else tokenLocation(tree, func.ast.fn_token); // return type can be 0 when user wrote incorrect fn signature // to ensure we don't break, just end the signature at end of fn token if (func.ast.return_type == 0) return tree.source[start.start..start.end]; const end = tokenLocation(tree, lastToken(tree, func.ast.return_type)).end; return tree.source[start.start..end]; } pub fn tokenLocation(tree: ast.Tree, token_index: ast.TokenIndex) Loc { const start = tree.tokens.items(.start)[token_index]; const tag = tree.tokens.items(.tag)[token_index]; // For some tokens, re-tokenization is needed to find the end. var tokenizer: std.zig.Tokenizer = .{ .buffer = tree.source, .index = start, .pending_invalid_token = null, }; const token = tokenizer.next(); std.debug.assert(token.tag == tag); return .{ .start = token.loc.start, .end = token.loc.end }; } /// Token location inside source pub const Loc = struct { start: usize, end: usize, }; // Updated version from std that allows for failures // by removing the unreachables and returning up to that point // so that we can always provide information while the user is still typing pub fn lastToken(tree: ast.Tree, node: ast.Node.Index) ast.TokenIndex { const Node = ast.Node; const TokenIndex = ast.TokenIndex; const tags = tree.nodes.items(.tag); const datas = tree.nodes.items(.data); const main_tokens = tree.nodes.items(.main_token); const token_starts = tree.tokens.items(.start); const token_tags = tree.tokens.items(.tag); var n = node; var end_offset: TokenIndex = 0; while (true) switch (tags[n]) { .root => return @intCast(TokenIndex, tree.tokens.len - 1), .@"usingnamespace", .bool_not, .negation, .bit_not, .negation_wrap, .address_of, .@"try", .@"await", .optional_type, .@"resume", .@"nosuspend", .@"comptime", => n = datas[n].lhs, .test_decl, .@"errdefer", .@"defer", .@"catch", .equal_equal, .bang_equal, .less_than, .greater_than, .less_or_equal, .greater_or_equal, .assign_mul, .assign_div, .assign_mod, .assign_add, .assign_sub, .assign_bit_shift_left, .assign_bit_shift_right, .assign_bit_and, .assign_bit_xor, .assign_bit_or, .assign_mul_wrap, .assign_add_wrap, .assign_sub_wrap, .assign, .merge_error_sets, .mul, .div, .mod, .array_mult, .mul_wrap, .add, .sub, .array_cat, .add_wrap, .sub_wrap, .bit_shift_left, .bit_shift_right, .bit_and, .bit_xor, .bit_or, .@"orelse", .bool_and, .bool_or, .anyframe_type, .error_union, .if_simple, .while_simple, .for_simple, .fn_proto_simple, .fn_proto_multi, .ptr_type_aligned, .ptr_type_sentinel, .ptr_type, .ptr_type_bit_range, .array_type, .switch_case_one, .switch_case, .switch_range, => n = datas[n].rhs, .field_access, .unwrap_optional, .grouped_expression, .multiline_string_literal, .error_set_decl, .asm_simple, .asm_output, .asm_input, .error_value, => return datas[n].rhs + end_offset, .@"anytype", .anyframe_literal, .char_literal, .integer_literal, .float_literal, .false_literal, .true_literal, .null_literal, .undefined_literal, .unreachable_literal, .identifier, .deref, .enum_literal, .string_literal, => return main_tokens[n] + end_offset, .@"return" => if (datas[n].lhs != 0) { n = datas[n].lhs; } else { return main_tokens[n] + end_offset; }, .call, .async_call => { end_offset += 1; // for the rparen const params = tree.extraData(datas[n].rhs, Node.SubRange); if (params.end - params.start == 0) { return main_tokens[n] + end_offset; } n = tree.extra_data[params.end - 1]; // last parameter }, .tagged_union_enum_tag => { const members = tree.extraData(datas[n].rhs, Node.SubRange); if (members.end - members.start == 0) { end_offset += 4; // for the rparen + rparen + lbrace + rbrace n = datas[n].lhs; } else { end_offset += 1; // for the rbrace n = tree.extra_data[members.end - 1]; // last parameter } }, .call_comma, .async_call_comma, .tagged_union_enum_tag_trailing, => { end_offset += 2; // for the comma/semicolon + rparen/rbrace const params = tree.extraData(datas[n].rhs, Node.SubRange); std.debug.assert(params.end > params.start); n = tree.extra_data[params.end - 1]; // last parameter }, .@"switch" => { const cases = tree.extraData(datas[n].rhs, Node.SubRange); if (cases.end - cases.start == 0) { end_offset += 3; // rparen, lbrace, rbrace n = datas[n].lhs; // condition expression } else { end_offset += 1; // for the rbrace n = tree.extra_data[cases.end - 1]; // last case } }, .container_decl_arg => { const members = tree.extraData(datas[n].rhs, Node.SubRange); if (members.end - members.start == 0) { end_offset += 3; // for the rparen + lbrace + rbrace n = datas[n].lhs; } else { end_offset += 1; // for the rbrace n = tree.extra_data[members.end - 1]; // last parameter } }, .@"asm" => { const extra = tree.extraData(datas[n].rhs, Node.Asm); return extra.rparen + end_offset; }, .array_init, .struct_init, => { const elements = tree.extraData(datas[n].rhs, Node.SubRange); std.debug.assert(elements.end - elements.start > 0); end_offset += 1; // for the rbrace n = tree.extra_data[elements.end - 1]; // last element }, .array_init_comma, .struct_init_comma, .container_decl_arg_trailing, .switch_comma, => { const members = tree.extraData(datas[n].rhs, Node.SubRange); std.debug.assert(members.end - members.start > 0); end_offset += 2; // for the comma + rbrace n = tree.extra_data[members.end - 1]; // last parameter }, .array_init_dot, .struct_init_dot, .block, .container_decl, .tagged_union, .builtin_call, => { std.debug.assert(datas[n].rhs - datas[n].lhs > 0); end_offset += 1; // for the rbrace n = tree.extra_data[datas[n].rhs - 1]; // last statement }, .array_init_dot_comma, .struct_init_dot_comma, .block_semicolon, .container_decl_trailing, .tagged_union_trailing, .builtin_call_comma, => { std.debug.assert(datas[n].rhs - datas[n].lhs > 0); end_offset += 2; // for the comma/semicolon + rbrace/rparen n = tree.extra_data[datas[n].rhs - 1]; // last member }, .call_one, .async_call_one, .array_access, => { end_offset += 1; // for the rparen/rbracket if (datas[n].rhs == 0) { return main_tokens[n] + end_offset; } n = datas[n].rhs; }, .array_init_dot_two, .block_two, .builtin_call_two, .struct_init_dot_two, .container_decl_two, .tagged_union_two, => { if (datas[n].rhs != 0) { end_offset += 1; // for the rparen/rbrace n = datas[n].rhs; } else if (datas[n].lhs != 0) { end_offset += 1; // for the rparen/rbrace n = datas[n].lhs; } else { switch (tags[n]) { .array_init_dot_two, .block_two, .struct_init_dot_two, => end_offset += 1, // rbrace .builtin_call_two => end_offset += 2, // lparen/lbrace + rparen/rbrace .container_decl_two => { var i: u32 = 2; // lbrace + rbrace while (token_tags[main_tokens[n] + i] == .container_doc_comment) i += 1; end_offset += i; }, .tagged_union_two => { var i: u32 = 5; // (enum) {} while (token_tags[main_tokens[n] + i] == .container_doc_comment) i += 1; end_offset += i; }, else => unreachable, } return main_tokens[n] + end_offset; } }, .array_init_dot_two_comma, .builtin_call_two_comma, .block_two_semicolon, .struct_init_dot_two_comma, .container_decl_two_trailing, .tagged_union_two_trailing, => { end_offset += 2; // for the comma/semicolon + rbrace/rparen if (datas[n].rhs != 0) { n = datas[n].rhs; } else if (datas[n].lhs != 0) { n = datas[n].lhs; } else { return main_tokens[n] + end_offset; // returns { } } }, .simple_var_decl => { if (datas[n].rhs != 0) { n = datas[n].rhs; } else if (datas[n].lhs != 0) { n = datas[n].lhs; } else { end_offset += 1; // from mut token to name return main_tokens[n] + end_offset; } }, .aligned_var_decl => { if (datas[n].rhs != 0) { n = datas[n].rhs; } else if (datas[n].lhs != 0) { end_offset += 1; // for the rparen n = datas[n].lhs; } else { end_offset += 1; // from mut token to name return main_tokens[n] + end_offset; } }, .global_var_decl => { if (datas[n].rhs != 0) { n = datas[n].rhs; } else { const extra = tree.extraData(datas[n].lhs, Node.GlobalVarDecl); if (extra.section_node != 0) { end_offset += 1; // for the rparen n = extra.section_node; } else if (extra.align_node != 0) { end_offset += 1; // for the rparen n = extra.align_node; } else if (extra.type_node != 0) { n = extra.type_node; } else { end_offset += 1; // from mut token to name return main_tokens[n] + end_offset; } } }, .local_var_decl => { if (datas[n].rhs != 0) { n = datas[n].rhs; } else { const extra = tree.extraData(datas[n].lhs, Node.LocalVarDecl); if (extra.align_node != 0) { end_offset += 1; // for the rparen n = extra.align_node; } else if (extra.type_node != 0) { n = extra.type_node; } else { end_offset += 1; // from mut token to name return main_tokens[n] + end_offset; } } }, .container_field_init => { if (datas[n].rhs != 0) { n = datas[n].rhs; } else if (datas[n].lhs != 0) { n = datas[n].lhs; } else { return main_tokens[n] + end_offset; } }, .container_field_align => { if (datas[n].rhs != 0) { end_offset += 1; // for the rparen n = datas[n].rhs; } else if (datas[n].lhs != 0) { n = datas[n].lhs; } else { return main_tokens[n] + end_offset; } }, .container_field => { const extra = tree.extraData(datas[n].rhs, Node.ContainerField); if (extra.value_expr != 0) { n = extra.value_expr; } else if (extra.align_expr != 0) { end_offset += 1; // for the rparen n = extra.align_expr; } else if (datas[n].lhs != 0) { n = datas[n].lhs; } else { return main_tokens[n] + end_offset; } }, .array_init_one, .struct_init_one, => { end_offset += 1; // rbrace if (datas[n].rhs == 0) { return main_tokens[n] + end_offset; } else { n = datas[n].rhs; } }, .slice_open, .call_one_comma, .async_call_one_comma, .array_init_one_comma, .struct_init_one_comma, => { end_offset += 2; // ellipsis2 + rbracket, or comma + rparen n = datas[n].rhs; std.debug.assert(n != 0); }, .slice => { const extra = tree.extraData(datas[n].rhs, Node.Slice); std.debug.assert(extra.end != 0); // should have used slice_open end_offset += 1; // rbracket n = extra.end; }, .slice_sentinel => { const extra = tree.extraData(datas[n].rhs, Node.SliceSentinel); std.debug.assert(extra.sentinel != 0); // should have used slice end_offset += 1; // rbracket n = extra.sentinel; }, .@"continue" => { if (datas[n].lhs != 0) { return datas[n].lhs + end_offset; } else { return main_tokens[n] + end_offset; } }, .@"break" => { if (datas[n].rhs != 0) { n = datas[n].rhs; } else if (datas[n].lhs != 0) { return datas[n].lhs + end_offset; } else { return main_tokens[n] + end_offset; } }, .fn_decl => { if (datas[n].rhs != 0) { n = datas[n].rhs; } else { n = datas[n].lhs; } }, .fn_proto_one => { const extra = tree.extraData(datas[n].lhs, Node.FnProtoOne); // linksection, callconv, align can appear in any order, so we // find the last one here. var max_node: Node.Index = datas[n].rhs; var max_start = token_starts[main_tokens[max_node]]; var max_offset: TokenIndex = 0; if (extra.align_expr != 0) { const start = token_starts[main_tokens[extra.align_expr]]; if (start > max_start) { max_node = extra.align_expr; max_start = start; max_offset = 1; // for the rparen } } if (extra.section_expr != 0) { const start = token_starts[main_tokens[extra.section_expr]]; if (start > max_start) { max_node = extra.section_expr; max_start = start; max_offset = 1; // for the rparen } } if (extra.callconv_expr != 0) { const start = token_starts[main_tokens[extra.callconv_expr]]; if (start > max_start) { max_node = extra.callconv_expr; max_start = start; max_offset = 1; // for the rparen } } n = max_node; end_offset += max_offset; }, .fn_proto => { const extra = tree.extraData(datas[n].lhs, Node.FnProto); // linksection, callconv, align can appear in any order, so we // find the last one here. var max_node: Node.Index = datas[n].rhs; var max_start = token_starts[main_tokens[max_node]]; var max_offset: TokenIndex = 0; if (extra.align_expr != 0) { const start = token_starts[main_tokens[extra.align_expr]]; if (start > max_start) { max_node = extra.align_expr; max_start = start; max_offset = 1; // for the rparen } } if (extra.section_expr != 0) { const start = token_starts[main_tokens[extra.section_expr]]; if (start > max_start) { max_node = extra.section_expr; max_start = start; max_offset = 1; // for the rparen } } if (extra.callconv_expr != 0) { const start = token_starts[main_tokens[extra.callconv_expr]]; if (start > max_start) { max_node = extra.callconv_expr; max_start = start; max_offset = 1; // for the rparen } } n = max_node; end_offset += max_offset; }, .while_cont => { const extra = tree.extraData(datas[n].rhs, Node.WhileCont); std.debug.assert(extra.then_expr != 0); n = extra.then_expr; }, .@"while" => { const extra = tree.extraData(datas[n].rhs, Node.While); std.debug.assert(extra.else_expr != 0); n = extra.else_expr; }, .@"if", .@"for" => { const extra = tree.extraData(datas[n].rhs, Node.If); std.debug.assert(extra.else_expr != 0); n = extra.else_expr; }, .@"suspend" => { if (datas[n].lhs != 0) { n = datas[n].lhs; } else { return main_tokens[n] + end_offset; } }, .array_type_sentinel => { const extra = tree.extraData(datas[n].rhs, Node.ArrayTypeSentinel); n = extra.elem_type; }, }; } pub fn fnProto(tree: ast.Tree, node: ast.Node.Index, buf: *[1]ast.Node.Index) ?ast.full.FnProto { return switch (tree.nodes.items(.tag)[node]) { .fn_proto => tree.fnProto(node), .fn_proto_multi => tree.fnProtoMulti(node), .fn_proto_one => tree.fnProtoOne(buf, node), .fn_proto_simple => tree.fnProtoSimple(buf, node), .fn_decl => fnProto(tree, tree.nodes.items(.data)[node].lhs, buf), else => null, }; } /// Gets a function signature (keywords, name, return value) pub fn getVariableSignature(tree: ast.Tree, var_decl: ast.full.VarDecl) []const u8 { const start = tokenLocation(tree, var_decl.ast.mut_token).start; const end = tokenLocation(tree, lastToken(tree, var_decl.ast.init_node)).end; return tree.source[start..end]; } /// Returns an `ast.full.VarDecl` for a given node index. /// Returns null if the tag doesn't match pub fn varDecl(tree: ast.Tree, node_idx: ast.Node.Index) ?ast.full.VarDecl { return switch (tree.nodes.items(.tag)[node_idx]) { .global_var_decl => tree.globalVarDecl(node_idx), .local_var_decl => tree.localVarDecl(node_idx), .aligned_var_decl => tree.alignedVarDecl(node_idx), .simple_var_decl => tree.simpleVarDecl(node_idx), else => null, }; } pub fn isNodePublic(tree: ast.Tree, node: ast.Node.Index) bool { var buf: [1]ast.Node.Index = undefined; return switch (tree.nodes.items(.tag)[node]) { .global_var_decl, .local_var_decl, .simple_var_decl, .aligned_var_decl, => varDecl(tree, node).?.visib_token != null, .fn_proto, .fn_proto_multi, .fn_proto_one, .fn_proto_simple, .fn_decl, => fnProto(tree, node, &buf).?.visib_token != null, else => true, }; } pub fn isTypeFunction(tree: ast.Tree, func: ast.full.FnProto) bool { return typeIsType(tree, func.ast.return_type); } /// The type node is "type" fn typeIsType(tree: ast.Tree, node: ast.Node.Index) bool { if (tree.nodes.items(.tag)[node] == .identifier) { return std.mem.eql(u8, tree.tokenSlice(tree.nodes.items(.main_token)[node]), "type"); } return false; } pub fn findReturnStatement(tree: ast.Tree, fn_decl: ast.full.FnProto, body: ast.Node.Index) ?ast.Node.Index { var already_found = false; return findReturnStatementInternal(tree, fn_decl, body, &already_found); } fn findReturnStatementInternal( tree: ast.Tree, fn_decl: ast.full.FnProto, body: ast.Node.Index, already_found: *bool, ) ?ast.Node.Index { var result: ?ast.Node.Index = null; const node_tags = tree.nodes.items(.tag); const datas = tree.nodes.items(.data); if (!isBlock(tree, body)) return null; const statements: []const ast.Node.Index = switch (node_tags[body]) { .block, .block_semicolon => tree.extra_data[datas[body].lhs..datas[body].rhs], .block_two, .block_two_semicolon => blk: { const statements = &[_]ast.Node.Index{ datas[body].lhs, datas[body].rhs }; const len: usize = if (datas[body].lhs == 0) @as(usize, 0) else if (datas[body].rhs == 0) @as(usize, 1) else @as(usize, 2); break :blk statements[0..len]; }, else => unreachable, }; for (statements) |child_idx| { if (node_tags[child_idx] == .@"return") { if (datas[child_idx].lhs != 0) { const lhs = datas[child_idx].lhs; if (isCall(tree, lhs)) { const call_name = getDeclName(tree, datas[lhs].lhs); if (call_name) |name| { if (std.mem.eql(u8, name, tree.tokenSlice(fn_decl.name_token.?))) { continue; } } } } if (already_found.*) return null; already_found.* = true; result = child_idx; continue; } result = findReturnStatementInternal(tree, fn_decl, child_idx, already_found); } return result; } fn isBlock(tree: ast.Tree, node: ast.Node.Index) bool { return switch (tree.nodes.items(.tag)[node]) { .block, .block_semicolon, .block_two, .block_two_semicolon, => true, else => false, }; } /// Returns `true` when the given `node` is one of the call tags fn isCall(tree: ast.Tree, node: ast.Node.Index) bool { return switch (tree.nodes.items(.tag)[node]) { .call, .call_comma, .call_one, .call_one_comma, .async_call, .async_call_comma, .async_call_one, .async_call_one_comma, => true, else => false, }; } fn getDeclName(tree: ast.Tree, node: ast.Node.Index) ?[]const u8 { const name = tree.tokenSlice(getDeclNameToken(tree, node) orelse return null); return switch (tree.nodes.items(.tag)[node]) { .test_decl => name[1 .. name.len - 1], else => name, }; } pub fn getDeclNameToken(tree: ast.Tree, node: ast.Node.Index) ?ast.TokenIndex { const tags = tree.nodes.items(.tag); const main_token = tree.nodes.items(.main_token)[node]; return switch (tags[node]) { // regular declaration names. + 1 to mut token because name comes after 'const'/'var' .local_var_decl => tree.localVarDecl(node).ast.mut_token + 1, .global_var_decl => tree.globalVarDecl(node).ast.mut_token + 1, .simple_var_decl => tree.simpleVarDecl(node).ast.mut_token + 1, .aligned_var_decl => tree.alignedVarDecl(node).ast.mut_token + 1, // function declaration names .fn_proto, .fn_proto_multi, .fn_proto_one, .fn_proto_simple, .fn_decl, => blk: { var params: [1]ast.Node.Index = undefined; break :blk fnProto(tree, node, &params).?.name_token; }, // containers .container_field => tree.containerField(node).ast.name_token, .container_field_init => tree.containerFieldInit(node).ast.name_token, .container_field_align => tree.containerFieldAlign(node).ast.name_token, .identifier => main_token, .error_value => main_token + 2, // 'error'.<main_token +2> // lhs of main token is name token, so use `node` - 1 .test_decl => if (tree.tokens.items(.tag)[main_token + 1] == .string_literal) return main_token + 1 else null, else => null, }; } // stolen from zig-doctest :^P pub fn escapeHtml(allocator: *mem.Allocator, input: []const u8) ![]u8 { var buf = std.ArrayList(u8).init(allocator); defer buf.deinit(); const out = buf.writer(); try writeEscaped(out, input); return buf.toOwnedSlice(); } pub fn writeEscaped(out: anytype, input: []const u8) !void { for (input) |c| { try switch (c) { '&' => out.writeAll("&amp;"), '<' => out.writeAll("&lt;"), '>' => out.writeAll("&gt;"), '"' => out.writeAll("&quot;"), else => out.writeByte(c), }; } } pub fn highlightZigCode(raw_src: []const u8, out: anytype, pre: bool) !void { // TODO: who should be doing this cleanup? const src = mem.trim(u8, raw_src, " \n"); if (pre) try out.writeAll("<pre><code class=\"zig\">") else try out.writeAll("<code class=\"zig\">"); var tokenizer = std.zig.Tokenizer.init(src); var index: usize = 0; var next_tok_is_fn = false; while (true) { const prev_tok_was_fn = next_tok_is_fn; next_tok_is_fn = false; const token = tokenizer.next(); try writeEscaped(out, src[index..token.loc.start]); switch (token.tag) { .eof => break, .keyword_align, .keyword_and, .keyword_asm, .keyword_async, .keyword_await, .keyword_break, .keyword_catch, .keyword_comptime, .keyword_const, .keyword_continue, .keyword_defer, .keyword_else, .keyword_enum, .keyword_errdefer, .keyword_error, .keyword_export, .keyword_extern, .keyword_for, .keyword_if, .keyword_inline, .keyword_noalias, .keyword_noinline, .keyword_nosuspend, .keyword_opaque, .keyword_or, .keyword_orelse, .keyword_packed, .keyword_anyframe, .keyword_pub, .keyword_resume, .keyword_return, .keyword_linksection, .keyword_callconv, .keyword_struct, .keyword_suspend, .keyword_switch, .keyword_test, .keyword_threadlocal, .keyword_try, .keyword_union, .keyword_unreachable, .keyword_usingnamespace, .keyword_var, .keyword_volatile, .keyword_allowzero, .keyword_while, .keyword_anytype, => { try out.writeAll("<span class=\"tok tok-kw\">"); try writeEscaped(out, src[token.loc.start..token.loc.end]); try out.writeAll("</span>"); }, .keyword_fn => { try out.writeAll("<span class=\"tok tok-kw\">"); try writeEscaped(out, src[token.loc.start..token.loc.end]); try out.writeAll("</span>"); next_tok_is_fn = true; }, .keyword_undefined, .keyword_null, .keyword_true, .keyword_false, => { try out.writeAll("<span class=\"tok tok-null\">"); try writeEscaped(out, src[token.loc.start..token.loc.end]); try out.writeAll("</span>"); }, .string_literal, .multiline_string_literal_line, .char_literal, => { try out.writeAll("<span class=\"tok tok-str\">"); try writeEscaped(out, src[token.loc.start..token.loc.end]); try out.writeAll("</span>"); }, .builtin => { try out.writeAll("<span class=\"tok tok-builtin\">"); try writeEscaped(out, src[token.loc.start..token.loc.end]); try out.writeAll("</span>"); }, .doc_comment, .container_doc_comment, => { try out.writeAll("<span class=\"tok tok-comment\">"); try writeEscaped(out, src[token.loc.start..token.loc.end]); try out.writeAll("</span>"); }, .identifier => { if (prev_tok_was_fn) { try out.writeAll("<span class=\"tok tok-fn\">"); try writeEscaped(out, src[token.loc.start..token.loc.end]); try out.writeAll("</span>"); } else { const is_int = blk: { if (src[token.loc.start] != 'i' and src[token.loc.start] != 'u') break :blk false; var i = token.loc.start + 1; if (i == token.loc.end) break :blk false; while (i != token.loc.end) : (i += 1) { if (src[i] < '0' or src[i] > '9') break :blk false; } break :blk true; }; if (is_int or isType(src[token.loc.start..token.loc.end])) { try out.writeAll("<span class=\"tok tok-type\">"); try writeEscaped(out, src[token.loc.start..token.loc.end]); try out.writeAll("</span>"); } else { try out.writeAll("<span class=\"tok\">"); try writeEscaped(out, src[token.loc.start..token.loc.end]); try out.writeAll("</span>"); } } }, .integer_literal, .float_literal, => { try out.writeAll("<span class=\"tok tok-number\">"); try writeEscaped(out, src[token.loc.start..token.loc.end]); try out.writeAll("</span>"); }, .bang, .pipe, .pipe_pipe, .pipe_equal, .equal, .equal_equal, .equal_angle_bracket_right, .bang_equal, .l_paren, .r_paren, .semicolon, .percent, .percent_equal, .l_brace, .r_brace, .l_bracket, .r_bracket, .period, .period_asterisk, .ellipsis2, .ellipsis3, .caret, .caret_equal, .plus, .plus_plus, .plus_equal, .plus_percent, .plus_percent_equal, .minus, .minus_equal, .minus_percent, .minus_percent_equal, .asterisk, .asterisk_equal, .asterisk_asterisk, .asterisk_percent, .asterisk_percent_equal, .arrow, .colon, .slash, .slash_equal, .comma, .ampersand, .ampersand_equal, .question_mark, .angle_bracket_left, .angle_bracket_left_equal, .angle_bracket_angle_bracket_left, .angle_bracket_angle_bracket_left_equal, .angle_bracket_right, .angle_bracket_right_equal, .angle_bracket_angle_bracket_right, .angle_bracket_angle_bracket_right_equal, .tilde, => { try out.writeAll("<span class=\"tok tok-symbol\">"); try writeEscaped(out, src[token.loc.start..token.loc.end]); try out.writeAll("</span>"); }, .invalid, .invalid_ampersands, .invalid_periodasterisks => {}, // do nothing on parse error } index = token.loc.end; } if (pre) try out.writeAll("</code></pre>") else try out.writeAll("</code>"); } const builtin_types = [_][]const u8{ "f16", "f32", "f64", "f128", "c_longdouble", "c_short", "c_ushort", "c_int", "c_uint", "c_long", "c_ulong", "c_longlong", "c_ulonglong", "c_char", "c_void", "void", "bool", "isize", "usize", "noreturn", "type", "anyerror", "comptime_int", "comptime_float", }; fn isType(name: []const u8) bool { for (builtin_types) |t| { if (mem.eql(u8, t, name)) return true; } return false; }
src/utils.zig
const std = @import("std"); const dbgLog_ = @import("Log.zig").dbgLog; const startsWith = std.mem.startsWith; const eql = std.mem.eql; const parse = @import("Parse.zig"); pub fn dbgLog(comptime s: []const u8, args: var) void { dbgLog_("HTTPS: " ++ s, args); } pub const RequestType = enum(u32) { OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT }; const request_type_strings = [_]([]const u8){ "OPTIONS ", "GET ", "HEAD ", "POST ", "PUT ", "DELETE ", "TRACE ", "CONNECT ", }; pub fn getRequestType(s: *([]const u8)) !RequestType { var i: u32 = 0; while (i < request_type_strings.len) : (i += 1) { if (startsWith(u8, s.*, request_type_strings[i])) { s.* = s.*[request_type_strings[i].len..]; return @intToEnum(RequestType, i); } } dbgLog("Unknown HTTP request type: {}", .{s.*[0..std.math.min(10, s.*.len)]}); return error.RequestTypeNotRecognised; } pub fn getRequestURL(s: *([]const u8)) ![]const u8 { try parse.skipWhitespace(s); const url_length = try parse.strLenNonWhitespace(s.*); const url = s.*[0..url_length]; s.* = s.*[url_length..]; return url; } // Returns HTTP version (0 = 1.0, 1 = 1.1) pub fn verifyHTTPVersion(s: *([]const u8)) !u1 { try parse.skipWhitespace(s); const http_version_length = try parse.strLenNonWhitespace(s.*); const http_version = s.*[0..http_version_length]; var v: u1 = 1; if (eql(u8, http_version, "HTTP/1.1")) { v = 1; } else if (eql(u8, http_version, "HTTP/1.0")) { v = 0; } else { dbgLog("Expected HTTP/1.1 or HTTP/1.0, got {}", .{http_version}); return error.InvalidHTTPVersion; } s.* = s.*[http_version_length..]; return v; } // Returns null when the end of the request is reached (or if reached end of buffer) // Whitespace is not removed pub fn getNextHeaderField(s: *([]const u8)) !?[]const u8 { try parse.skipNewline(s); const line_length = try parse.getLineLen(s.*); if (line_length == 0) { s.* = s.*[1..]; return null; } const line = s.*[0..line_length]; s.* = s.*[line_length..]; return line; } // E.g. // header: "Connection: close" // expected_header_name: "connection" // Returns: "close" pub fn getHeader(header_: []const u8, expected_header_name: []const u8) ?[]const u8 { var header = header_; if (header.len < expected_header_name.len + 2) { return null; } if (!parse.caseInsensitiveStartsWith(header, expected_header_name)) { return null; } header = header[expected_header_name.len..]; if (header[0] != ':') { return null; } header = header[1..]; parse.skipWhitespace(&header) catch {}; return header; }
src/HTTPMessageParser.zig
const std = @import("std"); const print = std.debug.print; const util = @import("util.zig"); const gpa = util.gpa; const data = @embedFile("../data/day10.txt"); pub fn main() !void { var timer = try std.time.Timer.start(); var lines = std.mem.tokenize(data, "\r\n"); var chunks = std.ArrayList(u8).init(gpa); defer { chunks.deinit(); } var scores = std.ArrayList(u64).init(gpa); defer { scores.deinit(); } var total : u32 = 0; while (lines.next()) |line| { var syntaxError = false; for (line) |c| { switch (c) { '(', '[', '{', '<' => try chunks.append(c), ')' => { const pop = chunks.popOrNull(); if (pop == null or pop.? != '(') { total += 3; syntaxError = true; break; } }, ']' => { const pop = chunks.popOrNull(); if (pop == null or pop.? != '[') { total += 57; syntaxError = true; break; } }, '}' => { const pop = chunks.popOrNull(); if (pop == null or pop.? != '{') { total += 1197; syntaxError = true; break; } }, '>' => { const pop = chunks.popOrNull(); if (pop == null or pop.? != '<') { total += 25137; syntaxError = true; break; } }, else => unreachable, } } // We need to skip any corrupted ones, and only score the incomplete ones. if (syntaxError) { // We're reusing chunks for each line check, so clear it for the next one! chunks.clearRetainingCapacity(); continue; } var score : u64 = 0; while (chunks.items.len != 0) { score *= 5; switch (chunks.pop()) { '(' => score += 1, '[' => score += 2, '{' => score += 3, '<' => score += 4, else => unreachable } } try scores.append(score); } { print("🎁 Syntax error: {}\n", .{total}); print("Day 10 - part 01 took {:15}ns\n", .{timer.lap()}); timer.reset(); } std.sort.sort(u64, scores.items, {}, compare); const middle = scores.items[scores.items.len / 2]; { print("🎁 Middle score: {}\n", .{middle}); print("Day 10 - part 02 took {:15}ns\n", .{timer.lap()}); print("❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️❄️\n", .{}); } } fn compare(context: void, a: u64, b: u64) bool { return a < b; }
src/day10.zig
usingnamespace @import("root").preamble; const platform = os.platform; const libalign = lib.util.libalign; const range = lib.util.range.range; const rangeReverse = lib.util.range.rangeReverse; const pmm = os.memory.pmm; const Context = *platform.paging.PagingContext; const MapError = error{ AlreadyPresent, OutOfMemory, PhysAllocTooSmall, }; pub const Perms = struct { writable: bool, executable: bool, userspace: bool = false, pub fn allows(self: @This(), other: @This()) bool { if (!self.writable and other.writable) return false; if (!self.executable and other.executable) return false; if (!self.userspace and other.userspace) return false; return true; } pub fn addPerms(self: @This(), other: @This()) @This() { return .{ .writable = self.writable or other.writable, .executable = self.executable or other.executable, .userspace = self.userspace or other.userspace, }; } }; extern var __kernel_text_begin: u8; extern var __kernel_text_end: u8; extern var __kernel_data_begin: u8; extern var __kernel_data_end: u8; extern var __kernel_rodata_begin: u8; extern var __kernel_rodata_end: u8; extern var __bootstrap_stack_bottom: u8; extern var __bootstrap_stack_top: u8; pub var kernel_context: os.platform.paging.PagingContext = undefined; fn mapKernelSection(new_paging_context: Context, start: *u8, end: *u8, perm: Perms) !void { const virt = @ptrToInt(start); const phys = os.vital(translateVirt(.{ .virt = virt }), "Translating kaddr"); const region_size = @ptrToInt(end) - virt; os.vital(mapPhys(.{ .virt = virt, .phys = phys, .size = region_size, .perm = perm, .memtype = .MemoryWriteBack, .context = new_paging_context, }), "Mapping kernel section"); } /// Tries to map the range. If the mapping fails, /// it unmaps any memory it has touched. fn mapImplWithRollback(args: struct { virt: *usize, phys: ?*usize, size: *usize, perm: Perms, memtype: platform.paging.MemoryType, context: Context, }) !void { const start_virt = args.virt.*; if (!is_aligned(args.virt.*, args.phys, 0, args.context) or !libalign.isAligned(usize, os.platform.paging.page_sizes[0], args.size.*)) { // virt, phys and size all need to be aligned return error.BadAlignment; } errdefer { // Roll it back if (start_virt != args.virt.*) { unmap(.{ .virt = start_virt, .size = args.virt.* - start_virt, .reclaim_pages = args.phys == null, .context = args.context, }); } } const root = args.context.root_table(args.virt.*); try mapImpl(args.virt, args.phys, args.size, root, args.perm, args.memtype, args.context); if (args.size.* != 0) return error.IncompleteMapping; } fn is_aligned(virt: usize, phys: ?*usize, level: anytype, context: Context) bool { if (!libalign.isAligned(usize, os.platform.paging.page_sizes[level], virt)) return false; if (phys) |p| return libalign.isAligned(usize, os.platform.paging.page_sizes[level], p.*); return true; } fn mapImpl( virt: *usize, phys: ?*usize, size: *usize, table: anytype, perm: Perms, memtype: platform.paging.MemoryType, context: Context, ) MapError!void { var curr = table; const children = table.skip_to(virt.*); for (children) |*child| { switch (table.decode_child(child)) { .Mapping => return error.AlreadyPresent, .Table => |*tbl| { try mapImpl(virt, phys, size, tbl.*, perm, memtype, context); if (!tbl.perms.allows(perm)) { tbl.addPerms(perm); context.invalidate(virt.*); } }, .Empty => { const dom = table.child_domain(virt.*); // Should we map at the current level? if (dom.ptr == virt.* and dom.len <= size.* and context.can_map_at_level(table.level() - 1) and is_aligned(virt.*, phys, table.level() - 1, context)) { const m = try table.make_child_mapping(child, if (phys) |p| p.* else null, perm, memtype); const step = dom.len; if (step >= size.*) { size.* = 0; return; } else { size.* -= step; virt.* += step; if (phys) |p| p.* += step; } } else { const tbl = try table.make_child_table(child, perm); try mapImpl(virt, phys, size, tbl, perm, memtype, context); } }, } if (size.* == 0) return; } } fn translateVirtImpl( virt: usize, table: anytype, context: Context, ) error{NotPresent}!usize { const child = table.decode_child(&table.skip_to(virt)[0]); const dom = table.child_domain(virt); switch (child) { .Empty => return error.NotPresent, .Mapping => |m| return m.mapped_bytes().ptr + virt - dom.ptr, .Table => |t| return translateVirtImpl(virt, t, context), } } fn unmapLoop( virt: *usize, size: *usize, reclaim_pages: bool, context: Context, ) bool { const root = context.root_table(virt.*); var any_invalidated = false; while (size.* != 0) { if (unmapIter(virt, size, reclaim_pages, root, context)) any_invalidated = true; } return any_invalidated; } fn unmapIter( virt: *usize, size: *usize, reclaim_pages: bool, table: anytype, context: Context, ) bool { var any_invalidated = false; for (table.skip_to(virt.*)) |*child| { const dom = table.child_domain(virt.*); switch (table.decode_child(child)) { .Empty => { if (dom.len >= size.*) { size.* = 0; return any_invalidated; } virt.* += dom.len; size.* -= dom.len; }, .Table => |tbl| if (unmapIter(virt, size, reclaim_pages, tbl, context)) { any_invalidated = true; }, .Mapping => |mapping| { if (dom.len > size.* or dom.ptr != virt.*) @panic("No partial unmapping"); if (reclaim_pages) pmm.freePhys(mapping.phys, dom.len); child.* = context.encode_empty(mapping.level); context.invalidate(virt.*); any_invalidated = true; virt.* += dom.len; size.* -= dom.len; }, } if (size.* == 0) return any_invalidated; } return any_invalidated; } // fn printImpl(root: *page_table, comptime level: usize) void { // var offset: u32 = 0; // var had_any: bool = false; // while (offset < platform.paging.page_sizes[0]) : (offset += 8) { // const ent = @intToPtr(*page_table_entry, @ptrToInt(root) + offset); // if (ent.is_present(level)) { // had_any = true; // var cnt = paging_levels - level - 1; // while (cnt != 0) { // log(" ", .{}); // cnt -= 1; // } // log("Index {x:0>3}: {}\n", .{ offset / 8, ent }); // if (level != 0) { // if (ent.is_table(level)) // printImpl(ent.get_table(level) catch unreachable, level - 1); // } // } // } // if (!had_any) { // var cnt = paging_levels - level - 1; // while (cnt != 0) { // log(" ", .{}); // cnt -= 1; // } // log("Empty table\n", .{}); // } // } pub fn init() void { os.platform.paging.PagingContext.read_current(); } pub fn map(args: struct { virt: usize, size: usize, perm: Perms, memtype: platform.paging.MemoryType, context: Context = &kernel_context, }) !void { var argc = args; return mapImplWithRollback(.{ .virt = &argc.virt, .phys = null, .size = &argc.size, .context = argc.context, .perm = argc.perm, .memtype = argc.memtype, }); } pub fn mapPhys(args: struct { virt: usize, phys: usize, size: usize, perm: Perms, memtype: platform.paging.MemoryType, context: Context = &kernel_context, }) !void { var argc = args; return mapImplWithRollback(.{ .virt = &argc.virt, .phys = &argc.phys, .size = &argc.size, .context = argc.context, .perm = argc.perm, .memtype = argc.memtype, }); } pub fn unmap(args: struct { virt: usize, size: usize, reclaim_pages: bool, context: Context = &kernel_context, }) void { var argc = args; if (unmapLoop(&argc.virt, &argc.size, argc.reclaim_pages, argc.context)) args.context.invalidateOtherCPUs(args.virt, args.size); } pub fn rx() Perms { return .{ .writable = false, .executable = true, }; } pub fn ro() Perms { return .{ .writable = false, .executable = false, }; } pub fn rw() Perms { return .{ .writable = true, .executable = false, }; } pub fn rwx() Perms { return .{ .writable = true, .executable = true, }; } pub fn user(p: Perms) Perms { var ret = p; ret.userspace = true; return ret; } pub fn getCurrentPagingRoot() platform.paging_root { return platform.current_paging_root(); } pub fn setContext(new_context: Context) !void { new_context.apply(); kernel_context = new_context.*; } pub fn bootstrapKernelPaging() !platform.paging.PagingContext { // Setup some paging var new_context = try platform.paging.PagingContext.make_default(); try mapKernelSection(&new_context, &__kernel_text_begin, &__kernel_text_end, rx()); try mapKernelSection(&new_context, &__kernel_data_begin, &__kernel_data_end, rw()); try mapKernelSection(&new_context, &__kernel_rodata_begin, &__kernel_rodata_end, ro()); try mapKernelSection(&new_context, &__bootstrap_stack_bottom, &__bootstrap_stack_top, rw()); return new_context; } pub fn mapPhysmem(args: struct { context: Context, map_limit: usize, }) !void { // Map once with each memory type try mapPhys(.{ .virt = args.context.physToWriteBackVirt(0), .phys = 0, .size = args.map_limit, .perm = rw(), .context = args.context, .memtype = .MemoryWriteBack, }); try mapPhys(.{ .virt = args.context.physToWriteCombiningVirt(0), .phys = 0, .size = args.map_limit, .perm = rw(), .context = args.context, .memtype = .DeviceWriteCombining, }); try mapPhys(.{ .virt = args.context.physToUncachedVirt(0), .phys = 0, .size = args.map_limit, .perm = rw(), .context = args.context, .memtype = .DeviceUncacheable, }); } pub fn translateVirt(args: struct { virt: usize, context: Context = &kernel_context, }) !usize { const root = args.context.root_table(args.virt); return translateVirtImpl(args.virt, root, args.context); } // pub fn printPaging(root: *platform.PagingRoot) void { // log("Paging: {x}\n", .{root}); // for (platform.root_tables(root)) |table| { // log("Dumping page tables from root {x}\n", .{table}); // printImpl(table, paging_levels - 1); // } // } pub fn switchToContext(context: Context) void { const state = os.platform.get_and_disable_interrupts(); context.apply(); os.platform.get_current_task().paging_context = context; os.platform.set_interrupts(state); } pub fn physToUncachedVirt(phys: usize) usize { return kernel_context.physToUncachedVirt(phys); } pub fn physToWriteCombiningVirt(phys: usize) usize { return kernel_context.physToWriteCombiningVirt(phys); } pub fn physToWriteBackVirt(phys: usize) usize { return kernel_context.physToWriteBackVirt(phys); }
subprojects/flork/src/memory/paging.zig
const std = @import("std"); const json = std.json; const mem = std.mem; const zfetch = @import("zfetch"); const Host = @import("hosts.zig").Host; const AyArgparse = @import("ay-arg"); pub fn printVersion(writer: anytype) !void { try writer.writeAll("scafetch v0.2\n"); } pub fn printHelp(writer: anytype) !void { try printVersion(writer); try writer.writeAll( \\usage: scafetch <author>/<repository> \\ \\ -o, --host <host> Select the host server, accepted values are \\ github (default), gitlab and codeberg \\ -h, --help Show this help message \\ -v, --version Show the app version \\ \\ ); } pub fn main() anyerror!void { var gpa = std.heap.GeneralPurposeAllocator(.{}){}; const allocator = gpa.allocator(); defer _ = gpa.deinit(); const stdout_file = std.io.getStdOut(); const stdout = std.io.getStdOut().writer(); const args = try std.process.argsAlloc(allocator); defer std.process.argsFree(allocator, args); const params = &[_]AyArgparse.ParamDesc{ .{ .long = "host", .short = "o", .need_value = true }, .{ .long = "version", .short = "v" }, .{ .long = "help", .short = "h" }, }; if (args.len < 2) { try printHelp(stdout); std.process.exit(0); } var ap = AyArgparse.init(allocator, params[0..]); defer ap.deinit(); try ap.parse(args[1..]); if (ap.arguments.get("version")) |_| { try printVersion(stdout); std.process.exit(0); } if (ap.arguments.get("help")) |_| { try printHelp(stdout); std.process.exit(0); } try zfetch.init(); defer zfetch.deinit(); const project = ap.positionals.items[0]; var host_tag: Host = if (ap.arguments.get("host")) |h| std.meta.stringToEnum(Host, h) orelse { try printHelp(stdout); std.log.err("unknown host name: {s}\n", .{h}); std.process.exit(1); } else .default; const url = if (mem.startsWith(u8, project, "http:") or mem.startsWith(u8, project, "https:")) blk: { break :blk try allocator.dupe(u8, project); } else blk: { var tokenizer = std.mem.tokenize(u8, project, "/"); var author_name: []const u8 = undefined; var project_name: []const u8 = undefined; switch (std.mem.count(u8, project, "/")) { 1 => { author_name = tokenizer.next().?; project_name = tokenizer.rest(); }, 2 => { const host_name = tokenizer.next().?; author_name = tokenizer.next().?; project_name = tokenizer.rest(); if (Host.match(host_name)) |host| { if (host_tag != .default and host != host_tag) { try printHelp(stdout); std.log.err("mismatched host name in argument and in url", .{}); std.process.exit(1); } host_tag = host; } }, else => { try printHelp(stdout); std.log.err("malformed url/project name", .{}); std.process.exit(1); }, } break :blk try Host.getUrl(host_tag, allocator, author_name, project_name); }; defer allocator.free(url); var info = try Host.request(host_tag, allocator, url); defer info.free(allocator); try info.print(stdout_file); std.log.info("All your repo stats are belong to us.", .{}); }
src/main.zig
pub const TSF_Hardware = @as(u32, 1); pub const TSF_Authenticated = @as(u32, 2); pub const TSF_IPv6 = @as(u32, 4); pub const TSF_SignatureAuthenticated = @as(u32, 8); //-------------------------------------------------------------------------------- // Section: Types (2) //-------------------------------------------------------------------------------- pub const TIME_ZONE_INFORMATION = extern struct { Bias: i32, StandardName: [32]u16, StandardDate: SYSTEMTIME, StandardBias: i32, DaylightName: [32]u16, DaylightDate: SYSTEMTIME, DaylightBias: i32, }; pub const DYNAMIC_TIME_ZONE_INFORMATION = extern struct { Bias: i32, StandardName: [32]u16, StandardDate: SYSTEMTIME, StandardBias: i32, DaylightName: [32]u16, DaylightDate: SYSTEMTIME, DaylightBias: i32, TimeZoneKeyName: [128]u16, DynamicDaylightTimeDisabled: BOOLEAN, }; //-------------------------------------------------------------------------------- // Section: Functions (15) //-------------------------------------------------------------------------------- // TODO: this type is limited to platform 'windows5.0' pub extern "KERNEL32" fn SystemTimeToTzSpecificLocalTime( lpTimeZoneInformation: ?*const TIME_ZONE_INFORMATION, lpUniversalTime: ?*const SYSTEMTIME, lpLocalTime: ?*SYSTEMTIME, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "KERNEL32" fn TzSpecificLocalTimeToSystemTime( lpTimeZoneInformation: ?*const TIME_ZONE_INFORMATION, lpLocalTime: ?*const SYSTEMTIME, lpUniversalTime: ?*SYSTEMTIME, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "KERNEL32" fn FileTimeToSystemTime( lpFileTime: ?*const FILETIME, lpSystemTime: ?*SYSTEMTIME, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows5.0' pub extern "KERNEL32" fn SystemTimeToFileTime( lpSystemTime: ?*const SYSTEMTIME, lpFileTime: ?*FILETIME, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows5.0' pub extern "KERNEL32" fn GetTimeZoneInformation( lpTimeZoneInformation: ?*TIME_ZONE_INFORMATION, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows5.0' pub extern "KERNEL32" fn SetTimeZoneInformation( lpTimeZoneInformation: ?*const TIME_ZONE_INFORMATION, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "KERNEL32" fn SetDynamicTimeZoneInformation( lpTimeZoneInformation: ?*const DYNAMIC_TIME_ZONE_INFORMATION, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "KERNEL32" fn GetDynamicTimeZoneInformation( pTimeZoneInformation: ?*DYNAMIC_TIME_ZONE_INFORMATION, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "KERNEL32" fn GetTimeZoneInformationForYear( wYear: u16, pdtzi: ?*DYNAMIC_TIME_ZONE_INFORMATION, ptzi: ?*TIME_ZONE_INFORMATION, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows8.0' pub extern "ADVAPI32" fn EnumDynamicTimeZoneInformation( dwIndex: u32, lpTimeZoneInformation: ?*DYNAMIC_TIME_ZONE_INFORMATION, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "ADVAPI32" fn GetDynamicTimeZoneInformationEffectiveYears( lpTimeZoneInformation: ?*const DYNAMIC_TIME_ZONE_INFORMATION, FirstYear: ?*u32, LastYear: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "KERNEL32" fn SystemTimeToTzSpecificLocalTimeEx( lpTimeZoneInformation: ?*const DYNAMIC_TIME_ZONE_INFORMATION, lpUniversalTime: ?*const SYSTEMTIME, lpLocalTime: ?*SYSTEMTIME, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows6.1' pub extern "KERNEL32" fn TzSpecificLocalTimeToSystemTimeEx( lpTimeZoneInformation: ?*const DYNAMIC_TIME_ZONE_INFORMATION, lpLocalTime: ?*const SYSTEMTIME, lpUniversalTime: ?*SYSTEMTIME, ) callconv(@import("std").os.windows.WINAPI) BOOL; pub extern "KERNEL32" fn LocalFileTimeToLocalSystemTime( timeZoneInformation: ?*const TIME_ZONE_INFORMATION, localFileTime: ?*const FILETIME, localSystemTime: ?*SYSTEMTIME, ) callconv(@import("std").os.windows.WINAPI) BOOL; pub extern "KERNEL32" fn LocalSystemTimeToLocalFileTime( timeZoneInformation: ?*const TIME_ZONE_INFORMATION, localSystemTime: ?*const SYSTEMTIME, localFileTime: ?*FILETIME, ) callconv(@import("std").os.windows.WINAPI) BOOL; //-------------------------------------------------------------------------------- // Section: Unicode Aliases (0) //-------------------------------------------------------------------------------- const thismodule = @This(); pub usingnamespace switch (@import("../zig.zig").unicode_mode) { .ansi => struct { }, .wide => struct { }, .unspecified => if (@import("builtin").is_test) struct { } else struct { }, }; //-------------------------------------------------------------------------------- // Section: Imports (4) //-------------------------------------------------------------------------------- const BOOL = @import("../foundation.zig").BOOL; const BOOLEAN = @import("../foundation.zig").BOOLEAN; const FILETIME = @import("../foundation.zig").FILETIME; const SYSTEMTIME = @import("../foundation.zig").SYSTEMTIME; test { @setEvalBranchQuota( @import("std").meta.declarations(@This()).len * 3 ); // reference all the pub declarations if (!@import("builtin").is_test) return; inline for (@import("std").meta.declarations(@This())) |decl| { if (decl.is_pub) { _ = decl; } } }
win32/system/time.zig
pub const BT_PORT_MIN = @as(u32, 1); pub const BT_PORT_MAX = @as(u32, 65535); pub const BT_PORT_DYN_FIRST = @as(u32, 4097); pub const AF_BTH = @as(u16, 32); pub const NS_BTH = @as(u32, 16); pub const SVCID_BTH_PROVIDER = Guid.initString("06aa63e0-7d60-41ff-afb2-3ee6d2d9392d"); pub const BTH_ADDR_STRING_SIZE = @as(u32, 12); pub const BTHPROTO_RFCOMM = @as(u32, 3); pub const BTHPROTO_L2CAP = @as(u32, 256); pub const SOL_SDP = @as(u32, 257); pub const SO_BTH_AUTHENTICATE = @as(u32, 2147483649); pub const SO_BTH_ENCRYPT = @as(u32, 2); pub const SO_BTH_MTU = @as(u32, 2147483655); pub const SO_BTH_MTU_MAX = @as(u32, 2147483656); pub const SO_BTH_MTU_MIN = @as(u32, 2147483658); pub const RFCOMM_MAX_MTU = @as(u32, 1011); pub const RFCOMM_MIN_MTU = @as(u32, 23); pub const BTH_SDP_VERSION = @as(u32, 1); pub const SDP_DEFAULT_INQUIRY_SECONDS = @as(u32, 6); pub const SDP_MAX_INQUIRY_SECONDS = @as(u32, 60); pub const SDP_DEFAULT_INQUIRY_MAX_RESPONSES = @as(u32, 255); pub const SDP_SERVICE_SEARCH_REQUEST = @as(u32, 1); pub const SDP_SERVICE_ATTRIBUTE_REQUEST = @as(u32, 2); pub const SDP_SERVICE_SEARCH_ATTRIBUTE_REQUEST = @as(u32, 3); pub const BTHNS_RESULT_DEVICE_CONNECTED = @as(u32, 65536); pub const BTHNS_RESULT_DEVICE_REMEMBERED = @as(u32, 131072); pub const BTHNS_RESULT_DEVICE_AUTHENTICATED = @as(u32, 262144); pub const RFCOMM_CMD_NONE = @as(u32, 0); pub const RFCOMM_CMD_MSC = @as(u32, 1); pub const RFCOMM_CMD_RLS = @as(u32, 2); pub const RFCOMM_CMD_RPN = @as(u32, 3); pub const RFCOMM_CMD_RPN_REQUEST = @as(u32, 4); pub const RFCOMM_CMD_RPN_RESPONSE = @as(u32, 5); pub const BLUETOOTH_MAX_NAME_SIZE = @as(u32, 248); pub const BLUETOOTH_MAX_PASSKEY_SIZE = @as(u32, 16); pub const BLUETOOTH_MAX_PASSKEY_BUFFER_SIZE = @as(u32, 17); pub const BLUETOOTH_MAX_SERVICE_NAME_SIZE = @as(u32, 256); pub const BLUETOOTH_DEVICE_NAME_SIZE = @as(u32, 256); pub const BLUETOOTH_SERVICE_DISABLE = @as(u32, 0); pub const BLUETOOTH_SERVICE_ENABLE = @as(u32, 1); pub const GUID_BLUETOOTHLE_DEVICE_INTERFACE = Guid.initString("781aee18-7733-4ce4-add0-91f41c67b592"); pub const GUID_BLUETOOTH_GATT_SERVICE_DEVICE_INTERFACE = Guid.initString("6e3bb679-4372-40c8-9eaa-4509df260cd8"); pub const BTH_LE_ATT_BLUETOOTH_BASE_GUID = Guid.initString("00000000-0000-1000-8000-00805f9b34fb"); pub const BTH_LE_SERVICE_GAP = @as(u32, 6144); pub const BTH_LE_SERVICE_GATT = @as(u32, 6145); pub const BTH_LE_GATT_ATTRIBUTE_TYPE_PRIMARY_SERVICE = @as(u32, 10240); pub const BTH_LE_GATT_ATTRIBUTE_TYPE_SECONDARY_SERVICE = @as(u32, 10241); pub const BTH_LE_GATT_ATTRIBUTE_TYPE_INCLUDE = @as(u32, 10242); pub const BTH_LE_GATT_ATTRIBUTE_TYPE_CHARACTERISTIC = @as(u32, 10243); pub const BTH_LE_GATT_CHARACTERISTIC_DESCRIPTOR_EXTENDED_PROPERTIES = @as(u32, 10496); pub const BTH_LE_GATT_CHARACTERISTIC_DESCRIPTOR_USER_DESCRIPTION = @as(u32, 10497); pub const BTH_LE_GATT_CHARACTERISTIC_DESCRIPTOR_CLIENT_CONFIGURATION = @as(u32, 10498); pub const BTH_LE_GATT_CHARACTERISTIC_DESCRIPTOR_SERVER_CONFIGURATION = @as(u32, 10499); pub const BTH_LE_GATT_CHARACTERISTIC_DESCRIPTOR_FORMAT = @as(u32, 10500); pub const BTH_LE_GATT_CHARACTERISTIC_DESCRIPTOR_AGGREGATE_FORMAT = @as(u32, 10501); pub const BTH_LE_GATT_CHARACTERISTIC_TYPE_DEVICE_NAME = @as(u32, 10752); pub const BTH_LE_GATT_CHARACTERISTIC_TYPE_APPEARANCE = @as(u32, 10753); pub const BTH_LE_GATT_CHARACTERISTIC_TYPE_PERIPHERAL_PRIVACY_FLAG = @as(u32, 10754); pub const BTH_LE_GATT_CHARACTERISTIC_TYPE_RECONNECTION_ADDRESS = @as(u32, 10755); pub const BTH_LE_GATT_CHARACTERISTIC_TYPE_PERIPHERAL_PREFERED_CONNECTION_PARAMETER = @as(u32, 10756); pub const BTH_LE_GATT_CHARACTERISTIC_TYPE_SERVICE_CHANGED = @as(u32, 10757); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_OFFSET = @as(u32, 6); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_MASK = @as(u32, 1023); pub const BTH_LE_GAP_APPEARANCE_SUB_CATEGORY_MASK = @as(u32, 63); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_UNCATEGORIZED = @as(u32, 0); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_PHONE = @as(u32, 1); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_COMPUTER = @as(u32, 2); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_WATCH = @as(u32, 3); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_CLOCK = @as(u32, 4); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_DISPLAY = @as(u32, 5); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_REMOTE_CONTROL = @as(u32, 6); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_EYE_GLASSES = @as(u32, 7); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_TAG = @as(u32, 8); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_KEYRING = @as(u32, 9); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_MEDIA_PLAYER = @as(u32, 10); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_BARCODE_SCANNER = @as(u32, 11); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_THERMOMETER = @as(u32, 12); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_HEART_RATE = @as(u32, 13); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_BLOOD_PRESSURE = @as(u32, 14); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_HID = @as(u32, 15); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_GLUCOSE_METER = @as(u32, 16); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_RUNNING_WALKING_SENSOR = @as(u32, 17); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_CYCLING = @as(u32, 18); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_PLUSE_OXIMETER = @as(u32, 49); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_WEIGHT_SCALE = @as(u32, 50); pub const BTH_LE_GAP_APPEARANCE_CATEGORY_OUTDOOR_SPORTS_ACTIVITY = @as(u32, 81); pub const BTH_LE_GAP_APPEARANCE_SUBCATEGORY_GENERIC = @as(u32, 0); pub const BTH_LE_GAP_APPEARANCE_WATCH_SUBCATEGORY_SPORTS_WATCH = @as(u32, 1); pub const BTH_LE_GAP_APPEARANCE_THERMOMETER_SUBCATEGORY_EAR = @as(u32, 1); pub const BTH_LE_GAP_APPEARANCE_HEART_RATE_SUBCATEGORY_HEART_RATE_BELT = @as(u32, 1); pub const BTH_LE_GAP_APPEARANCE_BLOOD_PRESSURE_SUBCATEGORY_ARM = @as(u32, 1); pub const BTH_LE_GAP_APPEARANCE_BLOOD_PRESSURE_SUBCATEGORY_WRIST = @as(u32, 2); pub const BTH_LE_GAP_APPEARANCE_HID_SUBCATEGORY_KEYBOARD = @as(u32, 1); pub const BTH_LE_GAP_APPEARANCE_HID_SUBCATEGORY_MOUSE = @as(u32, 2); pub const BTH_LE_GAP_APPEARANCE_HID_SUBCATEGORY_JOYSTICK = @as(u32, 3); pub const BTH_LE_GAP_APPEARANCE_HID_SUBCATEGORY_GAMEPAD = @as(u32, 4); pub const BTH_LE_GAP_APPEARANCE_HID_SUBCATEGORY_DIGITIZER_TABLET = @as(u32, 5); pub const BTH_LE_GAP_APPEARANCE_HID_SUBCATEGORY_CARD_READER = @as(u32, 6); pub const BTH_LE_GAP_APPEARANCE_HID_SUBCATEGORY_DIGITAL_PEN = @as(u32, 7); pub const BTH_LE_GAP_APPEARANCE_HID_SUBCATEGORY_BARCODE_SCANNER = @as(u32, 8); pub const BTH_LE_GAP_APPEARANCE_RUNNING_WALKING_SENSOR_SUBCATEGORY_IN_SHOE = @as(u32, 1); pub const BTH_LE_GAP_APPEARANCE_RUNNING_WALKING_SENSOR_SUBCATEGORY_ON_SHOE = @as(u32, 2); pub const BTH_LE_GAP_APPEARANCE_RUNNING_WALKING_SENSOR_SUBCATEGORY_ON_HIP = @as(u32, 3); pub const BTH_LE_GAP_APPEARANCE_CYCLING_SUBCATEGORY_CYCLING_COMPUTER = @as(u32, 1); pub const BTH_LE_GAP_APPEARANCE_CYCLING_SUBCATEGORY_SPEED_SENSOR = @as(u32, 2); pub const BTH_LE_GAP_APPEARANCE_CYCLING_SUBCATEGORY_CADENCE_SENSOR = @as(u32, 3); pub const BTH_LE_GAP_APPEARANCE_CYCLING_SUBCATEGORY_POWER_SENSOR = @as(u32, 4); pub const BTH_LE_GAP_APPEARANCE_CYCLING_SUBCATEGORY_SPEED_AND_CADENCE_SENSOR = @as(u32, 5); pub const BTH_LE_GAP_APPEARANCE_PULSE_OXIMETER_SUBCATEGORY_FINGERTIP = @as(u32, 1); pub const BTH_LE_GAP_APPEARANCE_PULSE_OXIMETER_SUBCATEGORY_WRIST_WORN = @as(u32, 2); pub const BTH_LE_GAP_APPEARANCE_OUTDOOR_SPORTS_ACTIVITY_SUBCATEGORY_LOCATION_DISPLAY_DEVICE = @as(u32, 1); pub const BTH_LE_GAP_APPEARANCE_OUTDOOR_SPORTS_ACTIVITY_SUBCATEGORY_LOCATION_NAVIGATION_DISPLAY_DEVICE = @as(u32, 2); pub const BTH_LE_GAP_APPEARANCE_OUTDOOR_SPORTS_ACTIVITY_SUBCATEGORY_LOCATION_POD = @as(u32, 3); pub const BTH_LE_GAP_APPEARANCE_OUTDOOR_SPORTS_ACTIVITY_SUBCATEGORY_LOCATION_NAVIGATION_POD = @as(u32, 4); pub const BTH_LE_GATT_DEFAULT_MAX_INCLUDED_SERVICES_DEPTH = @as(u32, 3); pub const BTH_LE_ATT_TRANSACTION_TIMEOUT = @as(u32, 30); pub const BTH_LE_ATT_MAX_VALUE_SIZE = @as(u32, 512); pub const BTH_LE_ATT_CID = @as(u32, 4); pub const BTHLEENUM_ATT_MTU_MIN = @as(u32, 23); pub const BTHLEENUM_ATT_MTU_MAX = @as(u32, 65535); pub const BTHLEENUM_ATT_MTU_INITIAL_NEGOTIATION = @as(u32, 525); pub const BTH_LE_ERROR_INVALID_HANDLE = @as(u32, 1); pub const BTH_LE_ERROR_READ_NOT_PERMITTED = @as(u32, 2); pub const BTH_LE_ERROR_WRITE_NOT_PERMITTED = @as(u32, 3); pub const BTH_LE_ERROR_INVALID_PDU = @as(u32, 4); pub const BTH_LE_ERROR_INSUFFICIENT_AUTHENTICATION = @as(u32, 5); pub const BTH_LE_ERROR_REQUEST_NOT_SUPPORTED = @as(u32, 6); pub const BTH_LE_ERROR_INVALID_OFFSET = @as(u32, 7); pub const BTH_LE_ERROR_INSUFFICIENT_AUTHORIZATION = @as(u32, 8); pub const BTH_LE_ERROR_PREPARE_QUEUE_FULL = @as(u32, 9); pub const BTH_LE_ERROR_ATTRIBUTE_NOT_FOUND = @as(u32, 10); pub const BTH_LE_ERROR_ATTRIBUTE_NOT_LONG = @as(u32, 11); pub const BTH_LE_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE = @as(u32, 12); pub const BTH_LE_ERROR_INVALID_ATTRIBUTE_VALUE_LENGTH = @as(u32, 13); pub const BTH_LE_ERROR_UNLIKELY = @as(u32, 14); pub const BTH_LE_ERROR_INSUFFICIENT_ENCRYPTION = @as(u32, 15); pub const BTH_LE_ERROR_UNSUPPORTED_GROUP_TYPE = @as(u32, 16); pub const BTH_LE_ERROR_INSUFFICIENT_RESOURCES = @as(u32, 17); pub const BTH_LE_ERROR_UNKNOWN = @as(u32, 4096); pub const BLUETOOTH_GATT_FLAG_NONE = @as(u32, 0); pub const BLUETOOTH_GATT_FLAG_CONNECTION_ENCRYPTED = @as(u32, 1); pub const BLUETOOTH_GATT_FLAG_CONNECTION_AUTHENTICATED = @as(u32, 2); pub const BLUETOOTH_GATT_FLAG_FORCE_READ_FROM_DEVICE = @as(u32, 4); pub const BLUETOOTH_GATT_FLAG_FORCE_READ_FROM_CACHE = @as(u32, 8); pub const BLUETOOTH_GATT_FLAG_SIGNED_WRITE = @as(u32, 16); pub const BLUETOOTH_GATT_FLAG_WRITE_WITHOUT_RESPONSE = @as(u32, 32); pub const BLUETOOTH_GATT_FLAG_RETURN_ALL = @as(u32, 64); pub const GUID_BTHPORT_DEVICE_INTERFACE = Guid.initString("0850302a-b344-4fda-9be9-90576b8d46f0"); pub const GUID_BTH_RFCOMM_SERVICE_DEVICE_INTERFACE = Guid.initString("b142fc3e-fa4e-460b-8abc-072b628b3c70"); pub const GUID_BLUETOOTH_RADIO_IN_RANGE = Guid.initString("ea3b5b82-26ee-450e-b0d8-d26fe30a3869"); pub const GUID_BLUETOOTH_RADIO_OUT_OF_RANGE = Guid.initString("e28867c9-c2aa-4ced-b969-4570866037c4"); pub const GUID_BLUETOOTH_L2CAP_EVENT = Guid.initString("7eae4030-b709-4aa8-ac55-e953829c9daa"); pub const GUID_BLUETOOTH_HCI_EVENT = Guid.initString("fc240062-1541-49be-b463-84c4dcd7bf7f"); pub const GUID_BLUETOOTH_AUTHENTICATION_REQUEST = Guid.initString("5dc9136d-996c-46db-84f5-32c0a3f47352"); pub const GUID_BLUETOOTH_KEYPRESS_EVENT = Guid.initString("d668dfcd-0f4e-4efc-bfe0-392eeec5109c"); pub const GUID_BLUETOOTH_HCI_VENDOR_EVENT = Guid.initString("547247e6-45bb-4c33-af8c-c00efe15a71d"); pub const Bluetooth_Base_UUID = Guid.initString("00000000-0000-1000-8000-00805f9b34fb"); pub const SDP_PROTOCOL_UUID16 = @as(u32, 1); pub const UDP_PROTOCOL_UUID16 = @as(u32, 2); pub const RFCOMM_PROTOCOL_UUID16 = @as(u32, 3); pub const TCP_PROTOCOL_UUID16 = @as(u32, 4); pub const TCSBIN_PROTOCOL_UUID16 = @as(u32, 5); pub const TCSAT_PROTOCOL_UUID16 = @as(u32, 6); pub const ATT_PROTOCOL_UUID16 = @as(u32, 7); pub const OBEX_PROTOCOL_UUID16 = @as(u32, 8); pub const IP_PROTOCOL_UUID16 = @as(u32, 9); pub const FTP_PROTOCOL_UUID16 = @as(u32, 10); pub const HTTP_PROTOCOL_UUID16 = @as(u32, 12); pub const WSP_PROTOCOL_UUID16 = @as(u32, 14); pub const BNEP_PROTOCOL_UUID16 = @as(u32, 15); pub const UPNP_PROTOCOL_UUID16 = @as(u32, 16); pub const HID_PROTOCOL_UUID16 = @as(u32, 17); pub const HCCC_PROTOCOL_UUID16 = @as(u32, 18); pub const HCDC_PROTOCOL_UUID16 = @as(u32, 20); pub const HCN_PROTOCOL_UUID16 = @as(u32, 22); pub const AVCTP_PROTOCOL_UUID16 = @as(u32, 23); pub const AVDTP_PROTOCOL_UUID16 = @as(u32, 25); pub const CMPT_PROTOCOL_UUID16 = @as(u32, 27); pub const UDI_C_PLANE_PROTOCOL_UUID16 = @as(u32, 29); pub const L2CAP_PROTOCOL_UUID16 = @as(u32, 256); pub const ServiceDiscoveryServerServiceClassID_UUID16 = @as(u32, 4096); pub const BrowseGroupDescriptorServiceClassID_UUID16 = @as(u32, 4097); pub const PublicBrowseGroupServiceClassID_UUID16 = @as(u32, 4098); pub const SerialPortServiceClassID_UUID16 = @as(u32, 4353); pub const LANAccessUsingPPPServiceClassID_UUID16 = @as(u32, 4354); pub const DialupNetworkingServiceClassID_UUID16 = @as(u32, 4355); pub const IrMCSyncServiceClassID_UUID16 = @as(u32, 4356); pub const OBEXObjectPushServiceClassID_UUID16 = @as(u32, 4357); pub const OBEXFileTransferServiceClassID_UUID16 = @as(u32, 4358); pub const IrMcSyncCommandServiceClassID_UUID16 = @as(u32, 4359); pub const HeadsetServiceClassID_UUID16 = @as(u32, 4360); pub const CordlessTelephonyServiceClassID_UUID16 = @as(u32, 4361); pub const AudioSourceServiceClassID_UUID16 = @as(u32, 4362); pub const AudioSinkServiceClassID_UUID16 = @as(u32, 4363); pub const AVRemoteControlTargetServiceClassID_UUID16 = @as(u32, 4364); pub const AVRemoteControlServiceClassID_UUID16 = @as(u32, 4366); pub const AVRemoteControlControllerServiceClass_UUID16 = @as(u32, 4367); pub const IntercomServiceClassID_UUID16 = @as(u32, 4368); pub const FaxServiceClassID_UUID16 = @as(u32, 4369); pub const HeadsetAudioGatewayServiceClassID_UUID16 = @as(u32, 4370); pub const WAPServiceClassID_UUID16 = @as(u32, 4371); pub const WAPClientServiceClassID_UUID16 = @as(u32, 4372); pub const PANUServiceClassID_UUID16 = @as(u32, 4373); pub const NAPServiceClassID_UUID16 = @as(u32, 4374); pub const GNServiceClassID_UUID16 = @as(u32, 4375); pub const DirectPrintingServiceClassID_UUID16 = @as(u32, 4376); pub const ReferencePrintingServiceClassID_UUID16 = @as(u32, 4377); pub const ImagingResponderServiceClassID_UUID16 = @as(u32, 4379); pub const ImagingAutomaticArchiveServiceClassID_UUID16 = @as(u32, 4380); pub const ImagingReferenceObjectsServiceClassID_UUID16 = @as(u32, 4381); pub const HandsfreeServiceClassID_UUID16 = @as(u32, 4382); pub const HandsfreeAudioGatewayServiceClassID_UUID16 = @as(u32, 4383); pub const DirectPrintingReferenceObjectsServiceClassID_UUID16 = @as(u32, 4384); pub const ReflectsUIServiceClassID_UUID16 = @as(u32, 4385); pub const PrintingStatusServiceClassID_UUID16 = @as(u32, 4387); pub const HumanInterfaceDeviceServiceClassID_UUID16 = @as(u32, 4388); pub const HCRPrintServiceClassID_UUID16 = @as(u32, 4390); pub const HCRScanServiceClassID_UUID16 = @as(u32, 4391); pub const CommonISDNAccessServiceClassID_UUID16 = @as(u32, 4392); pub const VideoConferencingGWServiceClassID_UUID16 = @as(u32, 4393); pub const UDIMTServiceClassID_UUID16 = @as(u32, 4394); pub const UDITAServiceClassID_UUID16 = @as(u32, 4395); pub const AudioVideoServiceClassID_UUID16 = @as(u32, 4396); pub const SimAccessServiceClassID_UUID16 = @as(u32, 4397); pub const PhonebookAccessPceServiceClassID_UUID16 = @as(u32, 4398); pub const PhonebookAccessPseServiceClassID_UUID16 = @as(u32, 4399); pub const HeadsetHSServiceClassID_UUID16 = @as(u32, 4401); pub const MessageAccessServerServiceClassID_UUID16 = @as(u32, 4402); pub const MessageNotificationServerServiceClassID_UUID16 = @as(u32, 4403); pub const GNSSServerServiceClassID_UUID16 = @as(u32, 4406); pub const ThreeDimensionalDisplayServiceClassID_UUID16 = @as(u32, 4407); pub const ThreeDimensionalGlassesServiceClassID_UUID16 = @as(u32, 4408); pub const MPSServiceClassID_UUID16 = @as(u32, 4411); pub const CTNAccessServiceClassID_UUID16 = @as(u32, 4412); pub const CTNNotificationServiceClassID_UUID16 = @as(u32, 4413); pub const PnPInformationServiceClassID_UUID16 = @as(u32, 4608); pub const GenericNetworkingServiceClassID_UUID16 = @as(u32, 4609); pub const GenericFileTransferServiceClassID_UUID16 = @as(u32, 4610); pub const GenericAudioServiceClassID_UUID16 = @as(u32, 4611); pub const GenericTelephonyServiceClassID_UUID16 = @as(u32, 4612); pub const UPnpServiceClassID_UUID16 = @as(u32, 4613); pub const UPnpIpServiceClassID_UUID16 = @as(u32, 4614); pub const ESdpUpnpIpPanServiceClassID_UUID16 = @as(u32, 4864); pub const ESdpUpnpIpLapServiceClassID_UUID16 = @as(u32, 4865); pub const ESdpUpnpL2capServiceClassID_UUID16 = @as(u32, 4866); pub const VideoSourceServiceClassID_UUID16 = @as(u32, 4867); pub const VideoSinkServiceClassID_UUID16 = @as(u32, 4868); pub const HealthDeviceProfileSourceServiceClassID_UUID16 = @as(u32, 5121); pub const HealthDeviceProfileSinkServiceClassID_UUID16 = @as(u32, 5122); pub const AdvancedAudioDistributionProfileID_UUID16 = @as(u32, 4365); pub const ImagingServiceProfileID_UUID16 = @as(u32, 4378); pub const BasicPrintingProfileID_UUID16 = @as(u32, 4386); pub const HardcopyCableReplacementProfileID_UUID16 = @as(u32, 4389); pub const PhonebookAccessProfileID_UUID16 = @as(u32, 4400); pub const MessageAccessProfileID_UUID16 = @as(u32, 4404); pub const GNSSProfileID_UUID16 = @as(u32, 4405); pub const ThreeDimensionalSynchronizationProfileID_UUID16 = @as(u32, 4409); pub const MPSProfileID_UUID16 = @as(u32, 4410); pub const CTNProfileID_UUID16 = @as(u32, 4414); pub const VideoDistributionProfileID_UUID16 = @as(u32, 4869); pub const HealthDeviceProfileID_UUID16 = @as(u32, 5120); pub const BTH_MAX_NAME_SIZE = @as(u32, 248); pub const BTH_MAX_PIN_SIZE = @as(u32, 16); pub const BTH_LINK_KEY_LENGTH = @as(u32, 16); pub const BTH_MFG_ERICSSON = @as(u32, 0); pub const BTH_MFG_NOKIA = @as(u32, 1); pub const BTH_MFG_INTEL = @as(u32, 2); pub const BTH_MFG_IBM = @as(u32, 3); pub const BTH_MFG_TOSHIBA = @as(u32, 4); pub const BTH_MFG_3COM = @as(u32, 5); pub const BTH_MFG_MICROSOFT = @as(u32, 6); pub const BTH_MFG_LUCENT = @as(u32, 7); pub const BTH_MFG_MOTOROLA = @as(u32, 8); pub const BTH_MFG_INFINEON = @as(u32, 9); pub const BTH_MFG_CSR = @as(u32, 10); pub const BTH_MFG_SILICONWAVE = @as(u32, 11); pub const BTH_MFG_DIGIANSWER = @as(u32, 12); pub const BTH_MFG_TI = @as(u32, 13); pub const BTH_MFG_PARTHUS = @as(u32, 14); pub const BTH_MFG_BROADCOM = @as(u32, 15); pub const BTH_MFG_MITEL = @as(u32, 16); pub const BTH_MFG_WIDCOMM = @as(u32, 17); pub const BTH_MFG_ZEEVO = @as(u32, 18); pub const BTH_MFG_ATMEL = @as(u32, 19); pub const BTH_MFG_MITSIBUSHI = @as(u32, 20); pub const BTH_MFG_RTX_TELECOM = @as(u32, 21); pub const BTH_MFG_KC_TECHNOLOGY = @as(u32, 22); pub const BTH_MFG_NEWLOGIC = @as(u32, 23); pub const BTH_MFG_TRANSILICA = @as(u32, 24); pub const BTH_MFG_ROHDE_SCHWARZ = @as(u32, 25); pub const BTH_MFG_TTPCOM = @as(u32, 26); pub const BTH_MFG_SIGNIA = @as(u32, 27); pub const BTH_MFG_CONEXANT = @as(u32, 28); pub const BTH_MFG_QUALCOMM = @as(u32, 29); pub const BTH_MFG_INVENTEL = @as(u32, 30); pub const BTH_MFG_AVM_BERLIN = @as(u32, 31); pub const BTH_MFG_BANDSPEED = @as(u32, 32); pub const BTH_MFG_MANSELLA = @as(u32, 33); pub const BTH_MFG_NEC = @as(u32, 34); pub const BTH_MFG_WAVEPLUS_TECHNOLOGY_CO = @as(u32, 35); pub const BTH_MFG_ALCATEL = @as(u32, 36); pub const BTH_MFG_PHILIPS_SEMICONDUCTOR = @as(u32, 37); pub const BTH_MFG_C_TECHNOLOGIES = @as(u32, 38); pub const BTH_MFG_OPEN_INTERFACE = @as(u32, 39); pub const BTH_MFG_RF_MICRO_DEVICES = @as(u32, 40); pub const BTH_MFG_HITACHI = @as(u32, 41); pub const BTH_MFG_SYMBOL_TECHNOLOGIES = @as(u32, 42); pub const BTH_MFG_TENOVIS = @as(u32, 43); pub const BTH_MFG_MACRONIX_INTERNATIONAL = @as(u32, 44); pub const BTH_MFG_MARVELL = @as(u32, 72); pub const BTH_MFG_APPLE = @as(u32, 76); pub const BTH_MFG_NORDIC_SEMICONDUCTORS_ASA = @as(u32, 89); pub const BTH_MFG_ARUBA_NETWORKS = @as(u32, 283); pub const BTH_MFG_INTERNAL_USE = @as(u32, 65535); pub const SAP_BIT_OFFSET = @as(u32, 0); pub const COD_FORMAT_BIT_OFFSET = @as(u32, 0); pub const COD_MINOR_BIT_OFFSET = @as(u32, 2); pub const COD_FORMAT_MASK = @as(u32, 3); pub const COD_MINOR_MASK = @as(u32, 252); pub const COD_MAJOR_MASK = @as(u32, 7936); pub const COD_SERVICE_MASK = @as(u32, 16769024); pub const COD_VERSION = @as(u32, 0); pub const COD_SERVICE_LIMITED = @as(u32, 1); pub const COD_SERVICE_POSITIONING = @as(u32, 8); pub const COD_SERVICE_NETWORKING = @as(u32, 16); pub const COD_SERVICE_RENDERING = @as(u32, 32); pub const COD_SERVICE_CAPTURING = @as(u32, 64); pub const COD_SERVICE_OBJECT_XFER = @as(u32, 128); pub const COD_SERVICE_AUDIO = @as(u32, 256); pub const COD_SERVICE_TELEPHONY = @as(u32, 512); pub const COD_SERVICE_INFORMATION = @as(u32, 1024); pub const COD_SERVICE_MAX_COUNT = @as(u32, 9); pub const COD_MAJOR_MISCELLANEOUS = @as(u32, 0); pub const COD_MAJOR_COMPUTER = @as(u32, 1); pub const COD_MAJOR_PHONE = @as(u32, 2); pub const COD_MAJOR_LAN_ACCESS = @as(u32, 3); pub const COD_MAJOR_AUDIO = @as(u32, 4); pub const COD_MAJOR_PERIPHERAL = @as(u32, 5); pub const COD_MAJOR_IMAGING = @as(u32, 6); pub const COD_MAJOR_WEARABLE = @as(u32, 7); pub const COD_MAJOR_TOY = @as(u32, 8); pub const COD_MAJOR_HEALTH = @as(u32, 9); pub const COD_MAJOR_UNCLASSIFIED = @as(u32, 31); pub const COD_COMPUTER_MINOR_UNCLASSIFIED = @as(u32, 0); pub const COD_COMPUTER_MINOR_DESKTOP = @as(u32, 1); pub const COD_COMPUTER_MINOR_SERVER = @as(u32, 2); pub const COD_COMPUTER_MINOR_LAPTOP = @as(u32, 3); pub const COD_COMPUTER_MINOR_HANDHELD = @as(u32, 4); pub const COD_COMPUTER_MINOR_PALM = @as(u32, 5); pub const COD_COMPUTER_MINOR_WEARABLE = @as(u32, 6); pub const COD_PHONE_MINOR_UNCLASSIFIED = @as(u32, 0); pub const COD_PHONE_MINOR_CELLULAR = @as(u32, 1); pub const COD_PHONE_MINOR_CORDLESS = @as(u32, 2); pub const COD_PHONE_MINOR_SMART = @as(u32, 3); pub const COD_PHONE_MINOR_WIRED_MODEM = @as(u32, 4); pub const COD_AUDIO_MINOR_UNCLASSIFIED = @as(u32, 0); pub const COD_AUDIO_MINOR_HEADSET = @as(u32, 1); pub const COD_AUDIO_MINOR_HANDS_FREE = @as(u32, 2); pub const COD_AUDIO_MINOR_HEADSET_HANDS_FREE = @as(u32, 3); pub const COD_AUDIO_MINOR_MICROPHONE = @as(u32, 4); pub const COD_AUDIO_MINOR_LOUDSPEAKER = @as(u32, 5); pub const COD_AUDIO_MINOR_HEADPHONES = @as(u32, 6); pub const COD_AUDIO_MINOR_PORTABLE_AUDIO = @as(u32, 7); pub const COD_AUDIO_MINOR_CAR_AUDIO = @as(u32, 8); pub const COD_AUDIO_MINOR_SET_TOP_BOX = @as(u32, 9); pub const COD_AUDIO_MINOR_HIFI_AUDIO = @as(u32, 10); pub const COD_AUDIO_MINOR_VCR = @as(u32, 11); pub const COD_AUDIO_MINOR_VIDEO_CAMERA = @as(u32, 12); pub const COD_AUDIO_MINOR_CAMCORDER = @as(u32, 13); pub const COD_AUDIO_MINOR_VIDEO_MONITOR = @as(u32, 14); pub const COD_AUDIO_MINOR_VIDEO_DISPLAY_LOUDSPEAKER = @as(u32, 15); pub const COD_AUDIO_MINOR_VIDEO_DISPLAY_CONFERENCING = @as(u32, 16); pub const COD_AUDIO_MINOR_GAMING_TOY = @as(u32, 18); pub const COD_PERIPHERAL_MINOR_KEYBOARD_MASK = @as(u32, 16); pub const COD_PERIPHERAL_MINOR_POINTER_MASK = @as(u32, 32); pub const COD_PERIPHERAL_MINOR_NO_CATEGORY = @as(u32, 0); pub const COD_PERIPHERAL_MINOR_JOYSTICK = @as(u32, 1); pub const COD_PERIPHERAL_MINOR_GAMEPAD = @as(u32, 2); pub const COD_PERIPHERAL_MINOR_REMOTE_CONTROL = @as(u32, 3); pub const COD_PERIPHERAL_MINOR_SENSING = @as(u32, 4); pub const COD_IMAGING_MINOR_DISPLAY_MASK = @as(u32, 4); pub const COD_IMAGING_MINOR_CAMERA_MASK = @as(u32, 8); pub const COD_IMAGING_MINOR_SCANNER_MASK = @as(u32, 16); pub const COD_IMAGING_MINOR_PRINTER_MASK = @as(u32, 32); pub const COD_WEARABLE_MINOR_WRIST_WATCH = @as(u32, 1); pub const COD_WEARABLE_MINOR_PAGER = @as(u32, 2); pub const COD_WEARABLE_MINOR_JACKET = @as(u32, 3); pub const COD_WEARABLE_MINOR_HELMET = @as(u32, 4); pub const COD_WEARABLE_MINOR_GLASSES = @as(u32, 5); pub const COD_TOY_MINOR_ROBOT = @as(u32, 1); pub const COD_TOY_MINOR_VEHICLE = @as(u32, 2); pub const COD_TOY_MINOR_DOLL_ACTION_FIGURE = @as(u32, 3); pub const COD_TOY_MINOR_CONTROLLER = @as(u32, 4); pub const COD_TOY_MINOR_GAME = @as(u32, 5); pub const COD_HEALTH_MINOR_BLOOD_PRESSURE_MONITOR = @as(u32, 1); pub const COD_HEALTH_MINOR_THERMOMETER = @as(u32, 2); pub const COD_HEALTH_MINOR_WEIGHING_SCALE = @as(u32, 3); pub const COD_HEALTH_MINOR_GLUCOSE_METER = @as(u32, 4); pub const COD_HEALTH_MINOR_PULSE_OXIMETER = @as(u32, 5); pub const COD_HEALTH_MINOR_HEART_PULSE_MONITOR = @as(u32, 6); pub const COD_HEALTH_MINOR_HEALTH_DATA_DISPLAY = @as(u32, 7); pub const COD_HEALTH_MINOR_STEP_COUNTER = @as(u32, 8); pub const COD_LAN_ACCESS_BIT_OFFSET = @as(u32, 5); pub const COD_LAN_MINOR_MASK = @as(u32, 28); pub const COD_LAN_ACCESS_MASK = @as(u32, 224); pub const COD_LAN_MINOR_UNCLASSIFIED = @as(u32, 0); pub const COD_LAN_ACCESS_0_USED = @as(u32, 0); pub const COD_LAN_ACCESS_17_USED = @as(u32, 1); pub const COD_LAN_ACCESS_33_USED = @as(u32, 2); pub const COD_LAN_ACCESS_50_USED = @as(u32, 3); pub const COD_LAN_ACCESS_67_USED = @as(u32, 4); pub const COD_LAN_ACCESS_83_USED = @as(u32, 5); pub const COD_LAN_ACCESS_99_USED = @as(u32, 6); pub const COD_LAN_ACCESS_FULL = @as(u32, 7); pub const BTH_EIR_FLAGS_ID = @as(u32, 1); pub const BTH_EIR_16_UUIDS_PARTIAL_ID = @as(u32, 2); pub const BTH_EIR_16_UUIDS_COMPLETE_ID = @as(u32, 3); pub const BTH_EIR_32_UUIDS_PARTIAL_ID = @as(u32, 4); pub const BTH_EIR_32_UUIDS_COMPLETE_ID = @as(u32, 5); pub const BTH_EIR_128_UUIDS_PARTIAL_ID = @as(u32, 6); pub const BTH_EIR_128_UUIDS_COMPLETE_ID = @as(u32, 7); pub const BTH_EIR_LOCAL_NAME_PARTIAL_ID = @as(u32, 8); pub const BTH_EIR_LOCAL_NAME_COMPLETE_ID = @as(u32, 9); pub const BTH_EIR_TX_POWER_LEVEL_ID = @as(u32, 10); pub const BTH_EIR_OOB_OPT_DATA_LEN_ID = @as(u32, 11); pub const BTH_EIR_OOB_BD_ADDR_ID = @as(u32, 12); pub const BTH_EIR_OOB_COD_ID = @as(u32, 13); pub const BTH_EIR_OOB_SP_HASH_ID = @as(u32, 14); pub const BTH_EIR_OOB_SP_RANDOMIZER_ID = @as(u32, 15); pub const BTH_EIR_MANUFACTURER_ID = @as(u32, 255); pub const BTH_EIR_SIZE = @as(u32, 240); pub const LAP_GIAC_VALUE = @as(u32, 10390323); pub const LAP_LIAC_VALUE = @as(u32, 10390272); pub const BTH_ADDR_IAC_FIRST = @as(u32, 10390272); pub const BTH_ADDR_IAC_LAST = @as(u32, 10390335); pub const BTH_ADDR_LIAC = @as(u32, 10390272); pub const BTH_ADDR_GIAC = @as(u32, 10390323); pub const BTH_ERROR_SUCCESS = @as(u32, 0); pub const BTH_ERROR_UNKNOWN_HCI_COMMAND = @as(u32, 1); pub const BTH_ERROR_NO_CONNECTION = @as(u32, 2); pub const BTH_ERROR_HARDWARE_FAILURE = @as(u32, 3); pub const BTH_ERROR_PAGE_TIMEOUT = @as(u32, 4); pub const BTH_ERROR_AUTHENTICATION_FAILURE = @as(u32, 5); pub const BTH_ERROR_KEY_MISSING = @as(u32, 6); pub const BTH_ERROR_MEMORY_FULL = @as(u32, 7); pub const BTH_ERROR_CONNECTION_TIMEOUT = @as(u32, 8); pub const BTH_ERROR_MAX_NUMBER_OF_CONNECTIONS = @as(u32, 9); pub const BTH_ERROR_MAX_NUMBER_OF_SCO_CONNECTIONS = @as(u32, 10); pub const BTH_ERROR_ACL_CONNECTION_ALREADY_EXISTS = @as(u32, 11); pub const BTH_ERROR_COMMAND_DISALLOWED = @as(u32, 12); pub const BTH_ERROR_HOST_REJECTED_LIMITED_RESOURCES = @as(u32, 13); pub const BTH_ERROR_HOST_REJECTED_SECURITY_REASONS = @as(u32, 14); pub const BTH_ERROR_HOST_REJECTED_PERSONAL_DEVICE = @as(u32, 15); pub const BTH_ERROR_HOST_TIMEOUT = @as(u32, 16); pub const BTH_ERROR_UNSUPPORTED_FEATURE_OR_PARAMETER = @as(u32, 17); pub const BTH_ERROR_INVALID_HCI_PARAMETER = @as(u32, 18); pub const BTH_ERROR_REMOTE_USER_ENDED_CONNECTION = @as(u32, 19); pub const BTH_ERROR_REMOTE_LOW_RESOURCES = @as(u32, 20); pub const BTH_ERROR_REMOTE_POWERING_OFF = @as(u32, 21); pub const BTH_ERROR_LOCAL_HOST_TERMINATED_CONNECTION = @as(u32, 22); pub const BTH_ERROR_REPEATED_ATTEMPTS = @as(u32, 23); pub const BTH_ERROR_PAIRING_NOT_ALLOWED = @as(u32, 24); pub const BTH_ERROR_UKNOWN_LMP_PDU = @as(u32, 25); pub const BTH_ERROR_UNSUPPORTED_REMOTE_FEATURE = @as(u32, 26); pub const BTH_ERROR_SCO_OFFSET_REJECTED = @as(u32, 27); pub const BTH_ERROR_SCO_INTERVAL_REJECTED = @as(u32, 28); pub const BTH_ERROR_SCO_AIRMODE_REJECTED = @as(u32, 29); pub const BTH_ERROR_INVALID_LMP_PARAMETERS = @as(u32, 30); pub const BTH_ERROR_UNSPECIFIED_ERROR = @as(u32, 31); pub const BTH_ERROR_UNSUPPORTED_LMP_PARM_VALUE = @as(u32, 32); pub const BTH_ERROR_ROLE_CHANGE_NOT_ALLOWED = @as(u32, 33); pub const BTH_ERROR_LMP_RESPONSE_TIMEOUT = @as(u32, 34); pub const BTH_ERROR_LMP_TRANSACTION_COLLISION = @as(u32, 35); pub const BTH_ERROR_LMP_PDU_NOT_ALLOWED = @as(u32, 36); pub const BTH_ERROR_ENCRYPTION_MODE_NOT_ACCEPTABLE = @as(u32, 37); pub const BTH_ERROR_UNIT_KEY_NOT_USED = @as(u32, 38); pub const BTH_ERROR_QOS_IS_NOT_SUPPORTED = @as(u32, 39); pub const BTH_ERROR_INSTANT_PASSED = @as(u32, 40); pub const BTH_ERROR_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED = @as(u32, 41); pub const BTH_ERROR_DIFFERENT_TRANSACTION_COLLISION = @as(u32, 42); pub const BTH_ERROR_QOS_UNACCEPTABLE_PARAMETER = @as(u32, 44); pub const BTH_ERROR_QOS_REJECTED = @as(u32, 45); pub const BTH_ERROR_CHANNEL_CLASSIFICATION_NOT_SUPPORTED = @as(u32, 46); pub const BTH_ERROR_INSUFFICIENT_SECURITY = @as(u32, 47); pub const BTH_ERROR_PARAMETER_OUT_OF_MANDATORY_RANGE = @as(u32, 48); pub const BTH_ERROR_ROLE_SWITCH_PENDING = @as(u32, 50); pub const BTH_ERROR_RESERVED_SLOT_VIOLATION = @as(u32, 52); pub const BTH_ERROR_ROLE_SWITCH_FAILED = @as(u32, 53); pub const BTH_ERROR_EXTENDED_INQUIRY_RESPONSE_TOO_LARGE = @as(u32, 54); pub const BTH_ERROR_SECURE_SIMPLE_PAIRING_NOT_SUPPORTED_BY_HOST = @as(u32, 55); pub const BTH_ERROR_HOST_BUSY_PAIRING = @as(u32, 56); pub const BTH_ERROR_CONNECTION_REJECTED_DUE_TO_NO_SUITABLE_CHANNEL_FOUND = @as(u32, 57); pub const BTH_ERROR_CONTROLLER_BUSY = @as(u32, 58); pub const BTH_ERROR_UNACCEPTABLE_CONNECTION_INTERVAL = @as(u32, 59); pub const BTH_ERROR_DIRECTED_ADVERTISING_TIMEOUT = @as(u32, 60); pub const BTH_ERROR_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE = @as(u32, 61); pub const BTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED = @as(u32, 62); pub const BTH_ERROR_MAC_CONNECTION_FAILED = @as(u32, 63); pub const BTH_ERROR_COARSE_CLOCK_ADJUSTMENT_REJECTED = @as(u32, 64); pub const BTH_ERROR_TYPE_0_SUBMAP_NOT_DEFINED = @as(u32, 65); pub const BTH_ERROR_UNKNOWN_ADVERTISING_IDENTIFIER = @as(u32, 66); pub const BTH_ERROR_LIMIT_REACHED = @as(u32, 67); pub const BTH_ERROR_OPERATION_CANCELLED_BY_HOST = @as(u32, 68); pub const BTH_ERROR_PACKET_TOO_LONG = @as(u32, 69); pub const BTH_ERROR_UNSPECIFIED = @as(u32, 255); pub const L2CAP_MIN_MTU = @as(u32, 48); pub const L2CAP_MAX_MTU = @as(u32, 65535); pub const L2CAP_DEFAULT_MTU = @as(u32, 672); pub const MAX_L2CAP_PING_DATA_LENGTH = @as(u32, 44); pub const MAX_L2CAP_INFO_DATA_LENGTH = @as(u32, 44); pub const BDIF_ADDRESS = @as(u32, 1); pub const BDIF_COD = @as(u32, 2); pub const BDIF_NAME = @as(u32, 4); pub const BDIF_PAIRED = @as(u32, 8); pub const BDIF_PERSONAL = @as(u32, 16); pub const BDIF_CONNECTED = @as(u32, 32); pub const BDIF_SHORT_NAME = @as(u32, 64); pub const BDIF_VISIBLE = @as(u32, 128); pub const BDIF_SSP_SUPPORTED = @as(u32, 256); pub const BDIF_SSP_PAIRED = @as(u32, 512); pub const BDIF_SSP_MITM_PROTECTED = @as(u32, 1024); pub const BDIF_RSSI = @as(u32, 4096); pub const BDIF_EIR = @as(u32, 8192); pub const BDIF_BR = @as(u32, 16384); pub const BDIF_LE = @as(u32, 32768); pub const BDIF_LE_PAIRED = @as(u32, 65536); pub const BDIF_LE_PERSONAL = @as(u32, 131072); pub const BDIF_LE_MITM_PROTECTED = @as(u32, 262144); pub const BDIF_LE_PRIVACY_ENABLED = @as(u32, 524288); pub const BDIF_LE_RANDOM_ADDRESS_TYPE = @as(u32, 1048576); pub const BDIF_LE_DISCOVERABLE = @as(u32, 2097152); pub const BDIF_LE_NAME = @as(u32, 4194304); pub const BDIF_LE_VISIBLE = @as(u32, 8388608); pub const BDIF_LE_CONNECTED = @as(u32, 16777216); pub const BDIF_LE_CONNECTABLE = @as(u32, 33554432); pub const BDIF_CONNECTION_INBOUND = @as(u32, 67108864); pub const BDIF_BR_SECURE_CONNECTION_PAIRED = @as(u32, 134217728); pub const BDIF_LE_SECURE_CONNECTION_PAIRED = @as(u32, 268435456); pub const BDIF_DEBUGKEY = @as(u32, 536870912); pub const BDIF_LE_DEBUGKEY = @as(u32, 1073741824); pub const BDIF_TX_POWER = @as(u32, 2147483648); pub const HCI_CONNECTION_TYPE_ACL = @as(u32, 1); pub const HCI_CONNECTION_TYPE_SCO = @as(u32, 2); pub const HCI_CONNECTION_TYPE_LE = @as(u32, 3); pub const BTH_MAX_SERVICE_NAME_SIZE = @as(u32, 256); pub const MAX_UUIDS_IN_QUERY = @as(u32, 12); pub const BTH_VID_DEFAULT_VALUE = @as(u32, 65535); pub const SDP_ERROR_INVALID_SDP_VERSION = @as(u32, 1); pub const SDP_ERROR_INVALID_RECORD_HANDLE = @as(u32, 2); pub const SDP_ERROR_INVALID_REQUEST_SYNTAX = @as(u32, 3); pub const SDP_ERROR_INVALID_PDU_SIZE = @as(u32, 4); pub const SDP_ERROR_INVALID_CONTINUATION_STATE = @as(u32, 5); pub const SDP_ERROR_INSUFFICIENT_RESOURCES = @as(u32, 6); pub const SDP_ATTRIB_RECORD_HANDLE = @as(u32, 0); pub const SDP_ATTRIB_CLASS_ID_LIST = @as(u32, 1); pub const SDP_ATTRIB_RECORD_STATE = @as(u32, 2); pub const SDP_ATTRIB_SERVICE_ID = @as(u32, 3); pub const SDP_ATTRIB_PROTOCOL_DESCRIPTOR_LIST = @as(u32, 4); pub const SDP_ATTRIB_BROWSE_GROUP_LIST = @as(u32, 5); pub const SDP_ATTRIB_LANG_BASE_ATTRIB_ID_LIST = @as(u32, 6); pub const SDP_ATTRIB_INFO_TIME_TO_LIVE = @as(u32, 7); pub const SDP_ATTRIB_AVAILABILITY = @as(u32, 8); pub const SDP_ATTRIB_PROFILE_DESCRIPTOR_LIST = @as(u32, 9); pub const SDP_ATTRIB_DOCUMENTATION_URL = @as(u32, 10); pub const SDP_ATTRIB_CLIENT_EXECUTABLE_URL = @as(u32, 11); pub const SDP_ATTRIB_ICON_URL = @as(u32, 12); pub const SDP_ATTRIB_ADDITIONAL_PROTOCOL_DESCRIPTOR_LIST = @as(u32, 13); pub const SDP_ATTRIB_PROFILE_SPECIFIC = @as(u32, 512); pub const LANG_BASE_LANGUAGE_INDEX = @as(u32, 0); pub const LANG_BASE_ENCODING_INDEX = @as(u32, 1); pub const LANG_BASE_OFFSET_INDEX = @as(u32, 2); pub const LANG_DEFAULT_ID = @as(u32, 256); pub const LANGUAGE_EN_US = @as(u32, 25966); pub const ENCODING_UTF_8 = @as(u32, 106); pub const STRING_NAME_OFFSET = @as(u32, 0); pub const STRING_DESCRIPTION_OFFSET = @as(u32, 1); pub const STRING_PROVIDER_NAME_OFFSET = @as(u32, 2); pub const SDP_ATTRIB_SDP_VERSION_NUMBER_LIST = @as(u32, 512); pub const SDP_ATTRIB_SDP_DATABASE_STATE = @as(u32, 513); pub const SDP_ATTRIB_BROWSE_GROUP_ID = @as(u32, 512); pub const SDP_ATTRIB_CORDLESS_EXTERNAL_NETWORK = @as(u32, 769); pub const SDP_ATTRIB_FAX_CLASS_1_SUPPORT = @as(u32, 770); pub const SDP_ATTRIB_FAX_CLASS_2_0_SUPPORT = @as(u32, 771); pub const SDP_ATTRIB_FAX_CLASS_2_SUPPORT = @as(u32, 772); pub const SDP_ATTRIB_FAX_AUDIO_FEEDBACK_SUPPORT = @as(u32, 773); pub const SDP_ATTRIB_HEADSET_REMOTE_AUDIO_VOLUME_CONTROL = @as(u32, 770); pub const SDP_ATTRIB_LAN_LPSUBNET = @as(u32, 512); pub const SDP_ATTRIB_OBJECT_PUSH_SUPPORTED_FORMATS_LIST = @as(u32, 771); pub const SDP_ATTRIB_SYNCH_SUPPORTED_DATA_STORES_LIST = @as(u32, 769); pub const SDP_ATTRIB_SERVICE_VERSION = @as(u32, 768); pub const SDP_ATTRIB_PAN_NETWORK_ADDRESS = @as(u32, 774); pub const SDP_ATTRIB_PAN_WAP_GATEWAY = @as(u32, 775); pub const SDP_ATTRIB_PAN_HOME_PAGE_URL = @as(u32, 776); pub const SDP_ATTRIB_PAN_WAP_STACK_TYPE = @as(u32, 777); pub const SDP_ATTRIB_PAN_SECURITY_DESCRIPTION = @as(u32, 778); pub const SDP_ATTRIB_PAN_NET_ACCESS_TYPE = @as(u32, 779); pub const SDP_ATTRIB_PAN_MAX_NET_ACCESS_RATE = @as(u32, 780); pub const SDP_ATTRIB_IMAGING_SUPPORTED_CAPABILITIES = @as(u32, 784); pub const SDP_ATTRIB_IMAGING_SUPPORTED_FEATURES = @as(u32, 785); pub const SDP_ATTRIB_IMAGING_SUPPORTED_FUNCTIONS = @as(u32, 786); pub const SDP_ATTRIB_IMAGING_TOTAL_DATA_CAPACITY = @as(u32, 787); pub const SDP_ATTRIB_DI_SPECIFICATION_ID = @as(u32, 512); pub const SDP_ATTRIB_DI_VENDOR_ID = @as(u32, 513); pub const SDP_ATTRIB_DI_PRODUCT_ID = @as(u32, 514); pub const SDP_ATTRIB_DI_VERSION = @as(u32, 515); pub const SDP_ATTRIB_DI_PRIMARY_RECORD = @as(u32, 516); pub const SDP_ATTRIB_DI_VENDOR_ID_SOURCE = @as(u32, 517); pub const SDP_ATTRIB_HID_DEVICE_RELEASE_NUMBER = @as(u32, 512); pub const SDP_ATTRIB_HID_PARSER_VERSION = @as(u32, 513); pub const SDP_ATTRIB_HID_DEVICE_SUBCLASS = @as(u32, 514); pub const SDP_ATTRIB_HID_COUNTRY_CODE = @as(u32, 515); pub const SDP_ATTRIB_HID_VIRTUAL_CABLE = @as(u32, 516); pub const SDP_ATTRIB_HID_RECONNECT_INITIATE = @as(u32, 517); pub const SDP_ATTRIB_HID_DESCRIPTOR_LIST = @as(u32, 518); pub const SDP_ATTRIB_HID_LANG_ID_BASE_LIST = @as(u32, 519); pub const SDP_ATTRIB_HID_SDP_DISABLE = @as(u32, 520); pub const SDP_ATTRIB_HID_BATTERY_POWER = @as(u32, 521); pub const SDP_ATTRIB_HID_REMOTE_WAKE = @as(u32, 522); pub const SDP_ATTRIB_HID_PROFILE_VERSION = @as(u32, 523); pub const SDP_ATTRIB_HID_SUPERVISION_TIMEOUT = @as(u32, 524); pub const SDP_ATTRIB_HID_NORMALLY_CONNECTABLE = @as(u32, 525); pub const SDP_ATTRIB_HID_BOOT_DEVICE = @as(u32, 526); pub const SDP_ATTRIB_HID_SSR_HOST_MAX_LATENCY = @as(u32, 527); pub const SDP_ATTRIB_HID_SSR_HOST_MIN_TIMEOUT = @as(u32, 528); pub const SDP_ATTRIB_A2DP_SUPPORTED_FEATURES = @as(u32, 785); pub const SDP_ATTRIB_AVRCP_SUPPORTED_FEATURES = @as(u32, 785); pub const SDP_ATTRIB_HFP_SUPPORTED_FEATURES = @as(u32, 785); pub const AVRCP_SUPPORTED_FEATURES_CATEGORY_1 = @as(u32, 1); pub const AVRCP_SUPPORTED_FEATURES_CATEGORY_2 = @as(u32, 2); pub const AVRCP_SUPPORTED_FEATURES_CATEGORY_3 = @as(u32, 4); pub const AVRCP_SUPPORTED_FEATURES_CATEGORY_4 = @as(u32, 8); pub const AVRCP_SUPPORTED_FEATURES_CT_BROWSING = @as(u32, 64); pub const AVRCP_SUPPORTED_FEATURES_CT_COVER_ART_IMAGE_PROPERTIES = @as(u32, 128); pub const AVRCP_SUPPORTED_FEATURES_CT_COVER_ART_IMAGE = @as(u32, 256); pub const AVRCP_SUPPORTED_FEATURES_CT_COVER_ART_LINKED_THUMBNAIL = @as(u32, 512); pub const AVRCP_SUPPORTED_FEATURES_TG_PLAYER_APPLICATION_SETTINGS = @as(u32, 16); pub const AVRCP_SUPPORTED_FEATURES_TG_GROUP_NAVIGATION = @as(u32, 32); pub const AVRCP_SUPPORTED_FEATURES_TG_BROWSING = @as(u32, 64); pub const AVRCP_SUPPORTED_FEATURES_TG_MULTIPLE_PLAYER_APPLICATIONS = @as(u32, 128); pub const AVRCP_SUPPORTED_FEATURES_TG_COVER_ART = @as(u32, 256); pub const A2DP_SINK_SUPPORTED_FEATURES_HEADPHONE = @as(u32, 1); pub const A2DP_SINK_SUPPORTED_FEATURES_SPEAKER = @as(u32, 2); pub const A2DP_SINK_SUPPORTED_FEATURES_RECORDER = @as(u32, 4); pub const A2DP_SINK_SUPPORTED_FEATURES_AMPLIFIER = @as(u32, 8); pub const A2DP_SOURCE_SUPPORTED_FEATURES_PLAYER = @as(u32, 1); pub const A2DP_SOURCE_SUPPORTED_FEATURES_MICROPHONE = @as(u32, 2); pub const A2DP_SOURCE_SUPPORTED_FEATURES_TUNER = @as(u32, 4); pub const A2DP_SOURCE_SUPPORTED_FEATURES_MIXER = @as(u32, 8); pub const CORDLESS_EXTERNAL_NETWORK_PSTN = @as(u32, 1); pub const CORDLESS_EXTERNAL_NETWORK_ISDN = @as(u32, 2); pub const CORDLESS_EXTERNAL_NETWORK_GSM = @as(u32, 3); pub const CORDLESS_EXTERNAL_NETWORK_CDMA = @as(u32, 4); pub const CORDLESS_EXTERNAL_NETWORK_ANALOG_CELLULAR = @as(u32, 5); pub const CORDLESS_EXTERNAL_NETWORK_PACKET_SWITCHED = @as(u32, 6); pub const CORDLESS_EXTERNAL_NETWORK_OTHER = @as(u32, 7); pub const OBJECT_PUSH_FORMAT_VCARD_2_1 = @as(u32, 1); pub const OBJECT_PUSH_FORMAT_VCARD_3_0 = @as(u32, 2); pub const OBJECT_PUSH_FORMAT_VCAL_1_0 = @as(u32, 3); pub const OBJECT_PUSH_FORMAT_ICAL_2_0 = @as(u32, 4); pub const OBJECT_PUSH_FORMAT_VNOTE = @as(u32, 5); pub const OBJECT_PUSH_FORMAT_VMESSAGE = @as(u32, 6); pub const OBJECT_PUSH_FORMAT_ANY = @as(u32, 255); pub const SYNCH_DATA_STORE_PHONEBOOK = @as(u32, 1); pub const SYNCH_DATA_STORE_CALENDAR = @as(u32, 3); pub const SYNCH_DATA_STORE_NOTES = @as(u32, 5); pub const SYNCH_DATA_STORE_MESSAGES = @as(u32, 6); pub const DI_VENDOR_ID_SOURCE_BLUETOOTH_SIG = @as(u32, 1); pub const DI_VENDOR_ID_SOURCE_USB_IF = @as(u32, 2); pub const PSM_SDP = @as(u32, 1); pub const PSM_RFCOMM = @as(u32, 3); pub const PSM_TCS_BIN = @as(u32, 5); pub const PSM_TCS_BIN_CORDLESS = @as(u32, 7); pub const PSM_BNEP = @as(u32, 15); pub const PSM_HID_CONTROL = @as(u32, 17); pub const PSM_HID_INTERRUPT = @as(u32, 19); pub const PSM_UPNP = @as(u32, 21); pub const PSM_AVCTP = @as(u32, 23); pub const PSM_AVDTP = @as(u32, 25); pub const PSM_AVCTP_BROWSE = @as(u32, 27); pub const PSM_UDI_C_PLANE = @as(u32, 29); pub const PSM_ATT = @as(u32, 31); pub const PSM_3DSP = @as(u32, 33); pub const PSM_LE_IPSP = @as(u32, 35); //-------------------------------------------------------------------------------- // Section: Types (49) //-------------------------------------------------------------------------------- pub const SDP_LARGE_INTEGER_16 = extern struct { LowPart: u64, HighPart: i64, }; pub const SDP_ULARGE_INTEGER_16 = extern struct { LowPart: u64, HighPart: u64, }; pub const NodeContainerType = enum(i32) { Sequence = 0, Alternative = 1, }; pub const NodeContainerTypeSequence = NodeContainerType.Sequence; pub const NodeContainerTypeAlternative = NodeContainerType.Alternative; pub const SDP_TYPE = enum(i32) { NIL = 0, UINT = 1, INT = 2, UUID = 3, STRING = 4, BOOLEAN = 5, SEQUENCE = 6, ALTERNATIVE = 7, URL = 8, CONTAINER = 32, }; pub const SDP_TYPE_NIL = SDP_TYPE.NIL; pub const SDP_TYPE_UINT = SDP_TYPE.UINT; pub const SDP_TYPE_INT = SDP_TYPE.INT; pub const SDP_TYPE_UUID = SDP_TYPE.UUID; pub const SDP_TYPE_STRING = SDP_TYPE.STRING; pub const SDP_TYPE_BOOLEAN = SDP_TYPE.BOOLEAN; pub const SDP_TYPE_SEQUENCE = SDP_TYPE.SEQUENCE; pub const SDP_TYPE_ALTERNATIVE = SDP_TYPE.ALTERNATIVE; pub const SDP_TYPE_URL = SDP_TYPE.URL; pub const SDP_TYPE_CONTAINER = SDP_TYPE.CONTAINER; pub const SDP_SPECIFICTYPE = enum(i32) { NONE = 0, UINT8 = 16, UINT16 = 272, UINT32 = 528, UINT64 = 784, UINT128 = 1040, INT8 = 32, INT16 = 288, INT32 = 544, INT64 = 800, INT128 = 1056, UUID16 = 304, // UUID32 = 544, this enum value conflicts with INT32 UUID128 = 1072, }; pub const SDP_ST_NONE = SDP_SPECIFICTYPE.NONE; pub const SDP_ST_UINT8 = SDP_SPECIFICTYPE.UINT8; pub const SDP_ST_UINT16 = SDP_SPECIFICTYPE.UINT16; pub const SDP_ST_UINT32 = SDP_SPECIFICTYPE.UINT32; pub const SDP_ST_UINT64 = SDP_SPECIFICTYPE.UINT64; pub const SDP_ST_UINT128 = SDP_SPECIFICTYPE.UINT128; pub const SDP_ST_INT8 = SDP_SPECIFICTYPE.INT8; pub const SDP_ST_INT16 = SDP_SPECIFICTYPE.INT16; pub const SDP_ST_INT32 = SDP_SPECIFICTYPE.INT32; pub const SDP_ST_INT64 = SDP_SPECIFICTYPE.INT64; pub const SDP_ST_INT128 = SDP_SPECIFICTYPE.INT128; pub const SDP_ST_UUID16 = SDP_SPECIFICTYPE.UUID16; pub const SDP_ST_UUID32 = SDP_SPECIFICTYPE.INT32; pub const SDP_ST_UUID128 = SDP_SPECIFICTYPE.UUID128; pub const SdpAttributeRange = extern struct { minAttribute: u16, maxAttribute: u16, }; pub const SdpQueryUuidUnion = extern union { uuid128: Guid, uuid32: u32, uuid16: u16, }; pub const SdpQueryUuid = extern struct { u: SdpQueryUuidUnion, uuidType: u16, }; pub const BTH_DEVICE_INFO = extern struct { flags: u32, address: u64, classOfDevice: u32, name: [248]CHAR, }; pub const BTH_RADIO_IN_RANGE = extern struct { deviceInfo: BTH_DEVICE_INFO, previousDeviceFlags: u32, }; pub const BTH_L2CAP_EVENT_INFO = extern struct { bthAddress: u64, psm: u16, connected: u8, initiated: u8, }; pub const BTH_HCI_EVENT_INFO = extern struct { bthAddress: u64, connectionType: u8, connected: u8, }; pub const IO_CAPABILITY = enum(i32) { DisplayOnly = 0, DisplayYesNo = 1, KeyboardOnly = 2, NoInputNoOutput = 3, Undefined = 255, }; pub const IoCaps_DisplayOnly = IO_CAPABILITY.DisplayOnly; pub const IoCaps_DisplayYesNo = IO_CAPABILITY.DisplayYesNo; pub const IoCaps_KeyboardOnly = IO_CAPABILITY.KeyboardOnly; pub const IoCaps_NoInputNoOutput = IO_CAPABILITY.NoInputNoOutput; pub const IoCaps_Undefined = IO_CAPABILITY.Undefined; pub const AUTHENTICATION_REQUIREMENTS = enum(i32) { NotRequired = 0, Required = 1, NotRequiredBonding = 2, RequiredBonding = 3, NotRequiredGeneralBonding = 4, RequiredGeneralBonding = 5, NotDefined = 255, }; pub const MITMProtectionNotRequired = AUTHENTICATION_REQUIREMENTS.NotRequired; pub const MITMProtectionRequired = AUTHENTICATION_REQUIREMENTS.Required; pub const MITMProtectionNotRequiredBonding = AUTHENTICATION_REQUIREMENTS.NotRequiredBonding; pub const MITMProtectionRequiredBonding = AUTHENTICATION_REQUIREMENTS.RequiredBonding; pub const MITMProtectionNotRequiredGeneralBonding = AUTHENTICATION_REQUIREMENTS.NotRequiredGeneralBonding; pub const MITMProtectionRequiredGeneralBonding = AUTHENTICATION_REQUIREMENTS.RequiredGeneralBonding; pub const MITMProtectionNotDefined = AUTHENTICATION_REQUIREMENTS.NotDefined; pub const BLUETOOTH_ADDRESS = extern struct { Anonymous: extern union { ullLong: u64, rgBytes: [6]u8, }, }; pub const BLUETOOTH_LOCAL_SERVICE_INFO = extern struct { Enabled: BOOL, btAddr: BLUETOOTH_ADDRESS, szName: [256]u16, szDeviceString: [256]u16, }; pub const BLUETOOTH_FIND_RADIO_PARAMS = extern struct { dwSize: u32, }; pub const BLUETOOTH_RADIO_INFO = extern struct { dwSize: u32, address: BLUETOOTH_ADDRESS, szName: [248]u16, ulClassofDevice: u32, lmpSubversion: u16, manufacturer: u16, }; pub const BLUETOOTH_DEVICE_INFO = extern struct { dwSize: u32, Address: BLUETOOTH_ADDRESS, ulClassofDevice: u32, fConnected: BOOL, fRemembered: BOOL, fAuthenticated: BOOL, stLastSeen: SYSTEMTIME, stLastUsed: SYSTEMTIME, szName: [248]u16, }; pub const BLUETOOTH_AUTHENTICATION_METHOD = enum(i32) { LEGACY = 1, OOB = 2, NUMERIC_COMPARISON = 3, PASSKEY_NOTIFICATION = 4, PASSKEY = 5, }; pub const BLUETOOTH_AUTHENTICATION_METHOD_LEGACY = BLUETOOTH_AUTHENTICATION_METHOD.LEGACY; pub const BLUETOOTH_AUTHENTICATION_METHOD_OOB = BLUETOOTH_AUTHENTICATION_METHOD.OOB; pub const BLUETOOTH_AUTHENTICATION_METHOD_NUMERIC_COMPARISON = BLUETOOTH_AUTHENTICATION_METHOD.NUMERIC_COMPARISON; pub const BLUETOOTH_AUTHENTICATION_METHOD_PASSKEY_NOTIFICATION = BLUETOOTH_AUTHENTICATION_METHOD.PASSKEY_NOTIFICATION; pub const BLUETOOTH_AUTHENTICATION_METHOD_PASSKEY = BLUETOOTH_AUTHENTICATION_METHOD.PASSKEY; pub const BLUETOOTH_IO_CAPABILITY = enum(i32) { DISPLAYONLY = 0, DISPLAYYESNO = 1, KEYBOARDONLY = 2, NOINPUTNOOUTPUT = 3, UNDEFINED = 255, }; pub const BLUETOOTH_IO_CAPABILITY_DISPLAYONLY = BLUETOOTH_IO_CAPABILITY.DISPLAYONLY; pub const BLUETOOTH_IO_CAPABILITY_DISPLAYYESNO = BLUETOOTH_IO_CAPABILITY.DISPLAYYESNO; pub const BLUETOOTH_IO_CAPABILITY_KEYBOARDONLY = BLUETOOTH_IO_CAPABILITY.KEYBOARDONLY; pub const BLUETOOTH_IO_CAPABILITY_NOINPUTNOOUTPUT = BLUETOOTH_IO_CAPABILITY.NOINPUTNOOUTPUT; pub const BLUETOOTH_IO_CAPABILITY_UNDEFINED = BLUETOOTH_IO_CAPABILITY.UNDEFINED; pub const BLUETOOTH_AUTHENTICATION_REQUIREMENTS = enum(i32) { NotRequired = 0, Required = 1, NotRequiredBonding = 2, RequiredBonding = 3, NotRequiredGeneralBonding = 4, RequiredGeneralBonding = 5, NotDefined = 255, }; pub const BLUETOOTH_MITM_ProtectionNotRequired = BLUETOOTH_AUTHENTICATION_REQUIREMENTS.NotRequired; pub const BLUETOOTH_MITM_ProtectionRequired = BLUETOOTH_AUTHENTICATION_REQUIREMENTS.Required; pub const BLUETOOTH_MITM_ProtectionNotRequiredBonding = BLUETOOTH_AUTHENTICATION_REQUIREMENTS.NotRequiredBonding; pub const BLUETOOTH_MITM_ProtectionRequiredBonding = BLUETOOTH_AUTHENTICATION_REQUIREMENTS.RequiredBonding; pub const BLUETOOTH_MITM_ProtectionNotRequiredGeneralBonding = BLUETOOTH_AUTHENTICATION_REQUIREMENTS.NotRequiredGeneralBonding; pub const BLUETOOTH_MITM_ProtectionRequiredGeneralBonding = BLUETOOTH_AUTHENTICATION_REQUIREMENTS.RequiredGeneralBonding; pub const BLUETOOTH_MITM_ProtectionNotDefined = BLUETOOTH_AUTHENTICATION_REQUIREMENTS.NotDefined; pub const BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS = extern struct { deviceInfo: BLUETOOTH_DEVICE_INFO, authenticationMethod: BLUETOOTH_AUTHENTICATION_METHOD, ioCapability: BLUETOOTH_IO_CAPABILITY, authenticationRequirements: BLUETOOTH_AUTHENTICATION_REQUIREMENTS, Anonymous: extern union { Numeric_Value: u32, Passkey: u32, }, }; pub const BLUETOOTH_DEVICE_SEARCH_PARAMS = extern struct { dwSize: u32, fReturnAuthenticated: BOOL, fReturnRemembered: BOOL, fReturnUnknown: BOOL, fReturnConnected: BOOL, fIssueInquiry: BOOL, cTimeoutMultiplier: u8, hRadio: ?HANDLE, }; pub const BLUETOOTH_COD_PAIRS = extern struct { ulCODMask: u32, pcszDescription: ?[*:0]const u16, }; pub const PFN_DEVICE_CALLBACK = fn( pvParam: ?*c_void, pDevice: ?*const BLUETOOTH_DEVICE_INFO, ) callconv(@import("std").os.windows.WINAPI) BOOL; pub const BLUETOOTH_SELECT_DEVICE_PARAMS = extern struct { dwSize: u32, cNumOfClasses: u32, prgClassOfDevices: ?*BLUETOOTH_COD_PAIRS, pszInfo: ?PWSTR, hwndParent: ?HWND, fForceAuthentication: BOOL, fShowAuthenticated: BOOL, fShowRemembered: BOOL, fShowUnknown: BOOL, fAddNewDeviceWizard: BOOL, fSkipServicesPage: BOOL, pfnDeviceCallback: ?PFN_DEVICE_CALLBACK, pvParam: ?*c_void, cNumDevices: u32, pDevices: ?*BLUETOOTH_DEVICE_INFO, }; pub const BLUETOOTH_PIN_INFO = extern struct { pin: [16]u8, pinLength: u8, }; pub const BLUETOOTH_OOB_DATA_INFO = extern struct { C: [16]u8, R: [16]u8, }; pub const BLUETOOTH_NUMERIC_COMPARISON_INFO = extern struct { NumericValue: u32, }; pub const BLUETOOTH_PASSKEY_INFO = extern struct { passkey: u32, }; pub const PFN_AUTHENTICATION_CALLBACK = fn( pvParam: ?*c_void, pDevice: ?*BLUETOOTH_DEVICE_INFO, ) callconv(@import("std").os.windows.WINAPI) BOOL; pub const PFN_AUTHENTICATION_CALLBACK_EX = fn( pvParam: ?*c_void, pAuthCallbackParams: ?*BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS, ) callconv(@import("std").os.windows.WINAPI) BOOL; pub const BLUETOOTH_AUTHENTICATE_RESPONSE = extern struct { bthAddressRemote: BLUETOOTH_ADDRESS, authMethod: BLUETOOTH_AUTHENTICATION_METHOD, Anonymous: extern union { pinInfo: BLUETOOTH_PIN_INFO, oobInfo: BLUETOOTH_OOB_DATA_INFO, numericCompInfo: BLUETOOTH_NUMERIC_COMPARISON_INFO, passkeyInfo: BLUETOOTH_PASSKEY_INFO, }, negativeResponse: u8, }; pub const SDP_ELEMENT_DATA = extern struct { type: SDP_TYPE, specificType: SDP_SPECIFICTYPE, data: extern union { int128: SDP_LARGE_INTEGER_16, int64: i64, int32: i32, int16: i16, int8: CHAR, uint128: SDP_ULARGE_INTEGER_16, uint64: u64, uint32: u32, uint16: u16, uint8: u8, booleanVal: u8, uuid128: Guid, uuid32: u32, uuid16: u16, string: extern struct { value: ?*u8, length: u32, }, url: extern struct { value: ?*u8, length: u32, }, sequence: extern struct { value: ?*u8, length: u32, }, alternative: extern struct { value: ?*u8, length: u32, }, }, }; pub const SDP_STRING_TYPE_DATA = extern struct { encoding: u16, mibeNum: u16, attributeId: u16, }; pub const PFN_BLUETOOTH_ENUM_ATTRIBUTES_CALLBACK = fn( uAttribId: u32, // TODO: what to do with BytesParamIndex 2? pValueStream: ?*u8, cbStreamSize: u32, pvParam: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) BOOL; pub const SOCKADDR_BTH = packed struct { addressFamily: u16, btAddr: u64, serviceClassId: Guid, port: u32, }; pub const BTH_SET_SERVICE = packed struct { pSdpVersion: ?*u32, pRecordHandle: ?*?HANDLE, fCodService: u32, Reserved: [5]u32, ulRecordLength: u32, pRecord: [1]u8, }; pub const BTH_QUERY_DEVICE = packed struct { LAP: u32, length: u8, }; pub const BTH_QUERY_SERVICE = packed struct { type: u32, serviceHandle: u32, uuids: [12]SdpQueryUuid, numRange: u32, pRange: [1]SdpAttributeRange, }; pub const RFCOMM_MSC_DATA = extern struct { Signals: u8, Break: u8, }; pub const RFCOMM_RLS_DATA = extern struct { LineStatus: u8, }; pub const RFCOMM_RPN_DATA = extern struct { Baud: u8, Data: u8, FlowControl: u8, XonChar: u8, XoffChar: u8, ParameterMask1: u8, ParameterMask2: u8, }; pub const RFCOMM_COMMAND = packed struct { CmdType: u32, Data: extern union { MSC: RFCOMM_MSC_DATA, RLS: RFCOMM_RLS_DATA, RPN: RFCOMM_RPN_DATA, }, }; pub const BTH_PING_REQ = packed struct { btAddr: u64, dataLen: u8, data: [44]u8, }; pub const BTH_PING_RSP = extern struct { dataLen: u8, data: [44]u8, }; pub const BTH_INFO_REQ = packed struct { btAddr: u64, infoType: u16, }; pub const BTH_INFO_RSP = packed struct { result: u16, dataLen: u8, Anonymous: packed union { connectionlessMTU: u16, data: [44]u8, }, }; //-------------------------------------------------------------------------------- // Section: Functions (34) //-------------------------------------------------------------------------------- // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothFindFirstRadio( pbtfrp: ?*const BLUETOOTH_FIND_RADIO_PARAMS, phRadio: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) isize; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothFindNextRadio( hFind: isize, phRadio: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothFindRadioClose( hFind: isize, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothGetRadioInfo( hRadio: ?HANDLE, pRadioInfo: ?*BLUETOOTH_RADIO_INFO, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothFindFirstDevice( pbtsp: ?*const BLUETOOTH_DEVICE_SEARCH_PARAMS, pbtdi: ?*BLUETOOTH_DEVICE_INFO, ) callconv(@import("std").os.windows.WINAPI) isize; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothFindNextDevice( hFind: isize, pbtdi: ?*BLUETOOTH_DEVICE_INFO, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothFindDeviceClose( hFind: isize, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothGetDeviceInfo( hRadio: ?HANDLE, pbtdi: ?*BLUETOOTH_DEVICE_INFO, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothUpdateDeviceRecord( pbtdi: ?*const BLUETOOTH_DEVICE_INFO, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothRemoveDevice( pAddress: ?*const BLUETOOTH_ADDRESS, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "bthprops" fn BluetoothSelectDevices( pbtsdp: ?*BLUETOOTH_SELECT_DEVICE_PARAMS, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "bthprops" fn BluetoothSelectDevicesFree( pbtsdp: ?*BLUETOOTH_SELECT_DEVICE_PARAMS, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "bthprops" fn BluetoothDisplayDeviceProperties( hwndParent: ?HWND, pbtdi: ?*BLUETOOTH_DEVICE_INFO, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "bthprops" fn BluetoothAuthenticateDevice( hwndParent: ?HWND, hRadio: ?HANDLE, pbtbi: ?*BLUETOOTH_DEVICE_INFO, pszPasskey: ?[*:0]u16, ulPasskeyLength: u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "bthprops" fn BluetoothAuthenticateDeviceEx( hwndParentIn: ?HWND, hRadioIn: ?HANDLE, pbtdiInout: ?*BLUETOOTH_DEVICE_INFO, pbtOobData: ?*BLUETOOTH_OOB_DATA_INFO, authenticationRequirement: AUTHENTICATION_REQUIREMENTS, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "bthprops" fn BluetoothAuthenticateMultipleDevices( hwndParent: ?HWND, hRadio: ?HANDLE, cDevices: u32, rgbtdi: [*]BLUETOOTH_DEVICE_INFO, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothSetServiceState( hRadio: ?HANDLE, pbtdi: ?*const BLUETOOTH_DEVICE_INFO, pGuidService: ?*const Guid, dwServiceFlags: u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothEnumerateInstalledServices( hRadio: ?HANDLE, pbtdi: ?*const BLUETOOTH_DEVICE_INFO, pcServiceInout: ?*u32, pGuidServices: ?[*]Guid, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothEnableDiscovery( hRadio: ?HANDLE, fEnabled: BOOL, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothIsDiscoverable( hRadio: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothEnableIncomingConnections( hRadio: ?HANDLE, fEnabled: BOOL, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothIsConnectable( hRadio: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothRegisterForAuthentication( pbtdi: ?*const BLUETOOTH_DEVICE_INFO, phRegHandle: ?*isize, pfnCallback: ?PFN_AUTHENTICATION_CALLBACK, pvParam: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothRegisterForAuthenticationEx( pbtdiIn: ?*const BLUETOOTH_DEVICE_INFO, phRegHandleOut: ?*isize, pfnCallbackIn: ?PFN_AUTHENTICATION_CALLBACK_EX, pvParam: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothUnregisterAuthentication( hRegHandle: isize, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothSendAuthenticationResponse( hRadio: ?HANDLE, pbtdi: ?*const BLUETOOTH_DEVICE_INFO, pszPasskey: ?[*:0]const u16, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothSendAuthenticationResponseEx( hRadioIn: ?HANDLE, pauthResponse: ?*BLUETOOTH_AUTHENTICATE_RESPONSE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothSdpGetElementData( // TODO: what to do with BytesParamIndex 1? pSdpStream: ?*u8, cbSdpStreamLength: u32, pData: ?*SDP_ELEMENT_DATA, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothSdpGetContainerElementData( // TODO: what to do with BytesParamIndex 1? pContainerStream: ?*u8, cbContainerLength: u32, pElement: ?*isize, pData: ?*SDP_ELEMENT_DATA, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothSdpGetAttributeValue( // TODO: what to do with BytesParamIndex 1? pRecordStream: ?*u8, cbRecordLength: u32, usAttributeId: u16, pAttributeData: ?*SDP_ELEMENT_DATA, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothSdpGetString( // TODO: what to do with BytesParamIndex 1? pRecordStream: ?*u8, cbRecordLength: u32, pStringData: ?*const SDP_STRING_TYPE_DATA, usStringOffset: u16, pszString: [*:0]u16, pcchStringLength: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothSdpEnumAttributes( // TODO: what to do with BytesParamIndex 1? pSDPStream: ?*u8, cbStreamSize: u32, pfnCallback: ?PFN_BLUETOOTH_ENUM_ATTRIBUTES_CALLBACK, pvParam: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'Windows Vista' pub extern "BluetoothApis" fn BluetoothSetLocalServiceInfo( hRadioIn: ?HANDLE, pClassGuid: ?*const Guid, ulInstance: u32, pServiceInfoIn: ?*const BLUETOOTH_LOCAL_SERVICE_INFO, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "BluetoothApis" fn BluetoothIsVersionAvailable( MajorVersion: u8, MinorVersion: u8, ) callconv(@import("std").os.windows.WINAPI) BOOL; //-------------------------------------------------------------------------------- // Section: Unicode Aliases (0) //-------------------------------------------------------------------------------- const thismodule = @This(); pub usingnamespace switch (@import("../zig.zig").unicode_mode) { .ansi => struct { }, .wide => struct { }, .unspecified => if (@import("builtin").is_test) struct { } else struct { }, }; //-------------------------------------------------------------------------------- // Section: Imports (7) //-------------------------------------------------------------------------------- const Guid = @import("../zig.zig").Guid; const BOOL = @import("../foundation.zig").BOOL; const CHAR = @import("../system/system_services.zig").CHAR; const HANDLE = @import("../foundation.zig").HANDLE; const HWND = @import("../foundation.zig").HWND; const PWSTR = @import("../foundation.zig").PWSTR; const SYSTEMTIME = @import("../foundation.zig").SYSTEMTIME; test { // The following '_ = <FuncPtrType>' lines are a workaround for https://github.com/ziglang/zig/issues/4476 if (@hasDecl(@This(), "PFN_DEVICE_CALLBACK")) { _ = PFN_DEVICE_CALLBACK; } if (@hasDecl(@This(), "PFN_AUTHENTICATION_CALLBACK")) { _ = PFN_AUTHENTICATION_CALLBACK; } if (@hasDecl(@This(), "PFN_AUTHENTICATION_CALLBACK_EX")) { _ = PFN_AUTHENTICATION_CALLBACK_EX; } if (@hasDecl(@This(), "PFN_BLUETOOTH_ENUM_ATTRIBUTES_CALLBACK")) { _ = PFN_BLUETOOTH_ENUM_ATTRIBUTES_CALLBACK; } @setEvalBranchQuota( @import("std").meta.declarations(@This()).len * 3 ); // reference all the pub declarations if (!@import("builtin").is_test) return; inline for (@import("std").meta.declarations(@This())) |decl| { if (decl.is_pub) { _ = decl; } } }
deps/zigwin32/win32/devices/bluetooth.zig
const std = @import("std"); const mem = std.mem; const unicode = std.unicode; /// `caseFoldStr` will caseFold the code points in str, producing a slice of u8 with the new bytes. /// Caller must free returned bytes. pub fn caseFoldStr(allocator: *mem.Allocator, str: []const u8) ![]u8 { var result = std.ArrayList(u8).init(allocator); defer result.deinit(); var code_points = std.ArrayList(u21).init(allocator); defer code_points.deinit(); // Gather decomposed code points. var iter = (try unicode.Utf8View.init(str)).iterator(); while (iter.nextCodepoint()) |cp| { for (toCaseFold(cp)) |fcp| { if (fcp == 0) break; try code_points.append(fcp); } } // Encode as UTF-8 code units. var buf: [4]u8 = undefined; for (code_points.items) |dcp| { const len = try unicode.utf8Encode(dcp, &buf); try result.appendSlice(buf[0..len]); } return result.toOwnedSlice(); } /// `toCaseFold` will convert a code point into its case folded equivalent. Note that this can result /// in a mapping to more than one code point, known as the full case fold. pub fn toCaseFold(cp: u21) [3]u21 { return switch (cp) { 0x41 => [3]u21{ 0x61, 0, 0 }, 0x42 => [3]u21{ 0x62, 0, 0 }, 0x43 => [3]u21{ 0x63, 0, 0 }, 0x44 => [3]u21{ 0x64, 0, 0 }, 0x45 => [3]u21{ 0x65, 0, 0 }, 0x46 => [3]u21{ 0x66, 0, 0 }, 0x47 => [3]u21{ 0x67, 0, 0 }, 0x48 => [3]u21{ 0x68, 0, 0 }, 0x49 => [3]u21{ 0x69, 0, 0 }, 0x4A => [3]u21{ 0x6A, 0, 0 }, 0x4B => [3]u21{ 0x6B, 0, 0 }, 0x4C => [3]u21{ 0x6C, 0, 0 }, 0x4D => [3]u21{ 0x6D, 0, 0 }, 0x4E => [3]u21{ 0x6E, 0, 0 }, 0x4F => [3]u21{ 0x6F, 0, 0 }, 0x50 => [3]u21{ 0x70, 0, 0 }, 0x51 => [3]u21{ 0x71, 0, 0 }, 0x52 => [3]u21{ 0x72, 0, 0 }, 0x53 => [3]u21{ 0x73, 0, 0 }, 0x54 => [3]u21{ 0x74, 0, 0 }, 0x55 => [3]u21{ 0x75, 0, 0 }, 0x56 => [3]u21{ 0x76, 0, 0 }, 0x57 => [3]u21{ 0x77, 0, 0 }, 0x58 => [3]u21{ 0x78, 0, 0 }, 0x59 => [3]u21{ 0x79, 0, 0 }, 0x5A => [3]u21{ 0x7A, 0, 0 }, 0xB5 => [3]u21{ 0x3BC, 0, 0 }, 0xC0 => [3]u21{ 0xE0, 0, 0 }, 0xC1 => [3]u21{ 0xE1, 0, 0 }, 0xC2 => [3]u21{ 0xE2, 0, 0 }, 0xC3 => [3]u21{ 0xE3, 0, 0 }, 0xC4 => [3]u21{ 0xE4, 0, 0 }, 0xC5 => [3]u21{ 0xE5, 0, 0 }, 0xC6 => [3]u21{ 0xE6, 0, 0 }, 0xC7 => [3]u21{ 0xE7, 0, 0 }, 0xC8 => [3]u21{ 0xE8, 0, 0 }, 0xC9 => [3]u21{ 0xE9, 0, 0 }, 0xCA => [3]u21{ 0xEA, 0, 0 }, 0xCB => [3]u21{ 0xEB, 0, 0 }, 0xCC => [3]u21{ 0xEC, 0, 0 }, 0xCD => [3]u21{ 0xED, 0, 0 }, 0xCE => [3]u21{ 0xEE, 0, 0 }, 0xCF => [3]u21{ 0xEF, 0, 0 }, 0xD0 => [3]u21{ 0xF0, 0, 0 }, 0xD1 => [3]u21{ 0xF1, 0, 0 }, 0xD2 => [3]u21{ 0xF2, 0, 0 }, 0xD3 => [3]u21{ 0xF3, 0, 0 }, 0xD4 => [3]u21{ 0xF4, 0, 0 }, 0xD5 => [3]u21{ 0xF5, 0, 0 }, 0xD6 => [3]u21{ 0xF6, 0, 0 }, 0xD8 => [3]u21{ 0xF8, 0, 0 }, 0xD9 => [3]u21{ 0xF9, 0, 0 }, 0xDA => [3]u21{ 0xFA, 0, 0 }, 0xDB => [3]u21{ 0xFB, 0, 0 }, 0xDC => [3]u21{ 0xFC, 0, 0 }, 0xDD => [3]u21{ 0xFD, 0, 0 }, 0xDE => [3]u21{ 0xFE, 0, 0 }, 0xDF => [3]u21{ 0x73, 0x73, 0 }, 0x100 => [3]u21{ 0x101, 0, 0 }, 0x102 => [3]u21{ 0x103, 0, 0 }, 0x104 => [3]u21{ 0x105, 0, 0 }, 0x106 => [3]u21{ 0x107, 0, 0 }, 0x108 => [3]u21{ 0x109, 0, 0 }, 0x10A => [3]u21{ 0x10B, 0, 0 }, 0x10C => [3]u21{ 0x10D, 0, 0 }, 0x10E => [3]u21{ 0x10F, 0, 0 }, 0x110 => [3]u21{ 0x111, 0, 0 }, 0x112 => [3]u21{ 0x113, 0, 0 }, 0x114 => [3]u21{ 0x115, 0, 0 }, 0x116 => [3]u21{ 0x117, 0, 0 }, 0x118 => [3]u21{ 0x119, 0, 0 }, 0x11A => [3]u21{ 0x11B, 0, 0 }, 0x11C => [3]u21{ 0x11D, 0, 0 }, 0x11E => [3]u21{ 0x11F, 0, 0 }, 0x120 => [3]u21{ 0x121, 0, 0 }, 0x122 => [3]u21{ 0x123, 0, 0 }, 0x124 => [3]u21{ 0x125, 0, 0 }, 0x126 => [3]u21{ 0x127, 0, 0 }, 0x128 => [3]u21{ 0x129, 0, 0 }, 0x12A => [3]u21{ 0x12B, 0, 0 }, 0x12C => [3]u21{ 0x12D, 0, 0 }, 0x12E => [3]u21{ 0x12F, 0, 0 }, 0x130 => [3]u21{ 0x69, 0x307, 0 }, 0x132 => [3]u21{ 0x133, 0, 0 }, 0x134 => [3]u21{ 0x135, 0, 0 }, 0x136 => [3]u21{ 0x137, 0, 0 }, 0x139 => [3]u21{ 0x13A, 0, 0 }, 0x13B => [3]u21{ 0x13C, 0, 0 }, 0x13D => [3]u21{ 0x13E, 0, 0 }, 0x13F => [3]u21{ 0x140, 0, 0 }, 0x141 => [3]u21{ 0x142, 0, 0 }, 0x143 => [3]u21{ 0x144, 0, 0 }, 0x145 => [3]u21{ 0x146, 0, 0 }, 0x147 => [3]u21{ 0x148, 0, 0 }, 0x149 => [3]u21{ 0x2BC, 0x6E, 0 }, 0x14A => [3]u21{ 0x14B, 0, 0 }, 0x14C => [3]u21{ 0x14D, 0, 0 }, 0x14E => [3]u21{ 0x14F, 0, 0 }, 0x150 => [3]u21{ 0x151, 0, 0 }, 0x152 => [3]u21{ 0x153, 0, 0 }, 0x154 => [3]u21{ 0x155, 0, 0 }, 0x156 => [3]u21{ 0x157, 0, 0 }, 0x158 => [3]u21{ 0x159, 0, 0 }, 0x15A => [3]u21{ 0x15B, 0, 0 }, 0x15C => [3]u21{ 0x15D, 0, 0 }, 0x15E => [3]u21{ 0x15F, 0, 0 }, 0x160 => [3]u21{ 0x161, 0, 0 }, 0x162 => [3]u21{ 0x163, 0, 0 }, 0x164 => [3]u21{ 0x165, 0, 0 }, 0x166 => [3]u21{ 0x167, 0, 0 }, 0x168 => [3]u21{ 0x169, 0, 0 }, 0x16A => [3]u21{ 0x16B, 0, 0 }, 0x16C => [3]u21{ 0x16D, 0, 0 }, 0x16E => [3]u21{ 0x16F, 0, 0 }, 0x170 => [3]u21{ 0x171, 0, 0 }, 0x172 => [3]u21{ 0x173, 0, 0 }, 0x174 => [3]u21{ 0x175, 0, 0 }, 0x176 => [3]u21{ 0x177, 0, 0 }, 0x178 => [3]u21{ 0xFF, 0, 0 }, 0x179 => [3]u21{ 0x17A, 0, 0 }, 0x17B => [3]u21{ 0x17C, 0, 0 }, 0x17D => [3]u21{ 0x17E, 0, 0 }, 0x17F => [3]u21{ 0x73, 0, 0 }, 0x181 => [3]u21{ 0x253, 0, 0 }, 0x182 => [3]u21{ 0x183, 0, 0 }, 0x184 => [3]u21{ 0x185, 0, 0 }, 0x186 => [3]u21{ 0x254, 0, 0 }, 0x187 => [3]u21{ 0x188, 0, 0 }, 0x189 => [3]u21{ 0x256, 0, 0 }, 0x18A => [3]u21{ 0x257, 0, 0 }, 0x18B => [3]u21{ 0x18C, 0, 0 }, 0x18E => [3]u21{ 0x1DD, 0, 0 }, 0x18F => [3]u21{ 0x259, 0, 0 }, 0x190 => [3]u21{ 0x25B, 0, 0 }, 0x191 => [3]u21{ 0x192, 0, 0 }, 0x193 => [3]u21{ 0x260, 0, 0 }, 0x194 => [3]u21{ 0x263, 0, 0 }, 0x196 => [3]u21{ 0x269, 0, 0 }, 0x197 => [3]u21{ 0x268, 0, 0 }, 0x198 => [3]u21{ 0x199, 0, 0 }, 0x19C => [3]u21{ 0x26F, 0, 0 }, 0x19D => [3]u21{ 0x272, 0, 0 }, 0x19F => [3]u21{ 0x275, 0, 0 }, 0x1A0 => [3]u21{ 0x1A1, 0, 0 }, 0x1A2 => [3]u21{ 0x1A3, 0, 0 }, 0x1A4 => [3]u21{ 0x1A5, 0, 0 }, 0x1A6 => [3]u21{ 0x280, 0, 0 }, 0x1A7 => [3]u21{ 0x1A8, 0, 0 }, 0x1A9 => [3]u21{ 0x283, 0, 0 }, 0x1AC => [3]u21{ 0x1AD, 0, 0 }, 0x1AE => [3]u21{ 0x288, 0, 0 }, 0x1AF => [3]u21{ 0x1B0, 0, 0 }, 0x1B1 => [3]u21{ 0x28A, 0, 0 }, 0x1B2 => [3]u21{ 0x28B, 0, 0 }, 0x1B3 => [3]u21{ 0x1B4, 0, 0 }, 0x1B5 => [3]u21{ 0x1B6, 0, 0 }, 0x1B7 => [3]u21{ 0x292, 0, 0 }, 0x1B8 => [3]u21{ 0x1B9, 0, 0 }, 0x1BC => [3]u21{ 0x1BD, 0, 0 }, 0x1C4 => [3]u21{ 0x1C6, 0, 0 }, 0x1C5 => [3]u21{ 0x1C6, 0, 0 }, 0x1C7 => [3]u21{ 0x1C9, 0, 0 }, 0x1C8 => [3]u21{ 0x1C9, 0, 0 }, 0x1CA => [3]u21{ 0x1CC, 0, 0 }, 0x1CB => [3]u21{ 0x1CC, 0, 0 }, 0x1CD => [3]u21{ 0x1CE, 0, 0 }, 0x1CF => [3]u21{ 0x1D0, 0, 0 }, 0x1D1 => [3]u21{ 0x1D2, 0, 0 }, 0x1D3 => [3]u21{ 0x1D4, 0, 0 }, 0x1D5 => [3]u21{ 0x1D6, 0, 0 }, 0x1D7 => [3]u21{ 0x1D8, 0, 0 }, 0x1D9 => [3]u21{ 0x1DA, 0, 0 }, 0x1DB => [3]u21{ 0x1DC, 0, 0 }, 0x1DE => [3]u21{ 0x1DF, 0, 0 }, 0x1E0 => [3]u21{ 0x1E1, 0, 0 }, 0x1E2 => [3]u21{ 0x1E3, 0, 0 }, 0x1E4 => [3]u21{ 0x1E5, 0, 0 }, 0x1E6 => [3]u21{ 0x1E7, 0, 0 }, 0x1E8 => [3]u21{ 0x1E9, 0, 0 }, 0x1EA => [3]u21{ 0x1EB, 0, 0 }, 0x1EC => [3]u21{ 0x1ED, 0, 0 }, 0x1EE => [3]u21{ 0x1EF, 0, 0 }, 0x1F0 => [3]u21{ 0x6A, 0x30C, 0 }, 0x1F1 => [3]u21{ 0x1F3, 0, 0 }, 0x1F2 => [3]u21{ 0x1F3, 0, 0 }, 0x1F4 => [3]u21{ 0x1F5, 0, 0 }, 0x1F6 => [3]u21{ 0x195, 0, 0 }, 0x1F7 => [3]u21{ 0x1BF, 0, 0 }, 0x1F8 => [3]u21{ 0x1F9, 0, 0 }, 0x1FA => [3]u21{ 0x1FB, 0, 0 }, 0x1FC => [3]u21{ 0x1FD, 0, 0 }, 0x1FE => [3]u21{ 0x1FF, 0, 0 }, 0x200 => [3]u21{ 0x201, 0, 0 }, 0x202 => [3]u21{ 0x203, 0, 0 }, 0x204 => [3]u21{ 0x205, 0, 0 }, 0x206 => [3]u21{ 0x207, 0, 0 }, 0x208 => [3]u21{ 0x209, 0, 0 }, 0x20A => [3]u21{ 0x20B, 0, 0 }, 0x20C => [3]u21{ 0x20D, 0, 0 }, 0x20E => [3]u21{ 0x20F, 0, 0 }, 0x210 => [3]u21{ 0x211, 0, 0 }, 0x212 => [3]u21{ 0x213, 0, 0 }, 0x214 => [3]u21{ 0x215, 0, 0 }, 0x216 => [3]u21{ 0x217, 0, 0 }, 0x218 => [3]u21{ 0x219, 0, 0 }, 0x21A => [3]u21{ 0x21B, 0, 0 }, 0x21C => [3]u21{ 0x21D, 0, 0 }, 0x21E => [3]u21{ 0x21F, 0, 0 }, 0x220 => [3]u21{ 0x19E, 0, 0 }, 0x222 => [3]u21{ 0x223, 0, 0 }, 0x224 => [3]u21{ 0x225, 0, 0 }, 0x226 => [3]u21{ 0x227, 0, 0 }, 0x228 => [3]u21{ 0x229, 0, 0 }, 0x22A => [3]u21{ 0x22B, 0, 0 }, 0x22C => [3]u21{ 0x22D, 0, 0 }, 0x22E => [3]u21{ 0x22F, 0, 0 }, 0x230 => [3]u21{ 0x231, 0, 0 }, 0x232 => [3]u21{ 0x233, 0, 0 }, 0x23A => [3]u21{ 0x2C65, 0, 0 }, 0x23B => [3]u21{ 0x23C, 0, 0 }, 0x23D => [3]u21{ 0x19A, 0, 0 }, 0x23E => [3]u21{ 0x2C66, 0, 0 }, 0x241 => [3]u21{ 0x242, 0, 0 }, 0x243 => [3]u21{ 0x180, 0, 0 }, 0x244 => [3]u21{ 0x289, 0, 0 }, 0x245 => [3]u21{ 0x28C, 0, 0 }, 0x246 => [3]u21{ 0x247, 0, 0 }, 0x248 => [3]u21{ 0x249, 0, 0 }, 0x24A => [3]u21{ 0x24B, 0, 0 }, 0x24C => [3]u21{ 0x24D, 0, 0 }, 0x24E => [3]u21{ 0x24F, 0, 0 }, 0x345 => [3]u21{ 0x3B9, 0, 0 }, 0x370 => [3]u21{ 0x371, 0, 0 }, 0x372 => [3]u21{ 0x373, 0, 0 }, 0x376 => [3]u21{ 0x377, 0, 0 }, 0x37F => [3]u21{ 0x3F3, 0, 0 }, 0x386 => [3]u21{ 0x3AC, 0, 0 }, 0x388 => [3]u21{ 0x3AD, 0, 0 }, 0x389 => [3]u21{ 0x3AE, 0, 0 }, 0x38A => [3]u21{ 0x3AF, 0, 0 }, 0x38C => [3]u21{ 0x3CC, 0, 0 }, 0x38E => [3]u21{ 0x3CD, 0, 0 }, 0x38F => [3]u21{ 0x3CE, 0, 0 }, 0x390 => [3]u21{ 0x3B9, 0x308, 0x301 }, 0x391 => [3]u21{ 0x3B1, 0, 0 }, 0x392 => [3]u21{ 0x3B2, 0, 0 }, 0x393 => [3]u21{ 0x3B3, 0, 0 }, 0x394 => [3]u21{ 0x3B4, 0, 0 }, 0x395 => [3]u21{ 0x3B5, 0, 0 }, 0x396 => [3]u21{ 0x3B6, 0, 0 }, 0x397 => [3]u21{ 0x3B7, 0, 0 }, 0x398 => [3]u21{ 0x3B8, 0, 0 }, 0x399 => [3]u21{ 0x3B9, 0, 0 }, 0x39A => [3]u21{ 0x3BA, 0, 0 }, 0x39B => [3]u21{ 0x3BB, 0, 0 }, 0x39C => [3]u21{ 0x3BC, 0, 0 }, 0x39D => [3]u21{ 0x3BD, 0, 0 }, 0x39E => [3]u21{ 0x3BE, 0, 0 }, 0x39F => [3]u21{ 0x3BF, 0, 0 }, 0x3A0 => [3]u21{ 0x3C0, 0, 0 }, 0x3A1 => [3]u21{ 0x3C1, 0, 0 }, 0x3A3 => [3]u21{ 0x3C3, 0, 0 }, 0x3A4 => [3]u21{ 0x3C4, 0, 0 }, 0x3A5 => [3]u21{ 0x3C5, 0, 0 }, 0x3A6 => [3]u21{ 0x3C6, 0, 0 }, 0x3A7 => [3]u21{ 0x3C7, 0, 0 }, 0x3A8 => [3]u21{ 0x3C8, 0, 0 }, 0x3A9 => [3]u21{ 0x3C9, 0, 0 }, 0x3AA => [3]u21{ 0x3CA, 0, 0 }, 0x3AB => [3]u21{ 0x3CB, 0, 0 }, 0x3B0 => [3]u21{ 0x3C5, 0x308, 0x301 }, 0x3C2 => [3]u21{ 0x3C3, 0, 0 }, 0x3CF => [3]u21{ 0x3D7, 0, 0 }, 0x3D0 => [3]u21{ 0x3B2, 0, 0 }, 0x3D1 => [3]u21{ 0x3B8, 0, 0 }, 0x3D5 => [3]u21{ 0x3C6, 0, 0 }, 0x3D6 => [3]u21{ 0x3C0, 0, 0 }, 0x3D8 => [3]u21{ 0x3D9, 0, 0 }, 0x3DA => [3]u21{ 0x3DB, 0, 0 }, 0x3DC => [3]u21{ 0x3DD, 0, 0 }, 0x3DE => [3]u21{ 0x3DF, 0, 0 }, 0x3E0 => [3]u21{ 0x3E1, 0, 0 }, 0x3E2 => [3]u21{ 0x3E3, 0, 0 }, 0x3E4 => [3]u21{ 0x3E5, 0, 0 }, 0x3E6 => [3]u21{ 0x3E7, 0, 0 }, 0x3E8 => [3]u21{ 0x3E9, 0, 0 }, 0x3EA => [3]u21{ 0x3EB, 0, 0 }, 0x3EC => [3]u21{ 0x3ED, 0, 0 }, 0x3EE => [3]u21{ 0x3EF, 0, 0 }, 0x3F0 => [3]u21{ 0x3BA, 0, 0 }, 0x3F1 => [3]u21{ 0x3C1, 0, 0 }, 0x3F4 => [3]u21{ 0x3B8, 0, 0 }, 0x3F5 => [3]u21{ 0x3B5, 0, 0 }, 0x3F7 => [3]u21{ 0x3F8, 0, 0 }, 0x3F9 => [3]u21{ 0x3F2, 0, 0 }, 0x3FA => [3]u21{ 0x3FB, 0, 0 }, 0x3FD => [3]u21{ 0x37B, 0, 0 }, 0x3FE => [3]u21{ 0x37C, 0, 0 }, 0x3FF => [3]u21{ 0x37D, 0, 0 }, 0x400 => [3]u21{ 0x450, 0, 0 }, 0x401 => [3]u21{ 0x451, 0, 0 }, 0x402 => [3]u21{ 0x452, 0, 0 }, 0x403 => [3]u21{ 0x453, 0, 0 }, 0x404 => [3]u21{ 0x454, 0, 0 }, 0x405 => [3]u21{ 0x455, 0, 0 }, 0x406 => [3]u21{ 0x456, 0, 0 }, 0x407 => [3]u21{ 0x457, 0, 0 }, 0x408 => [3]u21{ 0x458, 0, 0 }, 0x409 => [3]u21{ 0x459, 0, 0 }, 0x40A => [3]u21{ 0x45A, 0, 0 }, 0x40B => [3]u21{ 0x45B, 0, 0 }, 0x40C => [3]u21{ 0x45C, 0, 0 }, 0x40D => [3]u21{ 0x45D, 0, 0 }, 0x40E => [3]u21{ 0x45E, 0, 0 }, 0x40F => [3]u21{ 0x45F, 0, 0 }, 0x410 => [3]u21{ 0x430, 0, 0 }, 0x411 => [3]u21{ 0x431, 0, 0 }, 0x412 => [3]u21{ 0x432, 0, 0 }, 0x413 => [3]u21{ 0x433, 0, 0 }, 0x414 => [3]u21{ 0x434, 0, 0 }, 0x415 => [3]u21{ 0x435, 0, 0 }, 0x416 => [3]u21{ 0x436, 0, 0 }, 0x417 => [3]u21{ 0x437, 0, 0 }, 0x418 => [3]u21{ 0x438, 0, 0 }, 0x419 => [3]u21{ 0x439, 0, 0 }, 0x41A => [3]u21{ 0x43A, 0, 0 }, 0x41B => [3]u21{ 0x43B, 0, 0 }, 0x41C => [3]u21{ 0x43C, 0, 0 }, 0x41D => [3]u21{ 0x43D, 0, 0 }, 0x41E => [3]u21{ 0x43E, 0, 0 }, 0x41F => [3]u21{ 0x43F, 0, 0 }, 0x420 => [3]u21{ 0x440, 0, 0 }, 0x421 => [3]u21{ 0x441, 0, 0 }, 0x422 => [3]u21{ 0x442, 0, 0 }, 0x423 => [3]u21{ 0x443, 0, 0 }, 0x424 => [3]u21{ 0x444, 0, 0 }, 0x425 => [3]u21{ 0x445, 0, 0 }, 0x426 => [3]u21{ 0x446, 0, 0 }, 0x427 => [3]u21{ 0x447, 0, 0 }, 0x428 => [3]u21{ 0x448, 0, 0 }, 0x429 => [3]u21{ 0x449, 0, 0 }, 0x42A => [3]u21{ 0x44A, 0, 0 }, 0x42B => [3]u21{ 0x44B, 0, 0 }, 0x42C => [3]u21{ 0x44C, 0, 0 }, 0x42D => [3]u21{ 0x44D, 0, 0 }, 0x42E => [3]u21{ 0x44E, 0, 0 }, 0x42F => [3]u21{ 0x44F, 0, 0 }, 0x460 => [3]u21{ 0x461, 0, 0 }, 0x462 => [3]u21{ 0x463, 0, 0 }, 0x464 => [3]u21{ 0x465, 0, 0 }, 0x466 => [3]u21{ 0x467, 0, 0 }, 0x468 => [3]u21{ 0x469, 0, 0 }, 0x46A => [3]u21{ 0x46B, 0, 0 }, 0x46C => [3]u21{ 0x46D, 0, 0 }, 0x46E => [3]u21{ 0x46F, 0, 0 }, 0x470 => [3]u21{ 0x471, 0, 0 }, 0x472 => [3]u21{ 0x473, 0, 0 }, 0x474 => [3]u21{ 0x475, 0, 0 }, 0x476 => [3]u21{ 0x477, 0, 0 }, 0x478 => [3]u21{ 0x479, 0, 0 }, 0x47A => [3]u21{ 0x47B, 0, 0 }, 0x47C => [3]u21{ 0x47D, 0, 0 }, 0x47E => [3]u21{ 0x47F, 0, 0 }, 0x480 => [3]u21{ 0x481, 0, 0 }, 0x48A => [3]u21{ 0x48B, 0, 0 }, 0x48C => [3]u21{ 0x48D, 0, 0 }, 0x48E => [3]u21{ 0x48F, 0, 0 }, 0x490 => [3]u21{ 0x491, 0, 0 }, 0x492 => [3]u21{ 0x493, 0, 0 }, 0x494 => [3]u21{ 0x495, 0, 0 }, 0x496 => [3]u21{ 0x497, 0, 0 }, 0x498 => [3]u21{ 0x499, 0, 0 }, 0x49A => [3]u21{ 0x49B, 0, 0 }, 0x49C => [3]u21{ 0x49D, 0, 0 }, 0x49E => [3]u21{ 0x49F, 0, 0 }, 0x4A0 => [3]u21{ 0x4A1, 0, 0 }, 0x4A2 => [3]u21{ 0x4A3, 0, 0 }, 0x4A4 => [3]u21{ 0x4A5, 0, 0 }, 0x4A6 => [3]u21{ 0x4A7, 0, 0 }, 0x4A8 => [3]u21{ 0x4A9, 0, 0 }, 0x4AA => [3]u21{ 0x4AB, 0, 0 }, 0x4AC => [3]u21{ 0x4AD, 0, 0 }, 0x4AE => [3]u21{ 0x4AF, 0, 0 }, 0x4B0 => [3]u21{ 0x4B1, 0, 0 }, 0x4B2 => [3]u21{ 0x4B3, 0, 0 }, 0x4B4 => [3]u21{ 0x4B5, 0, 0 }, 0x4B6 => [3]u21{ 0x4B7, 0, 0 }, 0x4B8 => [3]u21{ 0x4B9, 0, 0 }, 0x4BA => [3]u21{ 0x4BB, 0, 0 }, 0x4BC => [3]u21{ 0x4BD, 0, 0 }, 0x4BE => [3]u21{ 0x4BF, 0, 0 }, 0x4C0 => [3]u21{ 0x4CF, 0, 0 }, 0x4C1 => [3]u21{ 0x4C2, 0, 0 }, 0x4C3 => [3]u21{ 0x4C4, 0, 0 }, 0x4C5 => [3]u21{ 0x4C6, 0, 0 }, 0x4C7 => [3]u21{ 0x4C8, 0, 0 }, 0x4C9 => [3]u21{ 0x4CA, 0, 0 }, 0x4CB => [3]u21{ 0x4CC, 0, 0 }, 0x4CD => [3]u21{ 0x4CE, 0, 0 }, 0x4D0 => [3]u21{ 0x4D1, 0, 0 }, 0x4D2 => [3]u21{ 0x4D3, 0, 0 }, 0x4D4 => [3]u21{ 0x4D5, 0, 0 }, 0x4D6 => [3]u21{ 0x4D7, 0, 0 }, 0x4D8 => [3]u21{ 0x4D9, 0, 0 }, 0x4DA => [3]u21{ 0x4DB, 0, 0 }, 0x4DC => [3]u21{ 0x4DD, 0, 0 }, 0x4DE => [3]u21{ 0x4DF, 0, 0 }, 0x4E0 => [3]u21{ 0x4E1, 0, 0 }, 0x4E2 => [3]u21{ 0x4E3, 0, 0 }, 0x4E4 => [3]u21{ 0x4E5, 0, 0 }, 0x4E6 => [3]u21{ 0x4E7, 0, 0 }, 0x4E8 => [3]u21{ 0x4E9, 0, 0 }, 0x4EA => [3]u21{ 0x4EB, 0, 0 }, 0x4EC => [3]u21{ 0x4ED, 0, 0 }, 0x4EE => [3]u21{ 0x4EF, 0, 0 }, 0x4F0 => [3]u21{ 0x4F1, 0, 0 }, 0x4F2 => [3]u21{ 0x4F3, 0, 0 }, 0x4F4 => [3]u21{ 0x4F5, 0, 0 }, 0x4F6 => [3]u21{ 0x4F7, 0, 0 }, 0x4F8 => [3]u21{ 0x4F9, 0, 0 }, 0x4FA => [3]u21{ 0x4FB, 0, 0 }, 0x4FC => [3]u21{ 0x4FD, 0, 0 }, 0x4FE => [3]u21{ 0x4FF, 0, 0 }, 0x500 => [3]u21{ 0x501, 0, 0 }, 0x502 => [3]u21{ 0x503, 0, 0 }, 0x504 => [3]u21{ 0x505, 0, 0 }, 0x506 => [3]u21{ 0x507, 0, 0 }, 0x508 => [3]u21{ 0x509, 0, 0 }, 0x50A => [3]u21{ 0x50B, 0, 0 }, 0x50C => [3]u21{ 0x50D, 0, 0 }, 0x50E => [3]u21{ 0x50F, 0, 0 }, 0x510 => [3]u21{ 0x511, 0, 0 }, 0x512 => [3]u21{ 0x513, 0, 0 }, 0x514 => [3]u21{ 0x515, 0, 0 }, 0x516 => [3]u21{ 0x517, 0, 0 }, 0x518 => [3]u21{ 0x519, 0, 0 }, 0x51A => [3]u21{ 0x51B, 0, 0 }, 0x51C => [3]u21{ 0x51D, 0, 0 }, 0x51E => [3]u21{ 0x51F, 0, 0 }, 0x520 => [3]u21{ 0x521, 0, 0 }, 0x522 => [3]u21{ 0x523, 0, 0 }, 0x524 => [3]u21{ 0x525, 0, 0 }, 0x526 => [3]u21{ 0x527, 0, 0 }, 0x528 => [3]u21{ 0x529, 0, 0 }, 0x52A => [3]u21{ 0x52B, 0, 0 }, 0x52C => [3]u21{ 0x52D, 0, 0 }, 0x52E => [3]u21{ 0x52F, 0, 0 }, 0x531 => [3]u21{ 0x561, 0, 0 }, 0x532 => [3]u21{ 0x562, 0, 0 }, 0x533 => [3]u21{ 0x563, 0, 0 }, 0x534 => [3]u21{ 0x564, 0, 0 }, 0x535 => [3]u21{ 0x565, 0, 0 }, 0x536 => [3]u21{ 0x566, 0, 0 }, 0x537 => [3]u21{ 0x567, 0, 0 }, 0x538 => [3]u21{ 0x568, 0, 0 }, 0x539 => [3]u21{ 0x569, 0, 0 }, 0x53A => [3]u21{ 0x56A, 0, 0 }, 0x53B => [3]u21{ 0x56B, 0, 0 }, 0x53C => [3]u21{ 0x56C, 0, 0 }, 0x53D => [3]u21{ 0x56D, 0, 0 }, 0x53E => [3]u21{ 0x56E, 0, 0 }, 0x53F => [3]u21{ 0x56F, 0, 0 }, 0x540 => [3]u21{ 0x570, 0, 0 }, 0x541 => [3]u21{ 0x571, 0, 0 }, 0x542 => [3]u21{ 0x572, 0, 0 }, 0x543 => [3]u21{ 0x573, 0, 0 }, 0x544 => [3]u21{ 0x574, 0, 0 }, 0x545 => [3]u21{ 0x575, 0, 0 }, 0x546 => [3]u21{ 0x576, 0, 0 }, 0x547 => [3]u21{ 0x577, 0, 0 }, 0x548 => [3]u21{ 0x578, 0, 0 }, 0x549 => [3]u21{ 0x579, 0, 0 }, 0x54A => [3]u21{ 0x57A, 0, 0 }, 0x54B => [3]u21{ 0x57B, 0, 0 }, 0x54C => [3]u21{ 0x57C, 0, 0 }, 0x54D => [3]u21{ 0x57D, 0, 0 }, 0x54E => [3]u21{ 0x57E, 0, 0 }, 0x54F => [3]u21{ 0x57F, 0, 0 }, 0x550 => [3]u21{ 0x580, 0, 0 }, 0x551 => [3]u21{ 0x581, 0, 0 }, 0x552 => [3]u21{ 0x582, 0, 0 }, 0x553 => [3]u21{ 0x583, 0, 0 }, 0x554 => [3]u21{ 0x584, 0, 0 }, 0x555 => [3]u21{ 0x585, 0, 0 }, 0x556 => [3]u21{ 0x586, 0, 0 }, 0x587 => [3]u21{ 0x565, 0x582, 0 }, 0x10A0 => [3]u21{ 0x2D00, 0, 0 }, 0x10A1 => [3]u21{ 0x2D01, 0, 0 }, 0x10A2 => [3]u21{ 0x2D02, 0, 0 }, 0x10A3 => [3]u21{ 0x2D03, 0, 0 }, 0x10A4 => [3]u21{ 0x2D04, 0, 0 }, 0x10A5 => [3]u21{ 0x2D05, 0, 0 }, 0x10A6 => [3]u21{ 0x2D06, 0, 0 }, 0x10A7 => [3]u21{ 0x2D07, 0, 0 }, 0x10A8 => [3]u21{ 0x2D08, 0, 0 }, 0x10A9 => [3]u21{ 0x2D09, 0, 0 }, 0x10AA => [3]u21{ 0x2D0A, 0, 0 }, 0x10AB => [3]u21{ 0x2D0B, 0, 0 }, 0x10AC => [3]u21{ 0x2D0C, 0, 0 }, 0x10AD => [3]u21{ 0x2D0D, 0, 0 }, 0x10AE => [3]u21{ 0x2D0E, 0, 0 }, 0x10AF => [3]u21{ 0x2D0F, 0, 0 }, 0x10B0 => [3]u21{ 0x2D10, 0, 0 }, 0x10B1 => [3]u21{ 0x2D11, 0, 0 }, 0x10B2 => [3]u21{ 0x2D12, 0, 0 }, 0x10B3 => [3]u21{ 0x2D13, 0, 0 }, 0x10B4 => [3]u21{ 0x2D14, 0, 0 }, 0x10B5 => [3]u21{ 0x2D15, 0, 0 }, 0x10B6 => [3]u21{ 0x2D16, 0, 0 }, 0x10B7 => [3]u21{ 0x2D17, 0, 0 }, 0x10B8 => [3]u21{ 0x2D18, 0, 0 }, 0x10B9 => [3]u21{ 0x2D19, 0, 0 }, 0x10BA => [3]u21{ 0x2D1A, 0, 0 }, 0x10BB => [3]u21{ 0x2D1B, 0, 0 }, 0x10BC => [3]u21{ 0x2D1C, 0, 0 }, 0x10BD => [3]u21{ 0x2D1D, 0, 0 }, 0x10BE => [3]u21{ 0x2D1E, 0, 0 }, 0x10BF => [3]u21{ 0x2D1F, 0, 0 }, 0x10C0 => [3]u21{ 0x2D20, 0, 0 }, 0x10C1 => [3]u21{ 0x2D21, 0, 0 }, 0x10C2 => [3]u21{ 0x2D22, 0, 0 }, 0x10C3 => [3]u21{ 0x2D23, 0, 0 }, 0x10C4 => [3]u21{ 0x2D24, 0, 0 }, 0x10C5 => [3]u21{ 0x2D25, 0, 0 }, 0x10C7 => [3]u21{ 0x2D27, 0, 0 }, 0x10CD => [3]u21{ 0x2D2D, 0, 0 }, 0x13F8 => [3]u21{ 0x13F0, 0, 0 }, 0x13F9 => [3]u21{ 0x13F1, 0, 0 }, 0x13FA => [3]u21{ 0x13F2, 0, 0 }, 0x13FB => [3]u21{ 0x13F3, 0, 0 }, 0x13FC => [3]u21{ 0x13F4, 0, 0 }, 0x13FD => [3]u21{ 0x13F5, 0, 0 }, 0x1C80 => [3]u21{ 0x432, 0, 0 }, 0x1C81 => [3]u21{ 0x434, 0, 0 }, 0x1C82 => [3]u21{ 0x43E, 0, 0 }, 0x1C83 => [3]u21{ 0x441, 0, 0 }, 0x1C84 => [3]u21{ 0x442, 0, 0 }, 0x1C85 => [3]u21{ 0x442, 0, 0 }, 0x1C86 => [3]u21{ 0x44A, 0, 0 }, 0x1C87 => [3]u21{ 0x463, 0, 0 }, 0x1C88 => [3]u21{ 0xA64B, 0, 0 }, 0x1C90 => [3]u21{ 0x10D0, 0, 0 }, 0x1C91 => [3]u21{ 0x10D1, 0, 0 }, 0x1C92 => [3]u21{ 0x10D2, 0, 0 }, 0x1C93 => [3]u21{ 0x10D3, 0, 0 }, 0x1C94 => [3]u21{ 0x10D4, 0, 0 }, 0x1C95 => [3]u21{ 0x10D5, 0, 0 }, 0x1C96 => [3]u21{ 0x10D6, 0, 0 }, 0x1C97 => [3]u21{ 0x10D7, 0, 0 }, 0x1C98 => [3]u21{ 0x10D8, 0, 0 }, 0x1C99 => [3]u21{ 0x10D9, 0, 0 }, 0x1C9A => [3]u21{ 0x10DA, 0, 0 }, 0x1C9B => [3]u21{ 0x10DB, 0, 0 }, 0x1C9C => [3]u21{ 0x10DC, 0, 0 }, 0x1C9D => [3]u21{ 0x10DD, 0, 0 }, 0x1C9E => [3]u21{ 0x10DE, 0, 0 }, 0x1C9F => [3]u21{ 0x10DF, 0, 0 }, 0x1CA0 => [3]u21{ 0x10E0, 0, 0 }, 0x1CA1 => [3]u21{ 0x10E1, 0, 0 }, 0x1CA2 => [3]u21{ 0x10E2, 0, 0 }, 0x1CA3 => [3]u21{ 0x10E3, 0, 0 }, 0x1CA4 => [3]u21{ 0x10E4, 0, 0 }, 0x1CA5 => [3]u21{ 0x10E5, 0, 0 }, 0x1CA6 => [3]u21{ 0x10E6, 0, 0 }, 0x1CA7 => [3]u21{ 0x10E7, 0, 0 }, 0x1CA8 => [3]u21{ 0x10E8, 0, 0 }, 0x1CA9 => [3]u21{ 0x10E9, 0, 0 }, 0x1CAA => [3]u21{ 0x10EA, 0, 0 }, 0x1CAB => [3]u21{ 0x10EB, 0, 0 }, 0x1CAC => [3]u21{ 0x10EC, 0, 0 }, 0x1CAD => [3]u21{ 0x10ED, 0, 0 }, 0x1CAE => [3]u21{ 0x10EE, 0, 0 }, 0x1CAF => [3]u21{ 0x10EF, 0, 0 }, 0x1CB0 => [3]u21{ 0x10F0, 0, 0 }, 0x1CB1 => [3]u21{ 0x10F1, 0, 0 }, 0x1CB2 => [3]u21{ 0x10F2, 0, 0 }, 0x1CB3 => [3]u21{ 0x10F3, 0, 0 }, 0x1CB4 => [3]u21{ 0x10F4, 0, 0 }, 0x1CB5 => [3]u21{ 0x10F5, 0, 0 }, 0x1CB6 => [3]u21{ 0x10F6, 0, 0 }, 0x1CB7 => [3]u21{ 0x10F7, 0, 0 }, 0x1CB8 => [3]u21{ 0x10F8, 0, 0 }, 0x1CB9 => [3]u21{ 0x10F9, 0, 0 }, 0x1CBA => [3]u21{ 0x10FA, 0, 0 }, 0x1CBD => [3]u21{ 0x10FD, 0, 0 }, 0x1CBE => [3]u21{ 0x10FE, 0, 0 }, 0x1CBF => [3]u21{ 0x10FF, 0, 0 }, 0x1E00 => [3]u21{ 0x1E01, 0, 0 }, 0x1E02 => [3]u21{ 0x1E03, 0, 0 }, 0x1E04 => [3]u21{ 0x1E05, 0, 0 }, 0x1E06 => [3]u21{ 0x1E07, 0, 0 }, 0x1E08 => [3]u21{ 0x1E09, 0, 0 }, 0x1E0A => [3]u21{ 0x1E0B, 0, 0 }, 0x1E0C => [3]u21{ 0x1E0D, 0, 0 }, 0x1E0E => [3]u21{ 0x1E0F, 0, 0 }, 0x1E10 => [3]u21{ 0x1E11, 0, 0 }, 0x1E12 => [3]u21{ 0x1E13, 0, 0 }, 0x1E14 => [3]u21{ 0x1E15, 0, 0 }, 0x1E16 => [3]u21{ 0x1E17, 0, 0 }, 0x1E18 => [3]u21{ 0x1E19, 0, 0 }, 0x1E1A => [3]u21{ 0x1E1B, 0, 0 }, 0x1E1C => [3]u21{ 0x1E1D, 0, 0 }, 0x1E1E => [3]u21{ 0x1E1F, 0, 0 }, 0x1E20 => [3]u21{ 0x1E21, 0, 0 }, 0x1E22 => [3]u21{ 0x1E23, 0, 0 }, 0x1E24 => [3]u21{ 0x1E25, 0, 0 }, 0x1E26 => [3]u21{ 0x1E27, 0, 0 }, 0x1E28 => [3]u21{ 0x1E29, 0, 0 }, 0x1E2A => [3]u21{ 0x1E2B, 0, 0 }, 0x1E2C => [3]u21{ 0x1E2D, 0, 0 }, 0x1E2E => [3]u21{ 0x1E2F, 0, 0 }, 0x1E30 => [3]u21{ 0x1E31, 0, 0 }, 0x1E32 => [3]u21{ 0x1E33, 0, 0 }, 0x1E34 => [3]u21{ 0x1E35, 0, 0 }, 0x1E36 => [3]u21{ 0x1E37, 0, 0 }, 0x1E38 => [3]u21{ 0x1E39, 0, 0 }, 0x1E3A => [3]u21{ 0x1E3B, 0, 0 }, 0x1E3C => [3]u21{ 0x1E3D, 0, 0 }, 0x1E3E => [3]u21{ 0x1E3F, 0, 0 }, 0x1E40 => [3]u21{ 0x1E41, 0, 0 }, 0x1E42 => [3]u21{ 0x1E43, 0, 0 }, 0x1E44 => [3]u21{ 0x1E45, 0, 0 }, 0x1E46 => [3]u21{ 0x1E47, 0, 0 }, 0x1E48 => [3]u21{ 0x1E49, 0, 0 }, 0x1E4A => [3]u21{ 0x1E4B, 0, 0 }, 0x1E4C => [3]u21{ 0x1E4D, 0, 0 }, 0x1E4E => [3]u21{ 0x1E4F, 0, 0 }, 0x1E50 => [3]u21{ 0x1E51, 0, 0 }, 0x1E52 => [3]u21{ 0x1E53, 0, 0 }, 0x1E54 => [3]u21{ 0x1E55, 0, 0 }, 0x1E56 => [3]u21{ 0x1E57, 0, 0 }, 0x1E58 => [3]u21{ 0x1E59, 0, 0 }, 0x1E5A => [3]u21{ 0x1E5B, 0, 0 }, 0x1E5C => [3]u21{ 0x1E5D, 0, 0 }, 0x1E5E => [3]u21{ 0x1E5F, 0, 0 }, 0x1E60 => [3]u21{ 0x1E61, 0, 0 }, 0x1E62 => [3]u21{ 0x1E63, 0, 0 }, 0x1E64 => [3]u21{ 0x1E65, 0, 0 }, 0x1E66 => [3]u21{ 0x1E67, 0, 0 }, 0x1E68 => [3]u21{ 0x1E69, 0, 0 }, 0x1E6A => [3]u21{ 0x1E6B, 0, 0 }, 0x1E6C => [3]u21{ 0x1E6D, 0, 0 }, 0x1E6E => [3]u21{ 0x1E6F, 0, 0 }, 0x1E70 => [3]u21{ 0x1E71, 0, 0 }, 0x1E72 => [3]u21{ 0x1E73, 0, 0 }, 0x1E74 => [3]u21{ 0x1E75, 0, 0 }, 0x1E76 => [3]u21{ 0x1E77, 0, 0 }, 0x1E78 => [3]u21{ 0x1E79, 0, 0 }, 0x1E7A => [3]u21{ 0x1E7B, 0, 0 }, 0x1E7C => [3]u21{ 0x1E7D, 0, 0 }, 0x1E7E => [3]u21{ 0x1E7F, 0, 0 }, 0x1E80 => [3]u21{ 0x1E81, 0, 0 }, 0x1E82 => [3]u21{ 0x1E83, 0, 0 }, 0x1E84 => [3]u21{ 0x1E85, 0, 0 }, 0x1E86 => [3]u21{ 0x1E87, 0, 0 }, 0x1E88 => [3]u21{ 0x1E89, 0, 0 }, 0x1E8A => [3]u21{ 0x1E8B, 0, 0 }, 0x1E8C => [3]u21{ 0x1E8D, 0, 0 }, 0x1E8E => [3]u21{ 0x1E8F, 0, 0 }, 0x1E90 => [3]u21{ 0x1E91, 0, 0 }, 0x1E92 => [3]u21{ 0x1E93, 0, 0 }, 0x1E94 => [3]u21{ 0x1E95, 0, 0 }, 0x1E96 => [3]u21{ 0x68, 0x331, 0 }, 0x1E97 => [3]u21{ 0x74, 0x308, 0 }, 0x1E98 => [3]u21{ 0x77, 0x30A, 0 }, 0x1E99 => [3]u21{ 0x79, 0x30A, 0 }, 0x1E9A => [3]u21{ 0x61, 0x2BE, 0 }, 0x1E9B => [3]u21{ 0x1E61, 0, 0 }, 0x1E9E => [3]u21{ 0x73, 0x73, 0 }, 0x1EA0 => [3]u21{ 0x1EA1, 0, 0 }, 0x1EA2 => [3]u21{ 0x1EA3, 0, 0 }, 0x1EA4 => [3]u21{ 0x1EA5, 0, 0 }, 0x1EA6 => [3]u21{ 0x1EA7, 0, 0 }, 0x1EA8 => [3]u21{ 0x1EA9, 0, 0 }, 0x1EAA => [3]u21{ 0x1EAB, 0, 0 }, 0x1EAC => [3]u21{ 0x1EAD, 0, 0 }, 0x1EAE => [3]u21{ 0x1EAF, 0, 0 }, 0x1EB0 => [3]u21{ 0x1EB1, 0, 0 }, 0x1EB2 => [3]u21{ 0x1EB3, 0, 0 }, 0x1EB4 => [3]u21{ 0x1EB5, 0, 0 }, 0x1EB6 => [3]u21{ 0x1EB7, 0, 0 }, 0x1EB8 => [3]u21{ 0x1EB9, 0, 0 }, 0x1EBA => [3]u21{ 0x1EBB, 0, 0 }, 0x1EBC => [3]u21{ 0x1EBD, 0, 0 }, 0x1EBE => [3]u21{ 0x1EBF, 0, 0 }, 0x1EC0 => [3]u21{ 0x1EC1, 0, 0 }, 0x1EC2 => [3]u21{ 0x1EC3, 0, 0 }, 0x1EC4 => [3]u21{ 0x1EC5, 0, 0 }, 0x1EC6 => [3]u21{ 0x1EC7, 0, 0 }, 0x1EC8 => [3]u21{ 0x1EC9, 0, 0 }, 0x1ECA => [3]u21{ 0x1ECB, 0, 0 }, 0x1ECC => [3]u21{ 0x1ECD, 0, 0 }, 0x1ECE => [3]u21{ 0x1ECF, 0, 0 }, 0x1ED0 => [3]u21{ 0x1ED1, 0, 0 }, 0x1ED2 => [3]u21{ 0x1ED3, 0, 0 }, 0x1ED4 => [3]u21{ 0x1ED5, 0, 0 }, 0x1ED6 => [3]u21{ 0x1ED7, 0, 0 }, 0x1ED8 => [3]u21{ 0x1ED9, 0, 0 }, 0x1EDA => [3]u21{ 0x1EDB, 0, 0 }, 0x1EDC => [3]u21{ 0x1EDD, 0, 0 }, 0x1EDE => [3]u21{ 0x1EDF, 0, 0 }, 0x1EE0 => [3]u21{ 0x1EE1, 0, 0 }, 0x1EE2 => [3]u21{ 0x1EE3, 0, 0 }, 0x1EE4 => [3]u21{ 0x1EE5, 0, 0 }, 0x1EE6 => [3]u21{ 0x1EE7, 0, 0 }, 0x1EE8 => [3]u21{ 0x1EE9, 0, 0 }, 0x1EEA => [3]u21{ 0x1EEB, 0, 0 }, 0x1EEC => [3]u21{ 0x1EED, 0, 0 }, 0x1EEE => [3]u21{ 0x1EEF, 0, 0 }, 0x1EF0 => [3]u21{ 0x1EF1, 0, 0 }, 0x1EF2 => [3]u21{ 0x1EF3, 0, 0 }, 0x1EF4 => [3]u21{ 0x1EF5, 0, 0 }, 0x1EF6 => [3]u21{ 0x1EF7, 0, 0 }, 0x1EF8 => [3]u21{ 0x1EF9, 0, 0 }, 0x1EFA => [3]u21{ 0x1EFB, 0, 0 }, 0x1EFC => [3]u21{ 0x1EFD, 0, 0 }, 0x1EFE => [3]u21{ 0x1EFF, 0, 0 }, 0x1F08 => [3]u21{ 0x1F00, 0, 0 }, 0x1F09 => [3]u21{ 0x1F01, 0, 0 }, 0x1F0A => [3]u21{ 0x1F02, 0, 0 }, 0x1F0B => [3]u21{ 0x1F03, 0, 0 }, 0x1F0C => [3]u21{ 0x1F04, 0, 0 }, 0x1F0D => [3]u21{ 0x1F05, 0, 0 }, 0x1F0E => [3]u21{ 0x1F06, 0, 0 }, 0x1F0F => [3]u21{ 0x1F07, 0, 0 }, 0x1F18 => [3]u21{ 0x1F10, 0, 0 }, 0x1F19 => [3]u21{ 0x1F11, 0, 0 }, 0x1F1A => [3]u21{ 0x1F12, 0, 0 }, 0x1F1B => [3]u21{ 0x1F13, 0, 0 }, 0x1F1C => [3]u21{ 0x1F14, 0, 0 }, 0x1F1D => [3]u21{ 0x1F15, 0, 0 }, 0x1F28 => [3]u21{ 0x1F20, 0, 0 }, 0x1F29 => [3]u21{ 0x1F21, 0, 0 }, 0x1F2A => [3]u21{ 0x1F22, 0, 0 }, 0x1F2B => [3]u21{ 0x1F23, 0, 0 }, 0x1F2C => [3]u21{ 0x1F24, 0, 0 }, 0x1F2D => [3]u21{ 0x1F25, 0, 0 }, 0x1F2E => [3]u21{ 0x1F26, 0, 0 }, 0x1F2F => [3]u21{ 0x1F27, 0, 0 }, 0x1F38 => [3]u21{ 0x1F30, 0, 0 }, 0x1F39 => [3]u21{ 0x1F31, 0, 0 }, 0x1F3A => [3]u21{ 0x1F32, 0, 0 }, 0x1F3B => [3]u21{ 0x1F33, 0, 0 }, 0x1F3C => [3]u21{ 0x1F34, 0, 0 }, 0x1F3D => [3]u21{ 0x1F35, 0, 0 }, 0x1F3E => [3]u21{ 0x1F36, 0, 0 }, 0x1F3F => [3]u21{ 0x1F37, 0, 0 }, 0x1F48 => [3]u21{ 0x1F40, 0, 0 }, 0x1F49 => [3]u21{ 0x1F41, 0, 0 }, 0x1F4A => [3]u21{ 0x1F42, 0, 0 }, 0x1F4B => [3]u21{ 0x1F43, 0, 0 }, 0x1F4C => [3]u21{ 0x1F44, 0, 0 }, 0x1F4D => [3]u21{ 0x1F45, 0, 0 }, 0x1F50 => [3]u21{ 0x3C5, 0x313, 0 }, 0x1F52 => [3]u21{ 0x3C5, 0x313, 0x300 }, 0x1F54 => [3]u21{ 0x3C5, 0x313, 0x301 }, 0x1F56 => [3]u21{ 0x3C5, 0x313, 0x342 }, 0x1F59 => [3]u21{ 0x1F51, 0, 0 }, 0x1F5B => [3]u21{ 0x1F53, 0, 0 }, 0x1F5D => [3]u21{ 0x1F55, 0, 0 }, 0x1F5F => [3]u21{ 0x1F57, 0, 0 }, 0x1F68 => [3]u21{ 0x1F60, 0, 0 }, 0x1F69 => [3]u21{ 0x1F61, 0, 0 }, 0x1F6A => [3]u21{ 0x1F62, 0, 0 }, 0x1F6B => [3]u21{ 0x1F63, 0, 0 }, 0x1F6C => [3]u21{ 0x1F64, 0, 0 }, 0x1F6D => [3]u21{ 0x1F65, 0, 0 }, 0x1F6E => [3]u21{ 0x1F66, 0, 0 }, 0x1F6F => [3]u21{ 0x1F67, 0, 0 }, 0x1F80 => [3]u21{ 0x1F00, 0x3B9, 0 }, 0x1F81 => [3]u21{ 0x1F01, 0x3B9, 0 }, 0x1F82 => [3]u21{ 0x1F02, 0x3B9, 0 }, 0x1F83 => [3]u21{ 0x1F03, 0x3B9, 0 }, 0x1F84 => [3]u21{ 0x1F04, 0x3B9, 0 }, 0x1F85 => [3]u21{ 0x1F05, 0x3B9, 0 }, 0x1F86 => [3]u21{ 0x1F06, 0x3B9, 0 }, 0x1F87 => [3]u21{ 0x1F07, 0x3B9, 0 }, 0x1F88 => [3]u21{ 0x1F00, 0x3B9, 0 }, 0x1F89 => [3]u21{ 0x1F01, 0x3B9, 0 }, 0x1F8A => [3]u21{ 0x1F02, 0x3B9, 0 }, 0x1F8B => [3]u21{ 0x1F03, 0x3B9, 0 }, 0x1F8C => [3]u21{ 0x1F04, 0x3B9, 0 }, 0x1F8D => [3]u21{ 0x1F05, 0x3B9, 0 }, 0x1F8E => [3]u21{ 0x1F06, 0x3B9, 0 }, 0x1F8F => [3]u21{ 0x1F07, 0x3B9, 0 }, 0x1F90 => [3]u21{ 0x1F20, 0x3B9, 0 }, 0x1F91 => [3]u21{ 0x1F21, 0x3B9, 0 }, 0x1F92 => [3]u21{ 0x1F22, 0x3B9, 0 }, 0x1F93 => [3]u21{ 0x1F23, 0x3B9, 0 }, 0x1F94 => [3]u21{ 0x1F24, 0x3B9, 0 }, 0x1F95 => [3]u21{ 0x1F25, 0x3B9, 0 }, 0x1F96 => [3]u21{ 0x1F26, 0x3B9, 0 }, 0x1F97 => [3]u21{ 0x1F27, 0x3B9, 0 }, 0x1F98 => [3]u21{ 0x1F20, 0x3B9, 0 }, 0x1F99 => [3]u21{ 0x1F21, 0x3B9, 0 }, 0x1F9A => [3]u21{ 0x1F22, 0x3B9, 0 }, 0x1F9B => [3]u21{ 0x1F23, 0x3B9, 0 }, 0x1F9C => [3]u21{ 0x1F24, 0x3B9, 0 }, 0x1F9D => [3]u21{ 0x1F25, 0x3B9, 0 }, 0x1F9E => [3]u21{ 0x1F26, 0x3B9, 0 }, 0x1F9F => [3]u21{ 0x1F27, 0x3B9, 0 }, 0x1FA0 => [3]u21{ 0x1F60, 0x3B9, 0 }, 0x1FA1 => [3]u21{ 0x1F61, 0x3B9, 0 }, 0x1FA2 => [3]u21{ 0x1F62, 0x3B9, 0 }, 0x1FA3 => [3]u21{ 0x1F63, 0x3B9, 0 }, 0x1FA4 => [3]u21{ 0x1F64, 0x3B9, 0 }, 0x1FA5 => [3]u21{ 0x1F65, 0x3B9, 0 }, 0x1FA6 => [3]u21{ 0x1F66, 0x3B9, 0 }, 0x1FA7 => [3]u21{ 0x1F67, 0x3B9, 0 }, 0x1FA8 => [3]u21{ 0x1F60, 0x3B9, 0 }, 0x1FA9 => [3]u21{ 0x1F61, 0x3B9, 0 }, 0x1FAA => [3]u21{ 0x1F62, 0x3B9, 0 }, 0x1FAB => [3]u21{ 0x1F63, 0x3B9, 0 }, 0x1FAC => [3]u21{ 0x1F64, 0x3B9, 0 }, 0x1FAD => [3]u21{ 0x1F65, 0x3B9, 0 }, 0x1FAE => [3]u21{ 0x1F66, 0x3B9, 0 }, 0x1FAF => [3]u21{ 0x1F67, 0x3B9, 0 }, 0x1FB2 => [3]u21{ 0x1F70, 0x3B9, 0 }, 0x1FB3 => [3]u21{ 0x3B1, 0x3B9, 0 }, 0x1FB4 => [3]u21{ 0x3AC, 0x3B9, 0 }, 0x1FB6 => [3]u21{ 0x3B1, 0x342, 0 }, 0x1FB7 => [3]u21{ 0x3B1, 0x342, 0x3B9 }, 0x1FB8 => [3]u21{ 0x1FB0, 0, 0 }, 0x1FB9 => [3]u21{ 0x1FB1, 0, 0 }, 0x1FBA => [3]u21{ 0x1F70, 0, 0 }, 0x1FBB => [3]u21{ 0x1F71, 0, 0 }, 0x1FBC => [3]u21{ 0x3B1, 0x3B9, 0 }, 0x1FBE => [3]u21{ 0x3B9, 0, 0 }, 0x1FC2 => [3]u21{ 0x1F74, 0x3B9, 0 }, 0x1FC3 => [3]u21{ 0x3B7, 0x3B9, 0 }, 0x1FC4 => [3]u21{ 0x3AE, 0x3B9, 0 }, 0x1FC6 => [3]u21{ 0x3B7, 0x342, 0 }, 0x1FC7 => [3]u21{ 0x3B7, 0x342, 0x3B9 }, 0x1FC8 => [3]u21{ 0x1F72, 0, 0 }, 0x1FC9 => [3]u21{ 0x1F73, 0, 0 }, 0x1FCA => [3]u21{ 0x1F74, 0, 0 }, 0x1FCB => [3]u21{ 0x1F75, 0, 0 }, 0x1FCC => [3]u21{ 0x3B7, 0x3B9, 0 }, 0x1FD2 => [3]u21{ 0x3B9, 0x308, 0x300 }, 0x1FD3 => [3]u21{ 0x3B9, 0x308, 0x301 }, 0x1FD6 => [3]u21{ 0x3B9, 0x342, 0 }, 0x1FD7 => [3]u21{ 0x3B9, 0x308, 0x342 }, 0x1FD8 => [3]u21{ 0x1FD0, 0, 0 }, 0x1FD9 => [3]u21{ 0x1FD1, 0, 0 }, 0x1FDA => [3]u21{ 0x1F76, 0, 0 }, 0x1FDB => [3]u21{ 0x1F77, 0, 0 }, 0x1FE2 => [3]u21{ 0x3C5, 0x308, 0x300 }, 0x1FE3 => [3]u21{ 0x3C5, 0x308, 0x301 }, 0x1FE4 => [3]u21{ 0x3C1, 0x313, 0 }, 0x1FE6 => [3]u21{ 0x3C5, 0x342, 0 }, 0x1FE7 => [3]u21{ 0x3C5, 0x308, 0x342 }, 0x1FE8 => [3]u21{ 0x1FE0, 0, 0 }, 0x1FE9 => [3]u21{ 0x1FE1, 0, 0 }, 0x1FEA => [3]u21{ 0x1F7A, 0, 0 }, 0x1FEB => [3]u21{ 0x1F7B, 0, 0 }, 0x1FEC => [3]u21{ 0x1FE5, 0, 0 }, 0x1FF2 => [3]u21{ 0x1F7C, 0x3B9, 0 }, 0x1FF3 => [3]u21{ 0x3C9, 0x3B9, 0 }, 0x1FF4 => [3]u21{ 0x3CE, 0x3B9, 0 }, 0x1FF6 => [3]u21{ 0x3C9, 0x342, 0 }, 0x1FF7 => [3]u21{ 0x3C9, 0x342, 0x3B9 }, 0x1FF8 => [3]u21{ 0x1F78, 0, 0 }, 0x1FF9 => [3]u21{ 0x1F79, 0, 0 }, 0x1FFA => [3]u21{ 0x1F7C, 0, 0 }, 0x1FFB => [3]u21{ 0x1F7D, 0, 0 }, 0x1FFC => [3]u21{ 0x3C9, 0x3B9, 0 }, 0x2126 => [3]u21{ 0x3C9, 0, 0 }, 0x212A => [3]u21{ 0x6B, 0, 0 }, 0x212B => [3]u21{ 0xE5, 0, 0 }, 0x2132 => [3]u21{ 0x214E, 0, 0 }, 0x2160 => [3]u21{ 0x2170, 0, 0 }, 0x2161 => [3]u21{ 0x2171, 0, 0 }, 0x2162 => [3]u21{ 0x2172, 0, 0 }, 0x2163 => [3]u21{ 0x2173, 0, 0 }, 0x2164 => [3]u21{ 0x2174, 0, 0 }, 0x2165 => [3]u21{ 0x2175, 0, 0 }, 0x2166 => [3]u21{ 0x2176, 0, 0 }, 0x2167 => [3]u21{ 0x2177, 0, 0 }, 0x2168 => [3]u21{ 0x2178, 0, 0 }, 0x2169 => [3]u21{ 0x2179, 0, 0 }, 0x216A => [3]u21{ 0x217A, 0, 0 }, 0x216B => [3]u21{ 0x217B, 0, 0 }, 0x216C => [3]u21{ 0x217C, 0, 0 }, 0x216D => [3]u21{ 0x217D, 0, 0 }, 0x216E => [3]u21{ 0x217E, 0, 0 }, 0x216F => [3]u21{ 0x217F, 0, 0 }, 0x2183 => [3]u21{ 0x2184, 0, 0 }, 0x24B6 => [3]u21{ 0x24D0, 0, 0 }, 0x24B7 => [3]u21{ 0x24D1, 0, 0 }, 0x24B8 => [3]u21{ 0x24D2, 0, 0 }, 0x24B9 => [3]u21{ 0x24D3, 0, 0 }, 0x24BA => [3]u21{ 0x24D4, 0, 0 }, 0x24BB => [3]u21{ 0x24D5, 0, 0 }, 0x24BC => [3]u21{ 0x24D6, 0, 0 }, 0x24BD => [3]u21{ 0x24D7, 0, 0 }, 0x24BE => [3]u21{ 0x24D8, 0, 0 }, 0x24BF => [3]u21{ 0x24D9, 0, 0 }, 0x24C0 => [3]u21{ 0x24DA, 0, 0 }, 0x24C1 => [3]u21{ 0x24DB, 0, 0 }, 0x24C2 => [3]u21{ 0x24DC, 0, 0 }, 0x24C3 => [3]u21{ 0x24DD, 0, 0 }, 0x24C4 => [3]u21{ 0x24DE, 0, 0 }, 0x24C5 => [3]u21{ 0x24DF, 0, 0 }, 0x24C6 => [3]u21{ 0x24E0, 0, 0 }, 0x24C7 => [3]u21{ 0x24E1, 0, 0 }, 0x24C8 => [3]u21{ 0x24E2, 0, 0 }, 0x24C9 => [3]u21{ 0x24E3, 0, 0 }, 0x24CA => [3]u21{ 0x24E4, 0, 0 }, 0x24CB => [3]u21{ 0x24E5, 0, 0 }, 0x24CC => [3]u21{ 0x24E6, 0, 0 }, 0x24CD => [3]u21{ 0x24E7, 0, 0 }, 0x24CE => [3]u21{ 0x24E8, 0, 0 }, 0x24CF => [3]u21{ 0x24E9, 0, 0 }, 0x2C00 => [3]u21{ 0x2C30, 0, 0 }, 0x2C01 => [3]u21{ 0x2C31, 0, 0 }, 0x2C02 => [3]u21{ 0x2C32, 0, 0 }, 0x2C03 => [3]u21{ 0x2C33, 0, 0 }, 0x2C04 => [3]u21{ 0x2C34, 0, 0 }, 0x2C05 => [3]u21{ 0x2C35, 0, 0 }, 0x2C06 => [3]u21{ 0x2C36, 0, 0 }, 0x2C07 => [3]u21{ 0x2C37, 0, 0 }, 0x2C08 => [3]u21{ 0x2C38, 0, 0 }, 0x2C09 => [3]u21{ 0x2C39, 0, 0 }, 0x2C0A => [3]u21{ 0x2C3A, 0, 0 }, 0x2C0B => [3]u21{ 0x2C3B, 0, 0 }, 0x2C0C => [3]u21{ 0x2C3C, 0, 0 }, 0x2C0D => [3]u21{ 0x2C3D, 0, 0 }, 0x2C0E => [3]u21{ 0x2C3E, 0, 0 }, 0x2C0F => [3]u21{ 0x2C3F, 0, 0 }, 0x2C10 => [3]u21{ 0x2C40, 0, 0 }, 0x2C11 => [3]u21{ 0x2C41, 0, 0 }, 0x2C12 => [3]u21{ 0x2C42, 0, 0 }, 0x2C13 => [3]u21{ 0x2C43, 0, 0 }, 0x2C14 => [3]u21{ 0x2C44, 0, 0 }, 0x2C15 => [3]u21{ 0x2C45, 0, 0 }, 0x2C16 => [3]u21{ 0x2C46, 0, 0 }, 0x2C17 => [3]u21{ 0x2C47, 0, 0 }, 0x2C18 => [3]u21{ 0x2C48, 0, 0 }, 0x2C19 => [3]u21{ 0x2C49, 0, 0 }, 0x2C1A => [3]u21{ 0x2C4A, 0, 0 }, 0x2C1B => [3]u21{ 0x2C4B, 0, 0 }, 0x2C1C => [3]u21{ 0x2C4C, 0, 0 }, 0x2C1D => [3]u21{ 0x2C4D, 0, 0 }, 0x2C1E => [3]u21{ 0x2C4E, 0, 0 }, 0x2C1F => [3]u21{ 0x2C4F, 0, 0 }, 0x2C20 => [3]u21{ 0x2C50, 0, 0 }, 0x2C21 => [3]u21{ 0x2C51, 0, 0 }, 0x2C22 => [3]u21{ 0x2C52, 0, 0 }, 0x2C23 => [3]u21{ 0x2C53, 0, 0 }, 0x2C24 => [3]u21{ 0x2C54, 0, 0 }, 0x2C25 => [3]u21{ 0x2C55, 0, 0 }, 0x2C26 => [3]u21{ 0x2C56, 0, 0 }, 0x2C27 => [3]u21{ 0x2C57, 0, 0 }, 0x2C28 => [3]u21{ 0x2C58, 0, 0 }, 0x2C29 => [3]u21{ 0x2C59, 0, 0 }, 0x2C2A => [3]u21{ 0x2C5A, 0, 0 }, 0x2C2B => [3]u21{ 0x2C5B, 0, 0 }, 0x2C2C => [3]u21{ 0x2C5C, 0, 0 }, 0x2C2D => [3]u21{ 0x2C5D, 0, 0 }, 0x2C2E => [3]u21{ 0x2C5E, 0, 0 }, 0x2C2F => [3]u21{ 0x2C5F, 0, 0 }, 0x2C60 => [3]u21{ 0x2C61, 0, 0 }, 0x2C62 => [3]u21{ 0x26B, 0, 0 }, 0x2C63 => [3]u21{ 0x1D7D, 0, 0 }, 0x2C64 => [3]u21{ 0x27D, 0, 0 }, 0x2C67 => [3]u21{ 0x2C68, 0, 0 }, 0x2C69 => [3]u21{ 0x2C6A, 0, 0 }, 0x2C6B => [3]u21{ 0x2C6C, 0, 0 }, 0x2C6D => [3]u21{ 0x251, 0, 0 }, 0x2C6E => [3]u21{ 0x271, 0, 0 }, 0x2C6F => [3]u21{ 0x250, 0, 0 }, 0x2C70 => [3]u21{ 0x252, 0, 0 }, 0x2C72 => [3]u21{ 0x2C73, 0, 0 }, 0x2C75 => [3]u21{ 0x2C76, 0, 0 }, 0x2C7E => [3]u21{ 0x23F, 0, 0 }, 0x2C7F => [3]u21{ 0x240, 0, 0 }, 0x2C80 => [3]u21{ 0x2C81, 0, 0 }, 0x2C82 => [3]u21{ 0x2C83, 0, 0 }, 0x2C84 => [3]u21{ 0x2C85, 0, 0 }, 0x2C86 => [3]u21{ 0x2C87, 0, 0 }, 0x2C88 => [3]u21{ 0x2C89, 0, 0 }, 0x2C8A => [3]u21{ 0x2C8B, 0, 0 }, 0x2C8C => [3]u21{ 0x2C8D, 0, 0 }, 0x2C8E => [3]u21{ 0x2C8F, 0, 0 }, 0x2C90 => [3]u21{ 0x2C91, 0, 0 }, 0x2C92 => [3]u21{ 0x2C93, 0, 0 }, 0x2C94 => [3]u21{ 0x2C95, 0, 0 }, 0x2C96 => [3]u21{ 0x2C97, 0, 0 }, 0x2C98 => [3]u21{ 0x2C99, 0, 0 }, 0x2C9A => [3]u21{ 0x2C9B, 0, 0 }, 0x2C9C => [3]u21{ 0x2C9D, 0, 0 }, 0x2C9E => [3]u21{ 0x2C9F, 0, 0 }, 0x2CA0 => [3]u21{ 0x2CA1, 0, 0 }, 0x2CA2 => [3]u21{ 0x2CA3, 0, 0 }, 0x2CA4 => [3]u21{ 0x2CA5, 0, 0 }, 0x2CA6 => [3]u21{ 0x2CA7, 0, 0 }, 0x2CA8 => [3]u21{ 0x2CA9, 0, 0 }, 0x2CAA => [3]u21{ 0x2CAB, 0, 0 }, 0x2CAC => [3]u21{ 0x2CAD, 0, 0 }, 0x2CAE => [3]u21{ 0x2CAF, 0, 0 }, 0x2CB0 => [3]u21{ 0x2CB1, 0, 0 }, 0x2CB2 => [3]u21{ 0x2CB3, 0, 0 }, 0x2CB4 => [3]u21{ 0x2CB5, 0, 0 }, 0x2CB6 => [3]u21{ 0x2CB7, 0, 0 }, 0x2CB8 => [3]u21{ 0x2CB9, 0, 0 }, 0x2CBA => [3]u21{ 0x2CBB, 0, 0 }, 0x2CBC => [3]u21{ 0x2CBD, 0, 0 }, 0x2CBE => [3]u21{ 0x2CBF, 0, 0 }, 0x2CC0 => [3]u21{ 0x2CC1, 0, 0 }, 0x2CC2 => [3]u21{ 0x2CC3, 0, 0 }, 0x2CC4 => [3]u21{ 0x2CC5, 0, 0 }, 0x2CC6 => [3]u21{ 0x2CC7, 0, 0 }, 0x2CC8 => [3]u21{ 0x2CC9, 0, 0 }, 0x2CCA => [3]u21{ 0x2CCB, 0, 0 }, 0x2CCC => [3]u21{ 0x2CCD, 0, 0 }, 0x2CCE => [3]u21{ 0x2CCF, 0, 0 }, 0x2CD0 => [3]u21{ 0x2CD1, 0, 0 }, 0x2CD2 => [3]u21{ 0x2CD3, 0, 0 }, 0x2CD4 => [3]u21{ 0x2CD5, 0, 0 }, 0x2CD6 => [3]u21{ 0x2CD7, 0, 0 }, 0x2CD8 => [3]u21{ 0x2CD9, 0, 0 }, 0x2CDA => [3]u21{ 0x2CDB, 0, 0 }, 0x2CDC => [3]u21{ 0x2CDD, 0, 0 }, 0x2CDE => [3]u21{ 0x2CDF, 0, 0 }, 0x2CE0 => [3]u21{ 0x2CE1, 0, 0 }, 0x2CE2 => [3]u21{ 0x2CE3, 0, 0 }, 0x2CEB => [3]u21{ 0x2CEC, 0, 0 }, 0x2CED => [3]u21{ 0x2CEE, 0, 0 }, 0x2CF2 => [3]u21{ 0x2CF3, 0, 0 }, 0xA640 => [3]u21{ 0xA641, 0, 0 }, 0xA642 => [3]u21{ 0xA643, 0, 0 }, 0xA644 => [3]u21{ 0xA645, 0, 0 }, 0xA646 => [3]u21{ 0xA647, 0, 0 }, 0xA648 => [3]u21{ 0xA649, 0, 0 }, 0xA64A => [3]u21{ 0xA64B, 0, 0 }, 0xA64C => [3]u21{ 0xA64D, 0, 0 }, 0xA64E => [3]u21{ 0xA64F, 0, 0 }, 0xA650 => [3]u21{ 0xA651, 0, 0 }, 0xA652 => [3]u21{ 0xA653, 0, 0 }, 0xA654 => [3]u21{ 0xA655, 0, 0 }, 0xA656 => [3]u21{ 0xA657, 0, 0 }, 0xA658 => [3]u21{ 0xA659, 0, 0 }, 0xA65A => [3]u21{ 0xA65B, 0, 0 }, 0xA65C => [3]u21{ 0xA65D, 0, 0 }, 0xA65E => [3]u21{ 0xA65F, 0, 0 }, 0xA660 => [3]u21{ 0xA661, 0, 0 }, 0xA662 => [3]u21{ 0xA663, 0, 0 }, 0xA664 => [3]u21{ 0xA665, 0, 0 }, 0xA666 => [3]u21{ 0xA667, 0, 0 }, 0xA668 => [3]u21{ 0xA669, 0, 0 }, 0xA66A => [3]u21{ 0xA66B, 0, 0 }, 0xA66C => [3]u21{ 0xA66D, 0, 0 }, 0xA680 => [3]u21{ 0xA681, 0, 0 }, 0xA682 => [3]u21{ 0xA683, 0, 0 }, 0xA684 => [3]u21{ 0xA685, 0, 0 }, 0xA686 => [3]u21{ 0xA687, 0, 0 }, 0xA688 => [3]u21{ 0xA689, 0, 0 }, 0xA68A => [3]u21{ 0xA68B, 0, 0 }, 0xA68C => [3]u21{ 0xA68D, 0, 0 }, 0xA68E => [3]u21{ 0xA68F, 0, 0 }, 0xA690 => [3]u21{ 0xA691, 0, 0 }, 0xA692 => [3]u21{ 0xA693, 0, 0 }, 0xA694 => [3]u21{ 0xA695, 0, 0 }, 0xA696 => [3]u21{ 0xA697, 0, 0 }, 0xA698 => [3]u21{ 0xA699, 0, 0 }, 0xA69A => [3]u21{ 0xA69B, 0, 0 }, 0xA722 => [3]u21{ 0xA723, 0, 0 }, 0xA724 => [3]u21{ 0xA725, 0, 0 }, 0xA726 => [3]u21{ 0xA727, 0, 0 }, 0xA728 => [3]u21{ 0xA729, 0, 0 }, 0xA72A => [3]u21{ 0xA72B, 0, 0 }, 0xA72C => [3]u21{ 0xA72D, 0, 0 }, 0xA72E => [3]u21{ 0xA72F, 0, 0 }, 0xA732 => [3]u21{ 0xA733, 0, 0 }, 0xA734 => [3]u21{ 0xA735, 0, 0 }, 0xA736 => [3]u21{ 0xA737, 0, 0 }, 0xA738 => [3]u21{ 0xA739, 0, 0 }, 0xA73A => [3]u21{ 0xA73B, 0, 0 }, 0xA73C => [3]u21{ 0xA73D, 0, 0 }, 0xA73E => [3]u21{ 0xA73F, 0, 0 }, 0xA740 => [3]u21{ 0xA741, 0, 0 }, 0xA742 => [3]u21{ 0xA743, 0, 0 }, 0xA744 => [3]u21{ 0xA745, 0, 0 }, 0xA746 => [3]u21{ 0xA747, 0, 0 }, 0xA748 => [3]u21{ 0xA749, 0, 0 }, 0xA74A => [3]u21{ 0xA74B, 0, 0 }, 0xA74C => [3]u21{ 0xA74D, 0, 0 }, 0xA74E => [3]u21{ 0xA74F, 0, 0 }, 0xA750 => [3]u21{ 0xA751, 0, 0 }, 0xA752 => [3]u21{ 0xA753, 0, 0 }, 0xA754 => [3]u21{ 0xA755, 0, 0 }, 0xA756 => [3]u21{ 0xA757, 0, 0 }, 0xA758 => [3]u21{ 0xA759, 0, 0 }, 0xA75A => [3]u21{ 0xA75B, 0, 0 }, 0xA75C => [3]u21{ 0xA75D, 0, 0 }, 0xA75E => [3]u21{ 0xA75F, 0, 0 }, 0xA760 => [3]u21{ 0xA761, 0, 0 }, 0xA762 => [3]u21{ 0xA763, 0, 0 }, 0xA764 => [3]u21{ 0xA765, 0, 0 }, 0xA766 => [3]u21{ 0xA767, 0, 0 }, 0xA768 => [3]u21{ 0xA769, 0, 0 }, 0xA76A => [3]u21{ 0xA76B, 0, 0 }, 0xA76C => [3]u21{ 0xA76D, 0, 0 }, 0xA76E => [3]u21{ 0xA76F, 0, 0 }, 0xA779 => [3]u21{ 0xA77A, 0, 0 }, 0xA77B => [3]u21{ 0xA77C, 0, 0 }, 0xA77D => [3]u21{ 0x1D79, 0, 0 }, 0xA77E => [3]u21{ 0xA77F, 0, 0 }, 0xA780 => [3]u21{ 0xA781, 0, 0 }, 0xA782 => [3]u21{ 0xA783, 0, 0 }, 0xA784 => [3]u21{ 0xA785, 0, 0 }, 0xA786 => [3]u21{ 0xA787, 0, 0 }, 0xA78B => [3]u21{ 0xA78C, 0, 0 }, 0xA78D => [3]u21{ 0x265, 0, 0 }, 0xA790 => [3]u21{ 0xA791, 0, 0 }, 0xA792 => [3]u21{ 0xA793, 0, 0 }, 0xA796 => [3]u21{ 0xA797, 0, 0 }, 0xA798 => [3]u21{ 0xA799, 0, 0 }, 0xA79A => [3]u21{ 0xA79B, 0, 0 }, 0xA79C => [3]u21{ 0xA79D, 0, 0 }, 0xA79E => [3]u21{ 0xA79F, 0, 0 }, 0xA7A0 => [3]u21{ 0xA7A1, 0, 0 }, 0xA7A2 => [3]u21{ 0xA7A3, 0, 0 }, 0xA7A4 => [3]u21{ 0xA7A5, 0, 0 }, 0xA7A6 => [3]u21{ 0xA7A7, 0, 0 }, 0xA7A8 => [3]u21{ 0xA7A9, 0, 0 }, 0xA7AA => [3]u21{ 0x266, 0, 0 }, 0xA7AB => [3]u21{ 0x25C, 0, 0 }, 0xA7AC => [3]u21{ 0x261, 0, 0 }, 0xA7AD => [3]u21{ 0x26C, 0, 0 }, 0xA7AE => [3]u21{ 0x26A, 0, 0 }, 0xA7B0 => [3]u21{ 0x29E, 0, 0 }, 0xA7B1 => [3]u21{ 0x287, 0, 0 }, 0xA7B2 => [3]u21{ 0x29D, 0, 0 }, 0xA7B3 => [3]u21{ 0xAB53, 0, 0 }, 0xA7B4 => [3]u21{ 0xA7B5, 0, 0 }, 0xA7B6 => [3]u21{ 0xA7B7, 0, 0 }, 0xA7B8 => [3]u21{ 0xA7B9, 0, 0 }, 0xA7BA => [3]u21{ 0xA7BB, 0, 0 }, 0xA7BC => [3]u21{ 0xA7BD, 0, 0 }, 0xA7BE => [3]u21{ 0xA7BF, 0, 0 }, 0xA7C0 => [3]u21{ 0xA7C1, 0, 0 }, 0xA7C2 => [3]u21{ 0xA7C3, 0, 0 }, 0xA7C4 => [3]u21{ 0xA794, 0, 0 }, 0xA7C5 => [3]u21{ 0x282, 0, 0 }, 0xA7C6 => [3]u21{ 0x1D8E, 0, 0 }, 0xA7C7 => [3]u21{ 0xA7C8, 0, 0 }, 0xA7C9 => [3]u21{ 0xA7CA, 0, 0 }, 0xA7D0 => [3]u21{ 0xA7D1, 0, 0 }, 0xA7D6 => [3]u21{ 0xA7D7, 0, 0 }, 0xA7D8 => [3]u21{ 0xA7D9, 0, 0 }, 0xA7F5 => [3]u21{ 0xA7F6, 0, 0 }, 0xAB70 => [3]u21{ 0x13A0, 0, 0 }, 0xAB71 => [3]u21{ 0x13A1, 0, 0 }, 0xAB72 => [3]u21{ 0x13A2, 0, 0 }, 0xAB73 => [3]u21{ 0x13A3, 0, 0 }, 0xAB74 => [3]u21{ 0x13A4, 0, 0 }, 0xAB75 => [3]u21{ 0x13A5, 0, 0 }, 0xAB76 => [3]u21{ 0x13A6, 0, 0 }, 0xAB77 => [3]u21{ 0x13A7, 0, 0 }, 0xAB78 => [3]u21{ 0x13A8, 0, 0 }, 0xAB79 => [3]u21{ 0x13A9, 0, 0 }, 0xAB7A => [3]u21{ 0x13AA, 0, 0 }, 0xAB7B => [3]u21{ 0x13AB, 0, 0 }, 0xAB7C => [3]u21{ 0x13AC, 0, 0 }, 0xAB7D => [3]u21{ 0x13AD, 0, 0 }, 0xAB7E => [3]u21{ 0x13AE, 0, 0 }, 0xAB7F => [3]u21{ 0x13AF, 0, 0 }, 0xAB80 => [3]u21{ 0x13B0, 0, 0 }, 0xAB81 => [3]u21{ 0x13B1, 0, 0 }, 0xAB82 => [3]u21{ 0x13B2, 0, 0 }, 0xAB83 => [3]u21{ 0x13B3, 0, 0 }, 0xAB84 => [3]u21{ 0x13B4, 0, 0 }, 0xAB85 => [3]u21{ 0x13B5, 0, 0 }, 0xAB86 => [3]u21{ 0x13B6, 0, 0 }, 0xAB87 => [3]u21{ 0x13B7, 0, 0 }, 0xAB88 => [3]u21{ 0x13B8, 0, 0 }, 0xAB89 => [3]u21{ 0x13B9, 0, 0 }, 0xAB8A => [3]u21{ 0x13BA, 0, 0 }, 0xAB8B => [3]u21{ 0x13BB, 0, 0 }, 0xAB8C => [3]u21{ 0x13BC, 0, 0 }, 0xAB8D => [3]u21{ 0x13BD, 0, 0 }, 0xAB8E => [3]u21{ 0x13BE, 0, 0 }, 0xAB8F => [3]u21{ 0x13BF, 0, 0 }, 0xAB90 => [3]u21{ 0x13C0, 0, 0 }, 0xAB91 => [3]u21{ 0x13C1, 0, 0 }, 0xAB92 => [3]u21{ 0x13C2, 0, 0 }, 0xAB93 => [3]u21{ 0x13C3, 0, 0 }, 0xAB94 => [3]u21{ 0x13C4, 0, 0 }, 0xAB95 => [3]u21{ 0x13C5, 0, 0 }, 0xAB96 => [3]u21{ 0x13C6, 0, 0 }, 0xAB97 => [3]u21{ 0x13C7, 0, 0 }, 0xAB98 => [3]u21{ 0x13C8, 0, 0 }, 0xAB99 => [3]u21{ 0x13C9, 0, 0 }, 0xAB9A => [3]u21{ 0x13CA, 0, 0 }, 0xAB9B => [3]u21{ 0x13CB, 0, 0 }, 0xAB9C => [3]u21{ 0x13CC, 0, 0 }, 0xAB9D => [3]u21{ 0x13CD, 0, 0 }, 0xAB9E => [3]u21{ 0x13CE, 0, 0 }, 0xAB9F => [3]u21{ 0x13CF, 0, 0 }, 0xABA0 => [3]u21{ 0x13D0, 0, 0 }, 0xABA1 => [3]u21{ 0x13D1, 0, 0 }, 0xABA2 => [3]u21{ 0x13D2, 0, 0 }, 0xABA3 => [3]u21{ 0x13D3, 0, 0 }, 0xABA4 => [3]u21{ 0x13D4, 0, 0 }, 0xABA5 => [3]u21{ 0x13D5, 0, 0 }, 0xABA6 => [3]u21{ 0x13D6, 0, 0 }, 0xABA7 => [3]u21{ 0x13D7, 0, 0 }, 0xABA8 => [3]u21{ 0x13D8, 0, 0 }, 0xABA9 => [3]u21{ 0x13D9, 0, 0 }, 0xABAA => [3]u21{ 0x13DA, 0, 0 }, 0xABAB => [3]u21{ 0x13DB, 0, 0 }, 0xABAC => [3]u21{ 0x13DC, 0, 0 }, 0xABAD => [3]u21{ 0x13DD, 0, 0 }, 0xABAE => [3]u21{ 0x13DE, 0, 0 }, 0xABAF => [3]u21{ 0x13DF, 0, 0 }, 0xABB0 => [3]u21{ 0x13E0, 0, 0 }, 0xABB1 => [3]u21{ 0x13E1, 0, 0 }, 0xABB2 => [3]u21{ 0x13E2, 0, 0 }, 0xABB3 => [3]u21{ 0x13E3, 0, 0 }, 0xABB4 => [3]u21{ 0x13E4, 0, 0 }, 0xABB5 => [3]u21{ 0x13E5, 0, 0 }, 0xABB6 => [3]u21{ 0x13E6, 0, 0 }, 0xABB7 => [3]u21{ 0x13E7, 0, 0 }, 0xABB8 => [3]u21{ 0x13E8, 0, 0 }, 0xABB9 => [3]u21{ 0x13E9, 0, 0 }, 0xABBA => [3]u21{ 0x13EA, 0, 0 }, 0xABBB => [3]u21{ 0x13EB, 0, 0 }, 0xABBC => [3]u21{ 0x13EC, 0, 0 }, 0xABBD => [3]u21{ 0x13ED, 0, 0 }, 0xABBE => [3]u21{ 0x13EE, 0, 0 }, 0xABBF => [3]u21{ 0x13EF, 0, 0 }, 0xFB00 => [3]u21{ 0x66, 0x66, 0 }, 0xFB01 => [3]u21{ 0x66, 0x69, 0 }, 0xFB02 => [3]u21{ 0x66, 0x6C, 0 }, 0xFB03 => [3]u21{ 0x66, 0x66, 0x69 }, 0xFB04 => [3]u21{ 0x66, 0x66, 0x6C }, 0xFB05 => [3]u21{ 0x73, 0x74, 0 }, 0xFB06 => [3]u21{ 0x73, 0x74, 0 }, 0xFB13 => [3]u21{ 0x574, 0x576, 0 }, 0xFB14 => [3]u21{ 0x574, 0x565, 0 }, 0xFB15 => [3]u21{ 0x574, 0x56B, 0 }, 0xFB16 => [3]u21{ 0x57E, 0x576, 0 }, 0xFB17 => [3]u21{ 0x574, 0x56D, 0 }, 0xFF21 => [3]u21{ 0xFF41, 0, 0 }, 0xFF22 => [3]u21{ 0xFF42, 0, 0 }, 0xFF23 => [3]u21{ 0xFF43, 0, 0 }, 0xFF24 => [3]u21{ 0xFF44, 0, 0 }, 0xFF25 => [3]u21{ 0xFF45, 0, 0 }, 0xFF26 => [3]u21{ 0xFF46, 0, 0 }, 0xFF27 => [3]u21{ 0xFF47, 0, 0 }, 0xFF28 => [3]u21{ 0xFF48, 0, 0 }, 0xFF29 => [3]u21{ 0xFF49, 0, 0 }, 0xFF2A => [3]u21{ 0xFF4A, 0, 0 }, 0xFF2B => [3]u21{ 0xFF4B, 0, 0 }, 0xFF2C => [3]u21{ 0xFF4C, 0, 0 }, 0xFF2D => [3]u21{ 0xFF4D, 0, 0 }, 0xFF2E => [3]u21{ 0xFF4E, 0, 0 }, 0xFF2F => [3]u21{ 0xFF4F, 0, 0 }, 0xFF30 => [3]u21{ 0xFF50, 0, 0 }, 0xFF31 => [3]u21{ 0xFF51, 0, 0 }, 0xFF32 => [3]u21{ 0xFF52, 0, 0 }, 0xFF33 => [3]u21{ 0xFF53, 0, 0 }, 0xFF34 => [3]u21{ 0xFF54, 0, 0 }, 0xFF35 => [3]u21{ 0xFF55, 0, 0 }, 0xFF36 => [3]u21{ 0xFF56, 0, 0 }, 0xFF37 => [3]u21{ 0xFF57, 0, 0 }, 0xFF38 => [3]u21{ 0xFF58, 0, 0 }, 0xFF39 => [3]u21{ 0xFF59, 0, 0 }, 0xFF3A => [3]u21{ 0xFF5A, 0, 0 }, 0x10400 => [3]u21{ 0x10428, 0, 0 }, 0x10401 => [3]u21{ 0x10429, 0, 0 }, 0x10402 => [3]u21{ 0x1042A, 0, 0 }, 0x10403 => [3]u21{ 0x1042B, 0, 0 }, 0x10404 => [3]u21{ 0x1042C, 0, 0 }, 0x10405 => [3]u21{ 0x1042D, 0, 0 }, 0x10406 => [3]u21{ 0x1042E, 0, 0 }, 0x10407 => [3]u21{ 0x1042F, 0, 0 }, 0x10408 => [3]u21{ 0x10430, 0, 0 }, 0x10409 => [3]u21{ 0x10431, 0, 0 }, 0x1040A => [3]u21{ 0x10432, 0, 0 }, 0x1040B => [3]u21{ 0x10433, 0, 0 }, 0x1040C => [3]u21{ 0x10434, 0, 0 }, 0x1040D => [3]u21{ 0x10435, 0, 0 }, 0x1040E => [3]u21{ 0x10436, 0, 0 }, 0x1040F => [3]u21{ 0x10437, 0, 0 }, 0x10410 => [3]u21{ 0x10438, 0, 0 }, 0x10411 => [3]u21{ 0x10439, 0, 0 }, 0x10412 => [3]u21{ 0x1043A, 0, 0 }, 0x10413 => [3]u21{ 0x1043B, 0, 0 }, 0x10414 => [3]u21{ 0x1043C, 0, 0 }, 0x10415 => [3]u21{ 0x1043D, 0, 0 }, 0x10416 => [3]u21{ 0x1043E, 0, 0 }, 0x10417 => [3]u21{ 0x1043F, 0, 0 }, 0x10418 => [3]u21{ 0x10440, 0, 0 }, 0x10419 => [3]u21{ 0x10441, 0, 0 }, 0x1041A => [3]u21{ 0x10442, 0, 0 }, 0x1041B => [3]u21{ 0x10443, 0, 0 }, 0x1041C => [3]u21{ 0x10444, 0, 0 }, 0x1041D => [3]u21{ 0x10445, 0, 0 }, 0x1041E => [3]u21{ 0x10446, 0, 0 }, 0x1041F => [3]u21{ 0x10447, 0, 0 }, 0x10420 => [3]u21{ 0x10448, 0, 0 }, 0x10421 => [3]u21{ 0x10449, 0, 0 }, 0x10422 => [3]u21{ 0x1044A, 0, 0 }, 0x10423 => [3]u21{ 0x1044B, 0, 0 }, 0x10424 => [3]u21{ 0x1044C, 0, 0 }, 0x10425 => [3]u21{ 0x1044D, 0, 0 }, 0x10426 => [3]u21{ 0x1044E, 0, 0 }, 0x10427 => [3]u21{ 0x1044F, 0, 0 }, 0x104B0 => [3]u21{ 0x104D8, 0, 0 }, 0x104B1 => [3]u21{ 0x104D9, 0, 0 }, 0x104B2 => [3]u21{ 0x104DA, 0, 0 }, 0x104B3 => [3]u21{ 0x104DB, 0, 0 }, 0x104B4 => [3]u21{ 0x104DC, 0, 0 }, 0x104B5 => [3]u21{ 0x104DD, 0, 0 }, 0x104B6 => [3]u21{ 0x104DE, 0, 0 }, 0x104B7 => [3]u21{ 0x104DF, 0, 0 }, 0x104B8 => [3]u21{ 0x104E0, 0, 0 }, 0x104B9 => [3]u21{ 0x104E1, 0, 0 }, 0x104BA => [3]u21{ 0x104E2, 0, 0 }, 0x104BB => [3]u21{ 0x104E3, 0, 0 }, 0x104BC => [3]u21{ 0x104E4, 0, 0 }, 0x104BD => [3]u21{ 0x104E5, 0, 0 }, 0x104BE => [3]u21{ 0x104E6, 0, 0 }, 0x104BF => [3]u21{ 0x104E7, 0, 0 }, 0x104C0 => [3]u21{ 0x104E8, 0, 0 }, 0x104C1 => [3]u21{ 0x104E9, 0, 0 }, 0x104C2 => [3]u21{ 0x104EA, 0, 0 }, 0x104C3 => [3]u21{ 0x104EB, 0, 0 }, 0x104C4 => [3]u21{ 0x104EC, 0, 0 }, 0x104C5 => [3]u21{ 0x104ED, 0, 0 }, 0x104C6 => [3]u21{ 0x104EE, 0, 0 }, 0x104C7 => [3]u21{ 0x104EF, 0, 0 }, 0x104C8 => [3]u21{ 0x104F0, 0, 0 }, 0x104C9 => [3]u21{ 0x104F1, 0, 0 }, 0x104CA => [3]u21{ 0x104F2, 0, 0 }, 0x104CB => [3]u21{ 0x104F3, 0, 0 }, 0x104CC => [3]u21{ 0x104F4, 0, 0 }, 0x104CD => [3]u21{ 0x104F5, 0, 0 }, 0x104CE => [3]u21{ 0x104F6, 0, 0 }, 0x104CF => [3]u21{ 0x104F7, 0, 0 }, 0x104D0 => [3]u21{ 0x104F8, 0, 0 }, 0x104D1 => [3]u21{ 0x104F9, 0, 0 }, 0x104D2 => [3]u21{ 0x104FA, 0, 0 }, 0x104D3 => [3]u21{ 0x104FB, 0, 0 }, 0x10570 => [3]u21{ 0x10597, 0, 0 }, 0x10571 => [3]u21{ 0x10598, 0, 0 }, 0x10572 => [3]u21{ 0x10599, 0, 0 }, 0x10573 => [3]u21{ 0x1059A, 0, 0 }, 0x10574 => [3]u21{ 0x1059B, 0, 0 }, 0x10575 => [3]u21{ 0x1059C, 0, 0 }, 0x10576 => [3]u21{ 0x1059D, 0, 0 }, 0x10577 => [3]u21{ 0x1059E, 0, 0 }, 0x10578 => [3]u21{ 0x1059F, 0, 0 }, 0x10579 => [3]u21{ 0x105A0, 0, 0 }, 0x1057A => [3]u21{ 0x105A1, 0, 0 }, 0x1057C => [3]u21{ 0x105A3, 0, 0 }, 0x1057D => [3]u21{ 0x105A4, 0, 0 }, 0x1057E => [3]u21{ 0x105A5, 0, 0 }, 0x1057F => [3]u21{ 0x105A6, 0, 0 }, 0x10580 => [3]u21{ 0x105A7, 0, 0 }, 0x10581 => [3]u21{ 0x105A8, 0, 0 }, 0x10582 => [3]u21{ 0x105A9, 0, 0 }, 0x10583 => [3]u21{ 0x105AA, 0, 0 }, 0x10584 => [3]u21{ 0x105AB, 0, 0 }, 0x10585 => [3]u21{ 0x105AC, 0, 0 }, 0x10586 => [3]u21{ 0x105AD, 0, 0 }, 0x10587 => [3]u21{ 0x105AE, 0, 0 }, 0x10588 => [3]u21{ 0x105AF, 0, 0 }, 0x10589 => [3]u21{ 0x105B0, 0, 0 }, 0x1058A => [3]u21{ 0x105B1, 0, 0 }, 0x1058C => [3]u21{ 0x105B3, 0, 0 }, 0x1058D => [3]u21{ 0x105B4, 0, 0 }, 0x1058E => [3]u21{ 0x105B5, 0, 0 }, 0x1058F => [3]u21{ 0x105B6, 0, 0 }, 0x10590 => [3]u21{ 0x105B7, 0, 0 }, 0x10591 => [3]u21{ 0x105B8, 0, 0 }, 0x10592 => [3]u21{ 0x105B9, 0, 0 }, 0x10594 => [3]u21{ 0x105BB, 0, 0 }, 0x10595 => [3]u21{ 0x105BC, 0, 0 }, 0x10C80 => [3]u21{ 0x10CC0, 0, 0 }, 0x10C81 => [3]u21{ 0x10CC1, 0, 0 }, 0x10C82 => [3]u21{ 0x10CC2, 0, 0 }, 0x10C83 => [3]u21{ 0x10CC3, 0, 0 }, 0x10C84 => [3]u21{ 0x10CC4, 0, 0 }, 0x10C85 => [3]u21{ 0x10CC5, 0, 0 }, 0x10C86 => [3]u21{ 0x10CC6, 0, 0 }, 0x10C87 => [3]u21{ 0x10CC7, 0, 0 }, 0x10C88 => [3]u21{ 0x10CC8, 0, 0 }, 0x10C89 => [3]u21{ 0x10CC9, 0, 0 }, 0x10C8A => [3]u21{ 0x10CCA, 0, 0 }, 0x10C8B => [3]u21{ 0x10CCB, 0, 0 }, 0x10C8C => [3]u21{ 0x10CCC, 0, 0 }, 0x10C8D => [3]u21{ 0x10CCD, 0, 0 }, 0x10C8E => [3]u21{ 0x10CCE, 0, 0 }, 0x10C8F => [3]u21{ 0x10CCF, 0, 0 }, 0x10C90 => [3]u21{ 0x10CD0, 0, 0 }, 0x10C91 => [3]u21{ 0x10CD1, 0, 0 }, 0x10C92 => [3]u21{ 0x10CD2, 0, 0 }, 0x10C93 => [3]u21{ 0x10CD3, 0, 0 }, 0x10C94 => [3]u21{ 0x10CD4, 0, 0 }, 0x10C95 => [3]u21{ 0x10CD5, 0, 0 }, 0x10C96 => [3]u21{ 0x10CD6, 0, 0 }, 0x10C97 => [3]u21{ 0x10CD7, 0, 0 }, 0x10C98 => [3]u21{ 0x10CD8, 0, 0 }, 0x10C99 => [3]u21{ 0x10CD9, 0, 0 }, 0x10C9A => [3]u21{ 0x10CDA, 0, 0 }, 0x10C9B => [3]u21{ 0x10CDB, 0, 0 }, 0x10C9C => [3]u21{ 0x10CDC, 0, 0 }, 0x10C9D => [3]u21{ 0x10CDD, 0, 0 }, 0x10C9E => [3]u21{ 0x10CDE, 0, 0 }, 0x10C9F => [3]u21{ 0x10CDF, 0, 0 }, 0x10CA0 => [3]u21{ 0x10CE0, 0, 0 }, 0x10CA1 => [3]u21{ 0x10CE1, 0, 0 }, 0x10CA2 => [3]u21{ 0x10CE2, 0, 0 }, 0x10CA3 => [3]u21{ 0x10CE3, 0, 0 }, 0x10CA4 => [3]u21{ 0x10CE4, 0, 0 }, 0x10CA5 => [3]u21{ 0x10CE5, 0, 0 }, 0x10CA6 => [3]u21{ 0x10CE6, 0, 0 }, 0x10CA7 => [3]u21{ 0x10CE7, 0, 0 }, 0x10CA8 => [3]u21{ 0x10CE8, 0, 0 }, 0x10CA9 => [3]u21{ 0x10CE9, 0, 0 }, 0x10CAA => [3]u21{ 0x10CEA, 0, 0 }, 0x10CAB => [3]u21{ 0x10CEB, 0, 0 }, 0x10CAC => [3]u21{ 0x10CEC, 0, 0 }, 0x10CAD => [3]u21{ 0x10CED, 0, 0 }, 0x10CAE => [3]u21{ 0x10CEE, 0, 0 }, 0x10CAF => [3]u21{ 0x10CEF, 0, 0 }, 0x10CB0 => [3]u21{ 0x10CF0, 0, 0 }, 0x10CB1 => [3]u21{ 0x10CF1, 0, 0 }, 0x10CB2 => [3]u21{ 0x10CF2, 0, 0 }, 0x118A0 => [3]u21{ 0x118C0, 0, 0 }, 0x118A1 => [3]u21{ 0x118C1, 0, 0 }, 0x118A2 => [3]u21{ 0x118C2, 0, 0 }, 0x118A3 => [3]u21{ 0x118C3, 0, 0 }, 0x118A4 => [3]u21{ 0x118C4, 0, 0 }, 0x118A5 => [3]u21{ 0x118C5, 0, 0 }, 0x118A6 => [3]u21{ 0x118C6, 0, 0 }, 0x118A7 => [3]u21{ 0x118C7, 0, 0 }, 0x118A8 => [3]u21{ 0x118C8, 0, 0 }, 0x118A9 => [3]u21{ 0x118C9, 0, 0 }, 0x118AA => [3]u21{ 0x118CA, 0, 0 }, 0x118AB => [3]u21{ 0x118CB, 0, 0 }, 0x118AC => [3]u21{ 0x118CC, 0, 0 }, 0x118AD => [3]u21{ 0x118CD, 0, 0 }, 0x118AE => [3]u21{ 0x118CE, 0, 0 }, 0x118AF => [3]u21{ 0x118CF, 0, 0 }, 0x118B0 => [3]u21{ 0x118D0, 0, 0 }, 0x118B1 => [3]u21{ 0x118D1, 0, 0 }, 0x118B2 => [3]u21{ 0x118D2, 0, 0 }, 0x118B3 => [3]u21{ 0x118D3, 0, 0 }, 0x118B4 => [3]u21{ 0x118D4, 0, 0 }, 0x118B5 => [3]u21{ 0x118D5, 0, 0 }, 0x118B6 => [3]u21{ 0x118D6, 0, 0 }, 0x118B7 => [3]u21{ 0x118D7, 0, 0 }, 0x118B8 => [3]u21{ 0x118D8, 0, 0 }, 0x118B9 => [3]u21{ 0x118D9, 0, 0 }, 0x118BA => [3]u21{ 0x118DA, 0, 0 }, 0x118BB => [3]u21{ 0x118DB, 0, 0 }, 0x118BC => [3]u21{ 0x118DC, 0, 0 }, 0x118BD => [3]u21{ 0x118DD, 0, 0 }, 0x118BE => [3]u21{ 0x118DE, 0, 0 }, 0x118BF => [3]u21{ 0x118DF, 0, 0 }, 0x16E40 => [3]u21{ 0x16E60, 0, 0 }, 0x16E41 => [3]u21{ 0x16E61, 0, 0 }, 0x16E42 => [3]u21{ 0x16E62, 0, 0 }, 0x16E43 => [3]u21{ 0x16E63, 0, 0 }, 0x16E44 => [3]u21{ 0x16E64, 0, 0 }, 0x16E45 => [3]u21{ 0x16E65, 0, 0 }, 0x16E46 => [3]u21{ 0x16E66, 0, 0 }, 0x16E47 => [3]u21{ 0x16E67, 0, 0 }, 0x16E48 => [3]u21{ 0x16E68, 0, 0 }, 0x16E49 => [3]u21{ 0x16E69, 0, 0 }, 0x16E4A => [3]u21{ 0x16E6A, 0, 0 }, 0x16E4B => [3]u21{ 0x16E6B, 0, 0 }, 0x16E4C => [3]u21{ 0x16E6C, 0, 0 }, 0x16E4D => [3]u21{ 0x16E6D, 0, 0 }, 0x16E4E => [3]u21{ 0x16E6E, 0, 0 }, 0x16E4F => [3]u21{ 0x16E6F, 0, 0 }, 0x16E50 => [3]u21{ 0x16E70, 0, 0 }, 0x16E51 => [3]u21{ 0x16E71, 0, 0 }, 0x16E52 => [3]u21{ 0x16E72, 0, 0 }, 0x16E53 => [3]u21{ 0x16E73, 0, 0 }, 0x16E54 => [3]u21{ 0x16E74, 0, 0 }, 0x16E55 => [3]u21{ 0x16E75, 0, 0 }, 0x16E56 => [3]u21{ 0x16E76, 0, 0 }, 0x16E57 => [3]u21{ 0x16E77, 0, 0 }, 0x16E58 => [3]u21{ 0x16E78, 0, 0 }, 0x16E59 => [3]u21{ 0x16E79, 0, 0 }, 0x16E5A => [3]u21{ 0x16E7A, 0, 0 }, 0x16E5B => [3]u21{ 0x16E7B, 0, 0 }, 0x16E5C => [3]u21{ 0x16E7C, 0, 0 }, 0x16E5D => [3]u21{ 0x16E7D, 0, 0 }, 0x16E5E => [3]u21{ 0x16E7E, 0, 0 }, 0x16E5F => [3]u21{ 0x16E7F, 0, 0 }, 0x1E900 => [3]u21{ 0x1E922, 0, 0 }, 0x1E901 => [3]u21{ 0x1E923, 0, 0 }, 0x1E902 => [3]u21{ 0x1E924, 0, 0 }, 0x1E903 => [3]u21{ 0x1E925, 0, 0 }, 0x1E904 => [3]u21{ 0x1E926, 0, 0 }, 0x1E905 => [3]u21{ 0x1E927, 0, 0 }, 0x1E906 => [3]u21{ 0x1E928, 0, 0 }, 0x1E907 => [3]u21{ 0x1E929, 0, 0 }, 0x1E908 => [3]u21{ 0x1E92A, 0, 0 }, 0x1E909 => [3]u21{ 0x1E92B, 0, 0 }, 0x1E90A => [3]u21{ 0x1E92C, 0, 0 }, 0x1E90B => [3]u21{ 0x1E92D, 0, 0 }, 0x1E90C => [3]u21{ 0x1E92E, 0, 0 }, 0x1E90D => [3]u21{ 0x1E92F, 0, 0 }, 0x1E90E => [3]u21{ 0x1E930, 0, 0 }, 0x1E90F => [3]u21{ 0x1E931, 0, 0 }, 0x1E910 => [3]u21{ 0x1E932, 0, 0 }, 0x1E911 => [3]u21{ 0x1E933, 0, 0 }, 0x1E912 => [3]u21{ 0x1E934, 0, 0 }, 0x1E913 => [3]u21{ 0x1E935, 0, 0 }, 0x1E914 => [3]u21{ 0x1E936, 0, 0 }, 0x1E915 => [3]u21{ 0x1E937, 0, 0 }, 0x1E916 => [3]u21{ 0x1E938, 0, 0 }, 0x1E917 => [3]u21{ 0x1E939, 0, 0 }, 0x1E918 => [3]u21{ 0x1E93A, 0, 0 }, 0x1E919 => [3]u21{ 0x1E93B, 0, 0 }, 0x1E91A => [3]u21{ 0x1E93C, 0, 0 }, 0x1E91B => [3]u21{ 0x1E93D, 0, 0 }, 0x1E91C => [3]u21{ 0x1E93E, 0, 0 }, 0x1E91D => [3]u21{ 0x1E93F, 0, 0 }, 0x1E91E => [3]u21{ 0x1E940, 0, 0 }, 0x1E91F => [3]u21{ 0x1E941, 0, 0 }, 0x1E920 => [3]u21{ 0x1E942, 0, 0 }, 0x1E921 => [3]u21{ 0x1E943, 0, 0 }, else => [3]u21{ cp, 0, 0 }, }; }
.gyro/ziglyph-jecolon-github.com-c37d93b6/pkg/src/autogen/case_folding.zig
const std = @import("std"); const time = std.time; const Allocator = std.mem.Allocator; const bindings = @import("bindings.zig"); const c = bindings.c; const Sdl = bindings.Sdl; const Gl = bindings.Gl; const BasicContext = @import("basic_video.zig").BasicContext; const PixelBuffer = @import("basic_video.zig").PixelBuffer; const ImguiContext = @import("imgui.zig").ImguiContext; pub fn Context(comptime using_imgui: bool) type { const ExtensionContext = if (using_imgui) ImguiContext else BasicContext; return struct { const Self = @This(); allocator: *Allocator, window: *Sdl.Window, gl_context: Sdl.GLContext, extension_context: ExtensionContext, last_frame_time: i128, next_frame_time: i128, pub const DrawOptions = struct { timing: enum { untimed, timed, }, // ~1/60 frametime: f32 = (4 * (261 * 341 + 340.5)) / 21477272.0, }; pub fn init(allocator: *Allocator, console: anytype, title: [:0]const u8) !Self { const window = try Sdl.createWindow(.{ title, c.SDL_WINDOWPOS_CENTERED, c.SDL_WINDOWPOS_CENTERED, 256 * 3, 240 * 3, c.SDL_WINDOW_OPENGL, }); errdefer Sdl.destroyWindow(.{window}); try Sdl.glSetAttribute(.{ c.SDL_GL_CONTEXT_MAJOR_VERSION, 3 }); try Sdl.glSetAttribute(.{ c.SDL_GL_CONTEXT_MINOR_VERSION, 0 }); try Sdl.glSetAttribute(.{ c.SDL_GL_CONTEXT_FLAGS, 0 }); try Sdl.glSetAttribute(.{ c.SDL_GL_CONTEXT_PROFILE_MASK, c.SDL_GL_CONTEXT_PROFILE_CORE }); try Sdl.glSetAttribute(.{ c.SDL_GL_DOUBLEBUFFER, 1 }); try Sdl.glSetAttribute(.{ c.SDL_GL_DEPTH_SIZE, 0 }); const gl_context = try Sdl.glCreateContext(.{window}); errdefer Sdl.glDeleteContext(.{gl_context}); try Sdl.glMakeCurrent(.{ window, gl_context }); try Sdl.glSetSwapInterval(.{0}); var self = Self{ .allocator = allocator, .window = window, .gl_context = gl_context, .extension_context = undefined, .last_frame_time = undefined, .next_frame_time = undefined, }; const extension_context = try if (using_imgui) ExtensionContext.init(&self, console) else ExtensionContext.init(&self); const now = time.nanoTimestamp(); self.extension_context = extension_context; self.last_frame_time = now; self.next_frame_time = now; return self; } pub fn deinit(self: *Self, allocator: *Allocator) void { self.extension_context.deinit(allocator); Sdl.glDeleteContext(.{self.gl_context}); Sdl.destroyWindow(.{self.window}); } pub inline fn getGamePixelBuffer(self: *Self) *PixelBuffer { return self.extension_context.getGamePixelBuffer(); } pub inline fn handleEvent(self: *Self, event: c.SDL_Event) bool { return self.extension_context.handleEvent(event); } pub fn draw(self: *Self, draw_options: DrawOptions) !i128 { try self.extension_context.draw(); Sdl.glSwapWindow(.{self.window}); const frame_ns = @floatToInt(i128, time.ns_per_s * draw_options.frametime); const now = time.nanoTimestamp(); const to_sleep = self.next_frame_time - now; var passed = now - self.last_frame_time; switch (draw_options.timing) { .untimed => {}, .timed => if (to_sleep > 0) { time.sleep(@intCast(u64, to_sleep)); passed += to_sleep; }, } self.next_frame_time += frame_ns; self.last_frame_time += passed; return passed; } }; }
src/sdl/context.zig
const std = @import("std"); const utils = @import("utils"); const Allocator = std.mem.Allocator; const ArenaAllocator = std.heap.ArenaAllocator; const print = utils.print; fn readInput(arena: *ArenaAllocator, lines_it: *utils.FileLineIterator) anyerror![]i32 { var numbers = try std.ArrayList(i32).initCapacity(&arena.allocator, 4096); const line = lines_it.next() orelse unreachable; var numbers_it = std.mem.tokenize(u8, line, ","); while (numbers_it.next()) |num| { const i = try std.fmt.parseInt(i32, num, 10); try numbers.append(i); } print("File ok :) Number of inputs: {d}", .{numbers.items.len}); return numbers.items; } fn part1(arena: *ArenaAllocator, inputFishes: []i32) anyerror!i32 { var fishes = try std.ArrayList(i32).initCapacity(&arena.allocator, 1024 * 1024); try fishes.appendSlice(inputFishes); var day: usize = 0; while (day < 80) : (day += 1) { var fish_count = fishes.items.len; var i: usize = 0; while (i < fish_count) : (i += 1) { if (fishes.items[i] == 0) { fishes.items[i] = 6; try fishes.append(8); } else { fishes.items[i] -= 1; } } } return @intCast(i32, fishes.items.len); } fn part2(inputFishes: []i32) u64 { var fishCountByAge = std.mem.zeroes([9]u64); for (inputFishes) |inputFish| { fishCountByAge[@intCast(usize, inputFish)] += 1; } var day: usize = 0; while (day < 256) : (day += 1) { const numResetFishes = fishCountByAge[0]; var i: usize = 1; while (i < fishCountByAge.len) : (i += 1) { fishCountByAge[i - 1] = fishCountByAge[i]; } fishCountByAge[6] += numResetFishes; fishCountByAge[8] = numResetFishes; } var sum: u64 = 0; for (fishCountByAge) |count| { sum += count; } return sum; } pub fn main() anyerror!void { var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); defer arena.deinit(); var lines_it = try utils.iterateLinesInFile(&arena.allocator, "input.txt"); defer lines_it.deinit(); const input = try readInput(&arena, &lines_it); const part1_result = part1(&arena, input); print("Part 1: {d}", .{part1_result}); const part2_result = part2(input); print("Part 2: {d}", .{part2_result}); }
day6/src/main.zig
const anim = @import("Animation.zig"); pub const Animation = anim.Animation; pub const Mesh = @import("Mesh.zig").Mesh; pub const MeshRenderer = @import("MeshRenderer.zig").MeshRenderer; pub const Light = @import("Light.zig").Light; pub const Texture2D = @import("Texture2D.zig").Texture2D; const PostProcess = @import("PostProcess.zig"); const Matrix = @import("../Mathematics/Mathematics.zig").Matrix; const Vector = @import("../Mathematics/Mathematics.zig").Vector; const wgi = @import("../WindowGraphicsInput/WindowGraphicsInput.zig"); const Tex2D = wgi.Texture2D; const ImageType = wgi.ImageType; const MinFilter = wgi.MinFilter; const ShaderObject = wgi.ShaderObject; const ShaderType = wgi.ShaderType; const ShaderProgram = wgi.ShaderProgram; const Buffer = wgi.Buffer; const window = wgi.window; const FrameBuffer = wgi.FrameBuffer; const CubeFrameBuffer = wgi.CubeFrameBuffer; const std = @import("std"); const ArrayList = std.ArrayList; const shdr = @import("Shader.zig"); const assert = std.debug.assert; const warn = std.debug.warn; const Allocator = std.mem.Allocator; const ReferenceCounter = @import("../RefCount.zig").ReferenceCounter; const files = @import("../Files.zig"); const loadFileWithNullTerminator = files.loadFileWithNullTerminator; const VertexMeta = wgi.VertexMeta; const UniformDataLight = @import("Light.zig").UniformDataLight; const getLightData = @import("Light.zig").getLightData; // Number of active lights in scene, recalculated each frame var lights_count: u32 = 0; // Time value set at start of each frame pub var this_frame_time: u64 = 0; const MAX_LIGHTS = 256; // Must match value in StandardShader.glsl pub const SettingsStruct = struct { // Changing these variables may result in shaders being recompiled in the next frame max_fragment_lights: u32 = 4, // max 4 max_vertex_lights: u32 = 8, // max 8 enable_specular_light: bool = true, enable_point_lights: bool = true, enable_directional_lights: bool = true, enable_spot_lights: bool = true, enable_shadows: bool = true, // These cost nothing to change ambient: [3]f32 = [3]f32{ 0.1, 0.1, 0.1 }, clear_colour: [3]f32 = [3]f32{ 0.5, 0.5, 0.5 }, fog_colour: [4]f32 = [4]f32{ 0.5, 0.5, 0.5, 1.0 }, }; var settings: ?SettingsStruct = null; pub fn getSettings() *SettingsStruct { return &settings.?; } var brightness: f32 = 1.0; var contrast: f32 = 1.0; var default_texture: ?Tex2D = null; var default_normal_map: ?Tex2D = null; pub fn getDefaultTexture() *const Tex2D { return &default_texture.?; } pub fn getDefaultNormalMap() *const Tex2D { return &default_normal_map.?; } var blur_shader_vs_src: ?[]u8 = null; var blur_shader_fs_src: ?[]u8 = null; pub var blur_shader_program: ?ShaderProgram = null; pub var lights: ?ArrayList(*Object) = null; // Per-frame, inter-frame data stored in VRAM var uniform_buffer: ?Buffer = null; const UniformData = packed struct { eye_position: [4]f32, fog_colour: [4]f32, lights: [MAX_LIGHTS]UniformDataLight, }; var uniform_data: ?*UniformData = null; pub const Object = struct { name: [16]u8 = ([1]u8{0}) ** 16, name_length: u32 = 0, // If parent is null then the object has been deleted parent: ?*Object = null, first_child: ?*Object = null, next: ?*Object = null, prev: ?*Object = null, inherit_parent_transform: bool = true, // objects don't have to have a mesh renderer. // meshes can be used by multiple different objects // DO NOT ALTER THIS VARIABLE. USE fn setMeshRenderer mesh_renderer: ?*MeshRenderer = null, light: ?Light = null, // -- INTERNAL VARIABLES (READ-ONLY) transform: Matrix(f32, 4) = Matrix(f32, 4).identity(), // -- INTERNAL VARIABLES (DO NOT TOUCH) -- true_transform: ?Matrix(f32, 4) = null, pub fn init(name: []const u8) Object { var obj = Object{}; obj.name_length = std.math.min(@intCast(u32, name.len), 16); std.mem.copy(u8, obj.name[0..obj.name_length], name[0..obj.name_length]); return obj; } pub fn setTransform(self: *Object, new_transform: Matrix(f32, 4)) void { self.transform = new_transform; self.nullifyTrueTransform(); } fn nullifyTrueTransform(self: *Object) void { self.true_transform = null; if (self.first_child != null) { self.first_child.?.nullifyTrueTransform(); } if (self.next != null and self.next.? != self and self.next.? != self.parent.?.first_child.?) { self.next.?.nullifyTrueTransform(); } } pub fn delete_(self: *Object, free_resources: bool) void { // Detatch associated resources if (self.mesh_renderer != null) { self.mesh_renderer.?.ref_count.dec(); if (free_resources) { self.mesh_renderer.?.freeIfUnused(); } } self.mesh_renderer = null; // Delete the children if (self.first_child != null) { self.first_child.?.delete_(free_resources); } if (self.next != null and self.next.? != self and self.next.? != self.parent.?.first_child.?) { self.next.?.delete_(free_resources); } } // Also deletes all children pub fn delete(self: *Object, free_resources: bool) void { if (active_camera == self) { active_camera = null; } // Detatch from parent if (self.parent != null) { if (self.parent.?.*.first_child == self) { if (self.next == null) { self.parent.?.*.first_child = null; } else { self.parent.?.*.first_child = self.next; self.next.?.prev = null; self.prev.?.next = null; } } else { self.prev.?.next = self.next; self.next.?.prev = self.prev; if (self.prev.?.next == self.prev.? or self.prev.?.prev == self.prev.?) { self.prev.?.next = null; self.prev.?.prev = null; } if (self.next.?.next == self.next.? or self.next.?.prev == self.next.?) { self.next.?.next = null; self.next.?.prev = null; } } self.parent = null; } if (free_resources) { self.delete_(free_resources); } } pub fn setMeshRenderer(self: *Object, mesh_renderer: ?*MeshRenderer) void { ReferenceCounter.set(MeshRenderer, &self.mesh_renderer, mesh_renderer); } pub fn addChild(self: *Object, child: *Object) !void { if (child.parent != null) { return error.ChildIsNotAnOrphan; } child.parent = self; if (self.first_child == null) { self.first_child = child; child.prev = null; child.next = null; } else { if (self.first_child.?.next == null) { assert(self.first_child.?.prev == null); self.first_child.?.next = child; self.first_child.?.prev = child; child.prev = self.first_child.?; child.next = self.first_child.?; } else { self.first_child.?.prev.?.next = child; child.prev = self.first_child.?.prev; self.first_child.?.prev = child; child.next = self.first_child.?; } } } pub fn nameIs(self: *Object, name: []const u8) bool { if (name.len > 16) { return false; } if (name.len != self.name_length) { return false; } var i: u32 = 0; while (i < name.len) : (i += 1) { if (name[i] != self.name[i]) { return false; } } return true; } // Only searches direct descendants on this object pub fn findChild(self: *Object, child_name: []const u8) ?*Object { const first = self.first_child; var current = self.first_child; while (current != null) { if (current.?.nameIs(child_name)) { return current.?; } current = current.?.next; if (current == first) { break; } } return null; } // pub fn findChildRecursive(self: *Object, child_name: []const u8) !*Object { // TODO // } // Calculates transformation matrix of object in world space (applies transformations of all parents) pub fn calculateTransform(self: *Object) void { if (self.true_transform == null) { if (self.inherit_parent_transform and self.parent != null and self.parent.?.parent != null) { self.parent.?.calculateTransform(); self.true_transform = self.parent.?.true_transform.?.mul(self.transform); } else { self.true_transform = self.transform; } } assert(self.true_transform != null); } pub fn renderObject(self: *Object, allocator: *Allocator, view_matrix: *const Matrix(f32, 4), projection_matrix: *const Matrix(f32, 4), depth_only: bool) !void { if (self.mesh_renderer == null) { return; } self.calculateTransform(); assert(self.true_transform != null); const model_view_matrix = self.true_transform.?.mul(view_matrix.*); const mvp_matrix = model_view_matrix.mul(projection_matrix.*); if (depth_only) { // For shadow maps try self.mesh_renderer.?.*.drawDepthOnly(allocator, &mvp_matrix, &self.true_transform.?); } else { var draw_data = MeshRenderer.DrawData{ .mvp_matrix = &mvp_matrix, .model_matrix = &self.true_transform.?, .model_view_matrix = &model_view_matrix, .light = getSettings().ambient, .vertex_light_indices = [8]i32{ -1, -1, -1, -1, -1, -1, -1, -1 }, .fragment_light_indices = [4]i32{ -1, -1, -1, -1 }, .fragment_light_matrices = undefined, }; var fragment_light_shadow_textures: [4](?*const FrameBuffer) = [4](?*const FrameBuffer){ null, null, null, null }; getLightData(self, self.mesh_renderer.?.*.max_vertex_lights, self.mesh_renderer.?.*.max_fragment_lights, &draw_data.light, &draw_data.vertex_light_indices, &draw_data.fragment_light_indices, &draw_data.fragment_light_matrices, &fragment_light_shadow_textures); var i: u32 = 0; while (i < 4) : (i += 1) { if (fragment_light_shadow_textures[i] != null) { fragment_light_shadow_textures[i].?.bindTextureToUnit(2 + i) catch { assert(false); }; } else { wgi.Texture2D.unbind(2 + i); } } try self.mesh_renderer.?.draw(draw_data, allocator); } } }; var active_camera: ?*Object = null; var camera_position = Vector(f32, 3).init([3]f32{ 0, 0, 0 }); // camera direction = transform * (0,0,-1). pub fn setActiveCamera(camera: *Object) void { active_camera = camera; } const PrePassError_ = error{PrePassError}; // First iteration over all objects. // Calculates transformations in world space and gathers and generates light/shadow data ready for rendering // as well as finding the first active camera fn objectsPrePass(o: *Object, allocator: *Allocator, root_object: *Object) void { o.true_transform = null; if (o.light != null and lights_count < MAX_LIGHTS) { var err: bool = false; lights.?.append(o) catch { err = true; }; if (!err) { const l = &o.light.?; l.lum = 0.2126 * o.light.?.colour[0] + 0.7152 * o.light.?.colour[1] + 0.0722 * o.light.?.colour[2]; o.calculateTransform(); l.light_pos = o.true_transform.?.position3D(); var rot = Vector(f32, 4).init( [4]f32{ 0.0, 0.0, -1.0, 0.0 }, ).mulMat(o.true_transform.?); rot.normalise(); if (l.light_type == Light.LightType.Directional) { rot.data[0] = -rot.data[0]; rot.data[1] = -rot.data[1]; rot.data[2] = -rot.data[2]; } l.uniform_array_index = lights_count; var type_ = @enumToInt(l.light_type) * 2 + 1; if (l.cast_realtime_shadows) { type_ += 1; } uniform_data.?.lights[lights_count] = UniformDataLight{ .positionAndType = [4]f32{ l.light_pos.data[0], l.light_pos.data[1], l.light_pos.data[2], @intToFloat(f32, type_) }, .directionAndAngle = [4]f32{ rot.data[0], rot.data[1], rot.data[2], l.angle }, .intensity = [4]f32{ l.colour[0], l.colour[1], l.colour[2], l.attenuation }, }; l.createShadowMap(root_object, &o.true_transform.?, allocator) catch { l.cast_realtime_shadows = false; }; lights_count += 1; } } // depth-first traversal if (o.first_child != null) { objectsPrePass(o.first_child.?, allocator, root_object); } if (o.parent != null and o.next != null and o.next.? != o.parent.?.*.first_child) { objectsPrePass(o.next.?, allocator, root_object); } } // INTERNAL FUNCTION - DO NOT CALL // obj = root pub fn renderObjects(o: *Object, allocator: *Allocator, view_matrix: *const Matrix(f32, 4), projection_matrix: *const Matrix(f32, 4), depth_only: bool) void { o.renderObject(allocator, view_matrix, projection_matrix, depth_only) catch { assert(false); }; // depth-first traversal if (o.first_child != null) { renderObjects(o.first_child.?, allocator, view_matrix, projection_matrix, depth_only); } if (o.parent != null and o.next != null and o.next.? != o.parent.?.*.first_child) { renderObjects(o.next.?, allocator, view_matrix, projection_matrix, depth_only); } } fn loadBlurShader(allocator: *Allocator) !void { blur_shader_vs_src = try loadFileWithNullTerminator("StandardAssets" ++ files.path_seperator ++ "Blur.vs", allocator); blur_shader_fs_src = try loadFileWithNullTerminator("StandardAssets" ++ files.path_seperator ++ "Blur.fs", allocator); var blur_vs: ShaderObject = try ShaderObject.init(([_]([]const u8){blur_shader_vs_src.?})[0..], ShaderType.Vertex, allocator); var blur_fs: ShaderObject = try ShaderObject.init(([_]([]const u8){blur_shader_fs_src.?})[0..], ShaderType.Fragment, allocator); blur_shader_program = try ShaderProgram.init(&blur_vs, &blur_fs, &[0][]const u8{}, allocator); try blur_shader_program.?.setUniform1i(try blur_shader_program.?.getUniformLocation("textureSrc"), 0); } // Allocator is for temporary allocations (printing shader error logs, temporary arrays, etc.) and permenant allocations (shader source files). // ^ Best to use c_alloc // Allocator must remain valid until deinit has been called pub fn init(time: u64, allocator: *Allocator) !void { settings = SettingsStruct{}; this_frame_time = time; try PostProcess.loadSourceFiles(allocator); try loadBlurShader(allocator); try shdr.init(allocator); default_texture = try Tex2D.init(false, MinFilter.Nearest); errdefer default_texture.?.free(); try default_texture.?.upload(1, 1, ImageType.RGBA, &[4]u8{ 0xff, 0xff, 0xff, 0xff }); default_normal_map = try Tex2D.init(false, MinFilter.Nearest); errdefer default_normal_map.?.free(); try default_normal_map.?.upload(1, 1, ImageType.RGBA, &[4]u8{ 0x80, 0x80, 0xff, 0xff }); lights = ArrayList(*Object).init(allocator); uniform_buffer = try Buffer.init(); errdefer uniform_buffer.?.free(); uniform_data = try allocator.create(UniformData); } pub fn deinit(allocator: *Allocator) void { lights.?.deinit(); allocator.destroy(uniform_data); } pub fn render(root_object: *Object, micro_time: u64, allocator: *Allocator) !void { this_frame_time = micro_time; lights_count = 0; lights.?.resize(0) catch unreachable; var window_width: u32 = 0; var window_height: u32 = 0; window.getSize(&window_width, &window_height); if (window_width == 0 or window_height == 0) { // Window is minimised return; } if (active_camera == null) { return; } active_camera.?.calculateTransform(); camera_position = active_camera.?.*.true_transform.?.position3D(); window.setCullMode(window.CullMode.AntiClockwise); objectsPrePass(root_object, allocator, root_object); // Calculate again because the prepass cleared it. active_camera.?.calculateTransform(); wgi.cullFace(wgi.CullFaceMode.Back); // If the window has no depth buffer then post processing must be enabled try PostProcess.startFrame(window_width, window_height, allocator); uniform_data.?.eye_position[0] = camera_position.x(); uniform_data.?.eye_position[1] = camera_position.y(); uniform_data.?.eye_position[2] = camera_position.z(); uniform_data.?.eye_position[3] = 1.0; const projection_matrix = Matrix(f32, 4).perspectiveProjectionOpenGLInverseZ(@intToFloat(f32, window_width) / @intToFloat(f32, window_height), (30.0 / 180.0) * 3.141159265, 0.2, 100.0); var camera_transform_inverse = try active_camera.?.true_transform.?.inverse(); // The camera was orbiting about a point 1 unit in front of it // This hacky solution fixed the issue camera_transform_inverse.data[3][2] += 1.0; // uniform_data.?.lights was initialised in objectsPrePass std.mem.copy(f32, @alignCast(4, uniform_data.?.fog_colour[0..]), &getSettings().fog_colour); try uniform_buffer.?.upload(Buffer.BufferType.Uniform, @intToPtr([*]const u8, @ptrToInt(uniform_data.?))[0..(16 * 2 + @sizeOf(UniformDataLight) * lights_count)], true); try uniform_buffer.?.bind(Buffer.BufferType.Uniform); try uniform_buffer.?.bindUniform(1, 0, uniform_buffer.?.data_size); try uniform_buffer.?.bindBufferBase(1); wgi.setDepthModeDirectX(false, false); wgi.enableDepthWriting(); window.setCullMode(window.CullMode.AntiClockwise); window.setClearColour(getSettings().clear_colour[0], getSettings().clear_colour[1], getSettings().clear_colour[2], 1.0); window.clear(true, true); renderObjects(root_object, allocator, &camera_transform_inverse, &projection_matrix, false); try PostProcess.endFrame(window_width, window_height, brightness, contrast); } pub fn setImageCorrection(brightness_: f32, contrast_: f32) void { brightness = brightness_; contrast = contrast_; } test "All tests" { _ = @import("Mesh.zig"); _ = @import("Shader.zig"); _ = @import("PostProcess.zig"); }
src/RTRenderEngine/RTRenderEngine.zig
const std = @import("std"); const math = std.math; const expect = std.testing.expect; const expectEqual = std.testing.expectEqual; const sdf2 = @import("sdf2.zig"); const affine = @import("affine.zig"); const V2 = affine.V2; const v2 = V2.init; const gmath = @import("gmath.zig").gmath(f64); pub const Circle = struct { pub fn ro(r: f64) Radius { return Radius{ .r = r }; } pub fn rp(r: f64, p: V2) PointRadius { return PointRadius{ .p = p, .r = r }; } pub fn ppp(a: V2, b: V2, c: V2) ThreePoint { return ThreePoint{ .a = a, .b = b, .c = c }; } pub fn ppc(a: V2, b: V2, c: f64) TwoPointCurvature { return TwoPointCurvature{ .a = a, .b = b, .c = c }; } // https://en.wikipedia.org/wiki/Circle#Equations pub const LineIntersection = union(enum) { Intersection: Line.TwoPoints, Tangent: V2, NoIntersection: void, const Self = @This(); pub fn assumeA(self: Self) V2 { return switch (self) { .Intersection => |secantLine| secantLine.a, .Tangent => |p| p, .NoIntersection => V2{}, }; } pub fn assumeB(self: Self) V2 { return switch (self) { .Intersection => |secantLine| secantLine.b, .Tangent => |p| p, .NoIntersection => V2{}, }; } }; pub const Radius = struct { r: f64, const Self = @This(); pub fn contains(self: *const Self, q: V2) bool { return q.lengthSq() <= gmath.sq(self.r); } pub fn signedDist(self: *const Self, q: V2) sdf2.Sd { return sdf2.Sd.init(q.length() - self.r); } }; pub const PointRadius = struct { p: V2, r: f64, const Self = @This(); pub fn contains(self: *const Self, q: V2) bool { return ro(self.r).contains(v2(q.x - self.p.x, q.y - self.p.y)); } pub fn signedDist(self: *const Self, q: V2) sdf2.Sd { return ro(self.r).signedDist(v2(q.x - self.p.x, q.y - self.p.y)); } pub fn x0(self: *const Self) f64 { return self.p.x - self.r; } pub fn x1(self: *const Self) f64 { return self.p.x + self.r; } pub fn y0(self: *const Self) f64 { return self.p.y - self.r; } pub fn y1(self: *const Self) f64 { return self.p.y + self.r; } pub fn top(self: *const Self) V2 { return .{ .x = self.p.x, .y = self.y1(), }; } pub fn bot(self: *const Self) V2 { return .{ .x = self.p.x, .y = self.y0(), }; } pub fn left(self: *const Self) V2 { return .{ .x = self.x0(), .y = self.p.y, }; } pub fn right(self: *const Self) V2 { return .{ .x = self.x1(), .y = self.p.y, }; } pub fn intersect(self: *const Self, other: anytype) IntersectType(@TypeOf(other)) { return switch (@TypeOf(other)) { Line.Vertical => self.intersectLineVertical(other), Line.Horizontal => self.intersectLineHorizontal(other), Line.TwoPoints => self.intersectLineTwoPoints(other), else => @compileError("Unsupported: " ++ @typeName(@TypeOf(other))), }; } pub fn IntersectType(comptime other: type) type { return switch (other) { Line.Vertical => LineIntersection, Line.Horizontal => LineIntersection, Line.TwoPoints => LineIntersection, else => @compileError("Unsupported: " ++ @typeName(other)), }; } pub fn intersectLineVertical(self: *const Self, line: Line.Vertical) LineIntersection { const tangentx0 = self.p.x - self.r; const tangentx1 = self.p.x + self.r; if ((line.x < tangentx0) or (line.x > tangentx1)) { return .NoIntersection; } else if (line.x == tangentx0) { return .{ .Tangent = v2(tangentx0, self.p.y) }; } else if (line.x == tangentx1) { return .{ .Tangent = v2(tangentx1, self.p.y) }; } else { const mid = v2(line.x, self.p.y); const off = v2(0, math.sqrt(self.r * self.r - (line.x - self.p.x) * (line.x - self.p.x))); return .{ .Intersection = .{ .a = mid.sub(off), .b = mid.add(off), }, }; } } pub fn intersectLineHorizontal(self: *const Self, line: Line.Horizontal) LineIntersection { const tangenty0 = self.p.y - self.r; const tangenty1 = self.p.y + self.r; if ((line.y < tangenty0) or (line.y > tangenty1)) { return .NoIntersection; } else if (line.y == tangenty0) { return .{ .Tangent = v2(tangenty0, self.p.x) }; } else if (line.y == tangenty1) { return .{ .Tangent = v2(tangenty1, self.p.x) }; } else { const mid = v2(self.p.x, line.y); const off = v2(math.sqrt(self.r * self.r - (line.y - self.p.y) * (line.y - self.p.y)), 0); return .{ .Intersection = .{ .a = mid.sub(off), .b = mid.add(off), }, }; } } pub fn intersectLineTwoPoints(self: *const Self, line: Line.TwoPoints) LineIntersection { if (line.asVertical()) |line2| { return self.intersectLineVertical(line2); } if (line.asHorizontal()) |line2| { return self.intersectLineHorizontal(line2); } // https://mathworld.wolfram.com/Circle-LineIntersection.html const a = line.a.sub(self.p); const b = line.b.sub(self.p); const d = b.sub(a); const D = a.x * b.y - b.x * a.y; const drdr = d.lengthSq(); const discriminant = self.r * self.r * drdr - D * D; if (discriminant < 0) { return .NoIntersection; } const discriminantSqrt = math.sqrt(discriminant); const mid: V2 = .{ .x = D * d.y, .y = -D * d.x, }; const off: V2 = .{ .x = math.copysign(f64, d.x, d.y) * discriminantSqrt, .y = -math.fabs(d.y) * discriminantSqrt, }; const scale = 1.0 / drdr; return if (discriminant == 0) .{ .Tangent = mid.add(off).scale(scale).add(self.p) } else .{ .Intersection = .{ .a = mid.sub(off).scale(scale).add(self.p), .b = mid.add(off).scale(scale).add(self.p), }, }; } }; pub const ThreePoint = struct { a: V2, b: V2, c: V2, const Self = @This(); pub fn asPointRadius(self: *const Self) PointRadius { const a = self.a; const b = self.b; const c = self.c; const aby = a.y - b.y; const cay = c.y - a.y; const bcy = b.y - c.y; const adot = a.x * a.x + a.y * a.y; const bdot = b.x * b.x + b.y * b.y; const cdot = c.x * c.x + c.y * c.y; const x = adot * bcy + bdot * cay + cdot * aby; const y = adot * (c.x - b.x) + bdot * (a.x - c.x) + cdot * (b.x - a.x); const det = 2 * (a.x * bcy + b.x * cay + c.x * aby); const o = v2(x / det, y / det); return .{ .p = o, .r = math.hypot(f64, a.x - o.x, a.y - o.y) }; } }; pub const TwoPointCurvature = struct { a: V2, b: V2, c: f64, const Self = @This(); pub fn asPointRadius(self: *const Self) PointRadius { // https://stackoverflow.com/questions/36211171/finding-center-of-a-circle-given-two-points-and-radius const a = self.a; const b = self.b; const q = a.distTo(b); const minr = q * 0.5; const r = minr * (self.c + 1); const s = math.sqrt(r * r - minr * minr); const ab = a.mix(b, 0.5); const p = V2{ .x = ab.x - s * (b.y - a.y) / q, .y = ab.y + s * (b.x - a.x) / q, }; return .{ .p = p, .r = r }; } }; }; pub const Annulus = struct { pub fn rro(r0: f64, r1: f64) Radius { return Radius{ .r0 = r0, .r1 = r1 }; } pub fn rrp(r0: f64, r1: f64, p: V2) PointRadius { return PointRadius{ .p = p, .r0 = r0, .r1 = r1 }; } pub const RadiusRadius = struct { r0: f64, r1: f64, const Self = @This(); pub fn contains(self: *const Self, q: V2) bool { const qls = q.lengthSq(); return qls >= gmath.sq(self.r0) and qls <= gmath.sq(self.r1); } pub fn circle0(self: *const Self) Circle.Radius { return .{ .r = self.r0 }; } pub fn circle1(self: *const Self) Circle.Radius { return .{ .r = self.r1 }; } }; pub const PointRadiusRadius = struct { p: V2, r0: f64, r1: f64, const Self = @This(); pub fn contains(self: *const Self, q: V2) bool { return rro(self.r0, self.r1).contains(v2(q.x - self.p.x, q.y - self.p.y)); } pub fn circle0(self: *const Self) Circle.PointRadius { return .{ .r = self.r0, .p = self.p }; } pub fn circle1(self: *const Self) Circle.PointRadius { return .{ .r = self.r1, .p = self.p }; } }; }; pub const Line = struct { pub fn v(x: f64) Vertical { return Vertical{ .x = x }; } pub fn h(y: f64) Horizontal { return Horizontal{ .y = y }; } pub fn pp(a: V2, b: V2) TwoPoints { return TwoPoints{ .a = a, .b = b }; } pub fn po(p: V2, o: V2) PointOffset { return PointOffset{ .p = p, .o = o }; } pub fn pn(p: V2, n: V2) PointNormal { return PointNormal{ .p = p, .n = n }; } pub fn my0(m: f64, y0: f64) SlopeIntercept { return SlopeIntercept{ .m = m, .y0 = y0 }; } pub fn pm(p: V2, m: f64) PointSlope { return PointSlope{ .p = p, .m = m }; } pub fn x0y0(x0: f64, y0: f64) Intercept { return Intercept{ .x0 = x0, .y0 = y0 }; } pub const LineIntersection = union(enum) { Intersection: V2, NoIntersection: void, const Self = @This(); pub fn assume(self: Self) V2 { return switch (self) { .Intersection => |p| p, .NoIntersection => V2{}, }; } }; // https://en.wikipedia.org/wiki/Linear_equation#Equation_of_a_line pub const Vertical = struct { x: f64, const Self = @This(); pub fn signedDist(self: *const Self, q: V2) sdf2.Sd { return self.signedDistLeft(q).edge(); } pub fn signedDistLeft(self: *const Self, q: V2) sdf2.Sd { return sdf2.Sd.init(q.x - self.x); } pub fn signedDistRight(self: *const Self, q: V2) sdf2.Sd { return sdf2.Sd.init(self.x - q.x); } pub fn asTwoPoints(self: *const Self) TwoPoints { return .{ .a = .{ .x = self.x, .y = 0 }, .b = .{ .x = self.x, .y = 1 }, }; } pub fn intersect(self: *const Self, other: anytype) IntersectType(@TypeOf(other)) { return switch (@TypeOf(other)) { Line.Vertical => {}, Line.Horizontal => self.intersectLineHorizontal(other), Line.TwoPoints => self.intersectLineTwoPoints(other), else => @compileError("Unsupported: " ++ @typeName(@TypeOf(other))), }; } pub fn IntersectType(comptime other: type) type { return switch (other) { Line.Vertical => void, Line.Horizontal => V2, Line.TwoPoints => LineIntersection, else => @compileError("Unsupported: " ++ @typeName(other)), }; } pub fn intersectLineHorizontal(self: *const Self, line: Line.Horizontal) V2 { return .{ .x = self.x, .y = line.y }; } pub fn intersectLineTwoPoints(self: *const Self, line: Line.TwoPoints) LineIntersection { if (line.asVertical()) |line2| { return .NoIntersection; } const a = line.a; const b = line.b; return .{ .Intersection = .{ .x = self.x, .y = (b.x * a.y - a.x * b.y - self.x * (a.y - b.y)) / (b.x - a.x), }, }; } }; pub const Horizontal = struct { y: f64, const Self = @This(); pub fn signedDist(self: *const Self, q: V2) sdf2.Sd { return self.signedDistTop(q).edge(); } pub fn signedDistTop(self: *const Self, q: V2) sdf2.Sd { return sdf2.Sd.init(q.y - self.y); } pub fn signedDistBottom(self: *const Self, q: V2) sdf2.Sd { return sdf2.Sd.init(self.y - q.y); } pub fn asTwoPoints(self: *const Self) TwoPoints { return .{ .a = .{ .x = 0, .y = self.y }, .b = .{ .x = 1, .y = self.y }, }; } pub fn intersect(self: *const Self, other: anytype) IntersectType(@TypeOf(other)) { return switch (@TypeOf(other)) { Line.Vertical => self.intersectLineVertical(other), Line.Horizontal => {}, Line.TwoPoints => self.intersectLineTwoPoints(other), else => @compileError("Unsupported: " ++ @typeName(@TypeOf(other))), }; } pub fn IntersectType(comptime other: type) type { return switch (other) { Line.Vertical => V2, Line.Horizontal => void, Line.TwoPoints => LineIntersection, else => @compileError("Unsupported: " ++ @typeName(other)), }; } pub fn intersectLineVertical(self: *const Self, line: Line.Vertical) V2 { return .{ .x = line.x, .y = self.y }; } pub fn intersectLineTwoPoints(self: *const Self, line: Line.TwoPoints) LineIntersection { if (line.asHorizontal()) |line2| { return .NoIntersection; } const a = line.a; const b = line.b; return .{ .Intersection = .{ .x = (b.y * a.x - a.y * b.x - self.y * (a.x - b.x)) / (b.y - a.y), .y = self.y, }, }; } }; pub const TwoPoints = struct { // all points (x, y) where the follwing is true: // x*(a.y - b.y) + y*(b.x - a.x) + (a.x*b.y - b.x*a.y) == 0 // Points must be different, otherwise we are describing a point, not a line. a: V2, b: V2, const Self = @This(); pub fn xxyy(x0: f64, x1: f64, y0: f64, y1: f64) Self { return .{ .a = v2(x0, y0), .b = v2(x1, y1), }; } pub fn xyxy(x0: f64, y0: f64, x1: f64, y1: f64) Self { return .{ .a = v2(x0, y0), .b = v2(x1, y1), }; } pub fn asPointOffset(self: *const Self) PointOffset { return .{ .p = self.a, .o = self.b.sub(self.a), }; } pub fn asPointNormal(self: *const Self) PointNormal { return self.asPointOffset().asPointNormal(); } pub fn asVertical(self: *const Self) ?Vertical { return if (self.a.x == self.b.x) .{ .x = self.a.x } else null; } pub fn asHorizontal(self: *const Self) ?Horizontal { return if (self.a.y == self.b.y) .{ .y = self.a.y } else null; } pub fn intersect(self: *const Self, other: anytype) IntersectType(@TypeOf(other)) { return switch (@TypeOf(other)) { Line.Vertical => other.intersectLineTwoPoints(self.*), Line.Horizontal => other.intersectLineTwoPoints(self.*), Line.TwoPoints => self.intersectLineTwoPoints(other), else => @compileError("Unsupported: " ++ @typeName(@TypeOf(other))), }; } pub fn IntersectType(comptime other: type) type { return switch (other) { Line.Vertical => LineIntersection, Line.Horizontal => LineIntersection, Line.TwoPoints => LineIntersection, else => @compileError("Unsupported: " ++ @typeName(other)), }; } pub fn intersectLineTwoPoints(self: *const Self, line: Line.TwoPoints) LineIntersection { if (self.asVertical()) |line2| { return line2.intersectLineTwoPoints(line); } if (self.asHorizontal()) |line2| { return line2.intersectLineTwoPoints(line); } if (line.asVertical()) |line2| { return line2.intersectLineTwoPoints(self.*); } if (line.asHorizontal()) |line2| { return line2.intersectLineTwoPoints(self.*); } const x1 = self.a.x; const y1 = self.a.y; const x2 = self.b.x; const y2 = self.b.y; const x3 = line.a.x; const y3 = line.a.y; const x4 = line.b.x; const y4 = line.b.y; const t = ((x1 - x3) * (y3 - y4) - (y1 - y3) * (x3 - x4)) / ((x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4)); return .{ .Intersection = .{ .x = x1 + t * (x2 - x1), .y = y1 + t * (y2 - y1), }, }; } pub fn point(self: *const Self, t: f64) V2 { return V2.mix(self.a, self.b, t); } pub fn pointOff(self: *const Self, t: f64, u: f64) V2 { const n = self.b.sub(self.a).rotate90(); return V2.mix(self.a, self.b, t).add(n.scale(u)); } pub fn asQuad(self: *const Self) Quad.TwoPoints { return .{ .a = self.a, .b = self.b, }; } }; pub const PointOffset = struct { p: V2, o: V2, const Self = @This(); pub fn asTwoPoints(self: *const Self) TwoPoints { return .{ .a = self.p, .b = self.p.add(self.o), }; } pub fn asPointNormal(self: *const Self) PointNormal { return .{ .p = self.p, .n = self.o.normalize(), }; } pub fn asVertical(self: *const Self) ?Vertical { return if (self.o.y == 0) return .{ .x = self.p.x } else null; } pub fn asHorizontal(self: *const Self) ?Horizontal { return if (self.o.x == 0) .{ .y = self.p.y } else null; } }; pub const PointNormal = struct { p: V2, n: V2, const Self = @This(); pub fn signedDist(self: *const Self, q: V2) sdf2.Sd { return self.signedDistBefore(q).edge(); } pub fn signedDistBefore(self: *const Self, q: V2) sdf2.Sd { return sdf2.Sd.init(self.n.y * (q.x - self.p.x) - self.n.x * (q.y - self.p.y)); } pub fn signedDistAfter(self: *const Self, q: V2) sdf2.Sd { return sdf2.Sd.init(self.n.x * (q.y - self.p.y) - self.n.y * (q.x - self.p.x)); } pub fn asTwoPoints(self: *const Self) TwoPoints { return .{ .a = self.p, .b = self.p.add(self.n), }; } pub fn asVertical(self: *const Self) ?Vertical { return if (self.n.y == 0) .{ .x = self.p.x } else null; } pub fn asHorizontal(self: *const Self) ?Horizontal { return if (self.n.x == 0) .{ .y = self.p.y } else null; } }; pub const SlopeIntercept = struct { // No vertical lines, infinite slope. m: f64, y0: f64, const Self = @This(); pub fn asPointOffset(self: *const Self) PointOffset { return .{ .p = .{ .x = 0, .y = self.y0 }, .o = .{ .x = 1, .y = self.m }, }; } }; pub const PointSlope = struct { // No vertical lines, infinite slope. p: V2, m: f64, const Self = @This(); pub fn asPointOffset(self: *const Self) PointOffset { return .{ .p = self.p, .o = .{ .x = 1, .y = self.m }, }; } }; pub const Intercept = struct { // No horizontal or vertical lines. x0: f64, // must not be zero. y0: f64, // must not be zero. const Self = @This(); pub fn asTwoPoints(self: *const Self) TwoPoints { return .{ .a = .{ .x = self.x0, .y = 0 }, .b = .{ .x = 0, .y = self.y0 }, }; } }; }; pub const Quad = struct { pub fn pppp(a: V2, b: V2, c: V2, d: V2) FourPoints { return FourPoints{ .a = a, .b = b, .c = c, .d = d }; } pub fn ll(t: Line.TwoPoints, u: Line.TwoPoints) TwoLines { return .{ .t = t, .u = u }; } pub fn ps(p: V2, s: V2) PointSize { return .{ .p = p, .s = s }; } pub fn pp(a: V2, b: V2) TwoPoints { return TwoPoints{ .a = a, .b = b }; } pub const xxyy = TwoPoints.xxyy; pub const xyxy = TwoPoints.xyxy; pub const FourPoints = struct { a: V2, b: V2, c: V2, d: V2, const Self = @This(); pub fn asTwoLines(self: *const Self) TwoLines { return .{ .t = .{ .a = self.a, .b = self.b }, .u = .{ .a = self.d, .b = self.c }, }; } pub fn asPointSize(self: *const Self) ?PointSize { return if (self.a.x == self.c.x and self.a.y == self.b.y and self.b.x == self.d.x and self.c.y == self.d.y) PointSize{ .p = self.a, .s = v2(self.b.x - self.a.x, self.c.y - self.a.y), } else null; } pub fn point(self: *const Self, p: V2) V2 { return self.a.mix(self.b, p.x).mix(self.c.mix(self.d, p.x), p.y); } pub fn mix(self: Self, other: Self, x: f64) Self { return .{ .a = self.a.mix(other.a, x), .b = self.b.mix(other.b, x), .c = self.c.mix(other.c, x), .d = self.d.mix(other.d, x), }; } }; pub const TwoLines = struct { t: Line.TwoPoints, u: Line.TwoPoints, const Self = @This(); pub fn asFourPoints(self: *const Self) FourPoints { return .{ .a = self.t.a, .b = self.t.b, .c = self.u.b, .d = self.u.a, }; } pub fn line(self: *const Self, x: f64) Line.TwoPoints { return .{ .a = self.t.point(x), .b = self.u.point(x), }; } pub fn quad(self: *const Self, x0: f64, x1: f64) Self { return .{ .t = self.line(x0), .u = self.line(x1) }; } pub fn flip(self: *const Self) Self { return .{ .t = .{ .a = self.t.a, .b = self.u.a }, .u = .{ .a = self.t.b, .b = self.u.b }, }; } }; pub const PointSize = struct { p: V2, s: V2, const Self = @This(); const unit = Self{ .p = V2{ .x = 0, .y = 0 }, .s = V2{ .x = 1, .y = 1 } }; pub fn asFourPoints(self: *const Self) FourPoints { return .{ .a = self.p, .b = v2(self.p.x + self.s.x, self.p.y), .c = v2(self.p.x, self.p.y + self.s.y), .d = v2(self.p.x + self.s.x, self.p.y + self.s.y), }; } pub fn asTwoPoints(self: *const Self) TwoPoints { return .{ .a = self.p, .b = v2(self.p.x + self.s.x, self.p.y + self.s.y), }; } }; pub const TwoPoints = struct { a: V2, b: V2, const Self = @This(); const unit = Self{ .a = V2{ .x = 0, .y = 0 }, .b = V2{ .x = 1, .y = 1 } }; pub fn xxyy(x0: f64, x1: f64, y0: f64, y1: f64) Self { return .{ .a = v2(x0, y0), .b = v2(x1, y1), }; } pub fn xyxy(x0: f64, y0: f64, x1: f64, y1: f64) Self { return .{ .a = v2(x0, y0), .b = v2(x1, y1), }; } pub fn asPointSize(self: *const Self) PointSize { return .{ .p = self.a, .s = v2(self.b.x - self.a.x, self.b.y - self.a.y), }; } pub fn asFourPoints(self: *const Self) FourPoints { return .{ .a = self.a, .b = v2(self.b.x, self.a.y), .c = v2(self.a.x, self.b.y), .d = self.b, }; } pub fn contains(self: *const Self, q: V2) bool { return q.x >= self.a.x and q.x <= self.b.x and q.y >= self.a.y and q.y <= self.b.y; } pub fn asLine(self: *const Self) Line.TwoPoints { return .{ .a = self.a, .b = self.b, }; } pub fn h(self: *const Self, t: f64) Line.Horizontal { return .{ .y = gmath.mix(self.a.y, self.b.y, t) }; } pub fn v(self: *const Self, t: f64) Line.Vertical { return .{ .x = gmath.mix(self.a.x, self.b.x, t) }; } pub fn hTop(self: *const Self) Line.Horizontal { return .{ .y = self.a.y }; } pub fn hBottom(self: *const Self) Line.Horizontal { return .{ .y = self.b.y }; } pub fn vLeft(self: *const Self) Line.Vertical { return .{ .x = self.a.x }; } pub fn vRight(self: *const Self) Line.Vertical { return .{ .x = self.b.x }; } pub fn ppTop(self: *const Self) Line.TwoPoints { return .{ .a = v2(self.a.x, self.a.y), .b = v2(self.b.x, self.a.y), }; } pub fn ppBottom(self: *const Self) Line.TwoPoints { return .{ .a = v2(self.a.x, self.b.y), .b = v2(self.b.x, self.b.y), }; } pub fn ppLeft(self: *const Self) Line.TwoPoints { return .{ .a = v2(self.a.x, self.a.y), .b = v2(self.a.x, self.b.y), }; } pub fn ppRight(self: *const Self) Line.TwoPoints { return .{ .a = v2(self.b.x, self.a.y), .b = v2(self.b.x, self.b.y), }; } pub fn bottomLine(self: *const Self) Line.TwoPoints { return .{ .a = v2(self.a.x, self.b.y), .b = v2(self.b.x, self.b.y), }; } pub fn quad(self: *const Self, q: Self) Self { return .{ .a = v2(gmath.mix(self.a.x, self.b.x, q.a.x), gmath.mix(self.a.y, self.b.y, q.a.y)), .b = v2(gmath.mix(self.a.x, self.b.x, q.b.x), gmath.mix(self.a.y, self.b.y, q.b.y)), }; } pub fn point(self: *const Self, p: V2) V2 { return .{ .x = gmath.mix(self.a.x, self.b.x, p.x), .y = gmath.mix(self.a.y, self.b.y, p.y), }; } pub fn split(self: *const Self, other: anytype) SplitType(@TypeOf(other)) { return switch (@TypeOf(other)) { Line.Vertical => .{ .a = Self.xxyy(self.a.x, other.x, self.a.y, self.b.y), .b = Self.xxyy(other.x, self.b.x, self.a.y, self.b.y), }, Line.Horizontal => .{ .a = Self.xxyy(self.a.x, self.b.x, self.a.y, other.y), .b = Self.xxyy(self.a.x, self.b.x, other.y, self.b.y), }, //Line.TwoPoints => LineIntersection, else => @compileError("Unsupported: " ++ @typeName(other)), }; } pub fn splitTopBot(self: *const Self, t: f64) Split(Self, Self) { const y = gmath.mix(self.a.y, self.b.y, t); return .{ .a = .{ .a = self.a, .b = v2(self.b.x, y), }, .b = .{ .a = v2(self.a.x, y), .b = self.b, }, }; } pub fn splitLeftRight(self: *const Self, t: f64) Split(Self, Self) { const x = gmath.mix(self.a.x, self.b.x, t); return .{ .a = .{ .a = self.a, .b = v2(x, self.b.y), }, .b = .{ .a = v2(x, self.a.y), .b = self.b, }, }; } pub fn SplitType(comptime other: type) type { return switch (other) { Line.Vertical => Split(Self, Self), Line.Horizontal => Split(Self, Self), //Line.TwoPoints => LineIntersection, else => @compileError("Unsupported: " ++ @typeName(other)), }; } pub fn asCenterOffset(self: *const Self) CenterOffset { const center = self.a.mix(self.b, 0.5); return .{ .c = center, .o = self.b.sub(center).abs(), }; } }; pub const CenterOffset = struct { c: V2, o: V2, // invariants: must be positive and non-zero for both x and y. const Self = @This(); pub fn signedDist(self: *const Self, q: V2) sdf2.Sd { const d = q.sub(self.c).abs().sub(self.o); const dist = d.max(0).length() + math.min(math.max(d.x, d.y), 0); return sdf2.Sd.init(dist); } pub fn asTwoPoints(self: *const Self) TwoPoints { return .{ .a = self.c.sub(self.o), .b = self.c.add(self.o), }; } }; }; pub fn Split(comptime A: type, comptime B: type) type { return struct { a: A, b: B }; } test "Vertical asTwoPoints" { const v = Line.Vertical{ .x = 2 }; expectEqual( Line.TwoPoints{ .a = .{ .x = 2, .y = 0 }, .b = .{ .x = 2, .y = 1 } }, v.asTwoPoints(), ); } test "Horizontal asTwoPoints" { const h = Line.Horizontal{ .y = 2 }; expectEqual( Line.TwoPoints{ .a = .{ .x = 0, .y = 2 }, .b = .{ .x = 1, .y = 2 } }, h.asTwoPoints(), ); } test "SlopeIntercept asPointOffset" { const si: Line.SlopeIntercept = .{ .m = 2, .y0 = 3 }; expectEqual( Line.PointOffset{ .p = .{ .x = 0, .y = 3 }, .o = .{ .x = 1, .y = 2 } }, si.asPointOffset(), ); } test "PointSlope asPointOffset" { const si: Line.PointSlope = .{ .p = .{ .x = 2, .y = 3 }, .m = 4 }; expectEqual( Line.PointOffset{ .p = .{ .x = 2, .y = 3 }, .o = .{ .x = 1, .y = 4 } }, si.asPointOffset(), ); } test "intercept asTwoPoints" { const si: Line.Intercept = .{ .x0 = 2, .y0 = 3 }; expectEqual( Line.TwoPoints{ .a = .{ .x = 2, .y = 0 }, .b = .{ .x = 0, .y = 3 } }, si.asTwoPoints(), ); } test "intersect Vertical/Horizontal" { const v: Line.Vertical = .{ .x = 2 }; const h: Line.Horizontal = .{ .y = 3 }; expectEqual( V2{ .x = 2, .y = 3 }, v.intersect(h), ); expectEqual( V2{ .x = 2, .y = 3 }, h.intersect(v), ); } test "intersect Vertical/TwoPoints horizontal" { const v: Line.Vertical = .{ .x = 2 }; const tp: Line.TwoPoints = .{ .a = .{ .x = 0, .y = 3 }, .b = .{ .x = 1, .y = 3 } }; expectEqual( Line.LineIntersection{ .Intersection = V2{ .x = 2, .y = 3 } }, v.intersect(tp), ); expectEqual( Line.LineIntersection{ .Intersection = V2{ .x = 2, .y = 3 } }, tp.intersect(v), ); } test "intersect Vertical/TwoPoints vertical" { const v: Line.Vertical = .{ .x = 2 }; const tp: Line.TwoPoints = .{ .a = .{ .x = 3, .y = 0 }, .b = .{ .x = 3, .y = 1 } }; expectEqual( Line.LineIntersection.NoIntersection, v.intersect(tp), ); expectEqual( Line.LineIntersection.NoIntersection, tp.intersect(v), ); } test "intersect Vertical/TwoPoints" { const v: Line.Vertical = .{ .x = 2 }; const tp: Line.TwoPoints = .{ .a = .{ .x = 1, .y = 0 }, .b = .{ .x = 3, .y = 1 } }; expectEqual( Line.LineIntersection{ .Intersection = V2{ .x = 2, .y = 0.5 } }, v.intersect(tp), ); expectEqual( Line.LineIntersection{ .Intersection = V2{ .x = 2, .y = 0.5 } }, tp.intersect(v), ); } test "intersect Horizontal/TwoPoints horizontal" { const h: Line.Horizontal = .{ .y = 2 }; const tp: Line.TwoPoints = .{ .a = .{ .x = 3, .y = 0 }, .b = .{ .x = 3, .y = 1 } }; expectEqual( Line.LineIntersection{ .Intersection = V2{ .x = 3, .y = 2 } }, h.intersect(tp), ); expectEqual( Line.LineIntersection{ .Intersection = V2{ .x = 3, .y = 2 } }, tp.intersect(h), ); } test "intersect Horizontal/TwoPoints vertical" { const h: Line.Horizontal = .{ .y = 2 }; const tp: Line.TwoPoints = .{ .a = .{ .x = 0, .y = 3 }, .b = .{ .x = 1, .y = 3 } }; expectEqual( Line.LineIntersection.NoIntersection, h.intersect(tp), ); expectEqual( Line.LineIntersection.NoIntersection, tp.intersect(h), ); } test "intersect Horizontal/TwoPoints" { const h: Line.Horizontal = .{ .y = 2 }; const tp: Line.TwoPoints = .{ .a = .{ .x = 0, .y = 1 }, .b = .{ .x = 1, .y = 3 } }; expectEqual( Line.LineIntersection{ .Intersection = V2{ .x = 0.5, .y = 2 } }, h.intersect(tp), ); expectEqual( Line.LineIntersection{ .Intersection = V2{ .x = 0.5, .y = 2 } }, tp.intersect(h), ); } test "intersect TwoPoints vertical/TwoPoints horizontal" { const h: Line.TwoPoints = (Line.Horizontal{ .y = 2 }).asTwoPoints(); const v: Line.TwoPoints = (Line.Vertical{ .x = 3 }).asTwoPoints(); expectEqual( Line.LineIntersection{ .Intersection = V2{ .x = 3, .y = 2 } }, h.intersect(v), ); expectEqual( Line.LineIntersection{ .Intersection = V2{ .x = 3, .y = 2 } }, v.intersect(h), ); } test "intersect TwoPoints/TwoPoints horizontal" { const h: Line.TwoPoints = (Line.Horizontal{ .y = 2 }).asTwoPoints(); const tp: Line.TwoPoints = .{ .a = .{ .x = 0, .y = 1 }, .b = .{ .x = 1, .y = 3 } }; expectEqual( Line.LineIntersection{ .Intersection = V2{ .x = 0.5, .y = 2 } }, h.intersect(tp), ); expectEqual( Line.LineIntersection{ .Intersection = V2{ .x = 0.5, .y = 2 } }, tp.intersect(h), ); } test "intersect TwoPoints/TwoPoints horizontal" { const v: Line.TwoPoints = (Line.Vertical{ .x = 2 }).asTwoPoints(); const tp: Line.TwoPoints = .{ .a = .{ .x = 1, .y = 0 }, .b = .{ .x = 3, .y = 1 } }; expectEqual( Line.LineIntersection{ .Intersection = V2{ .x = 2, .y = 0.5 } }, v.intersect(tp), ); expectEqual( Line.LineIntersection{ .Intersection = V2{ .x = 2, .y = 0.5 } }, tp.intersect(v), ); } test "intersect TwoPoints/TwoPoints" { const target = V2{ .x = 2, .y = 3 }; const tp0 = (Line.PointOffset{ .p = target, .o = .{ .x = 1, .y = 2 } }).asTwoPoints(); const tp1 = (Line.PointOffset{ .p = target, .o = .{ .x = 3, .y = 4 } }).asTwoPoints(); expectEqual( Line.LineIntersection{ .Intersection = target }, tp0.intersect(tp1), ); expectEqual( Line.LineIntersection{ .Intersection = target }, tp1.intersect(tp0), ); } test "Line.LineIntersection assume" { const target = V2{ .x = 2, .y = 3 }; expectEqual( V2{ .x = 0, .y = 0 }, (Line.LineIntersection.NoIntersection).assume(), ); expectEqual( target, (Line.LineIntersection{ .Intersection = target }).assume(), ); } test "Circle.LineIntersection assumeA" { const target = V2{ .x = 2, .y = 3 }; expectEqual( V2{ .x = 0, .y = 0 }, (Circle.LineIntersection.NoIntersection).assumeA(), ); expectEqual( target, (Circle.LineIntersection{ .Tangent = target }).assumeA(), ); expectEqual( target, (Circle.LineIntersection{ .Intersection = .{ .a = target, .b = V2{} } }).assumeA(), ); } test "Circle.LineIntersection assumeB" { const target = V2{ .x = 2, .y = 3 }; expectEqual( V2{ .x = 0, .y = 0 }, (Circle.LineIntersection.NoIntersection).assumeB(), ); expectEqual( target, (Circle.LineIntersection{ .Tangent = target }).assumeB(), ); expectEqual( target, (Circle.LineIntersection{ .Intersection = .{ .a = V2{}, .b = target } }).assumeB(), ); } test "invariant: PointOffset asTwoPoints asPointOffset" { const target = Line.PointOffset{ .p = V2{ .x = 2, .y = 3 }, .o = V2{ .x = 4, .y = 5 } }; expectEqual( target, target.asTwoPoints().asPointOffset(), ); } test "invariant: TwoPoints asPointOffset asTwoPoints" { const target = Line.TwoPoints{ .a = V2{ .x = 2, .y = 3 }, .b = V2{ .x = 4, .y = 5 } }; expectEqual( target, target.asPointOffset().asTwoPoints(), ); } test "invariant: Vertical asTwoPoints asVertical" { const target = Line.Vertical{ .x = 2 }; expectEqual( target, target.asTwoPoints().asVertical() orelse Line.Vertical{ .x = 0 }, ); } test "invariant: Horizontal asTwoPoints asHorizontal" { const target = Line.Horizontal{ .y = 2 }; expectEqual( target, target.asTwoPoints().asHorizontal() orelse Line.Horizontal{ .y = 0 }, ); } test "invariant: FourPoints asTwoLines asFourPoints" { const target = Quad.FourPoints{ .a = V2{ .x = 1, .y = 2 }, .b = V2{ .x = 3, .y = 4 }, .c = V2{ .x = 5, .y = 6 }, .d = V2{ .x = 7, .y = 8 } }; expectEqual( target, target.asTwoLines().asFourPoints(), ); } test "invariant: TwoLines asFourPoints asTwoLines" { const target = Quad.TwoLines{ .t = .{ .a = V2{ .x = 1, .y = 2 }, .b = V2{ .x = 3, .y = 4 } }, .u = .{ .a = V2{ .x = 5, .y = 6 }, .b = V2{ .x = 7, .y = 8 } } }; expectEqual( target, target.asFourPoints().asTwoLines(), ); } test "invariant: TwoLines flip flip" { const target = Quad.TwoLines{ .t = .{ .a = V2{ .x = 1, .y = 2 }, .b = V2{ .x = 3, .y = 4 } }, .u = .{ .a = V2{ .x = 5, .y = 6 }, .b = V2{ .x = 7, .y = 8 } } }; expectEqual( target, target.flip().flip(), ); } test "invariant: TwoLines flip quad(0, 1)" { const target = Quad.TwoLines{ .t = .{ .a = V2{ .x = 1, .y = 2 }, .b = V2{ .x = 3, .y = 4 } }, .u = .{ .a = V2{ .x = 5, .y = 6 }, .b = V2{ .x = 7, .y = 8 } } }; expectEqual( target, target.flip().quad(0, 1), ); expectEqual( target, target.quad(0, 1).flip(), ); expectEqual( target, target.quad(1, 0).flip().quad(1, 0).flip(), ); } test "invariant: PointSize asFourPoints asPointSize" { const target = Quad.PointSize{ .p = V2{ .x = 1, .y = 2 }, .s = V2{ .x = 3, .y = 4 } }; expectEqual( target, target.asFourPoints().asPointSize().?, ); } test "invariant: PointSize asTwoPoints asPointSize" { const target = Quad.PointSize{ .p = V2{ .x = 1, .y = 2 }, .s = V2{ .x = 3, .y = 4 } }; expectEqual( target, target.asTwoPoints().asPointSize(), ); } test "invariant: Quad.TwoPoints asLine asQuad" { const target = Quad.TwoPoints{ .a = V2{ .x = 1, .y = 2 }, .b = V2{ .x = 3, .y = 5 } }; expectEqual( target, target.asLine().asQuad(), ); } test "invariant: Line.TwoPoints asQuad asLine" { const target = Line.TwoPoints{ .a = V2{ .x = 1, .y = 2 }, .b = V2{ .x = 3, .y = 5 } }; expectEqual( target, target.asQuad().asLine(), ); } test "invariant: Quad.TwoPoints inner unit" { const target = Quad.TwoPoints{ .a = V2{ .x = 1, .y = 2 }, .b = V2{ .x = 3, .y = 5 } }; expectEqual( target, target.inner(Quad.TwoPoints.unit), ); } test "invariant: Line.TwoPoints.xxyy == Line.TwoPoints.xyxy" { const x0 = 1; const y0 = 2; const x1 = 2; const y1 = 3; expectEqual( Line.TwoPoints.xxyy(x0, x1, y0, y1), Line.TwoPoints.xyxy(x0, y0, x1, y1), ); } test "invariant: Quad.TwoPoints.xxyy == Quad.TwoPoints.xyxy" { const x0 = 1; const y0 = 2; const x1 = 2; const y1 = 3; expectEqual( Quad.TwoPoints.xxyy(x0, x1, y0, y1), Quad.TwoPoints.xyxy(x0, y0, x1, y1), ); }
lib/geom.zig
const systemd = @import("drm/systemd.zig"); const Logind = @import("drm/systemd.zig").Logind; const inputs = @import("drm/input.zig"); const Input = @import("drm/input.zig").Input; const DRM = @import("drm/drm.zig").DRM; const GBM = @import("drm/gbm.zig").GBM; const EGL = @import("drm/egl.zig").EGL; pub const DRMBackend = struct { systemd: Logind, input: Input, const Self = @This(); pub fn init(self: *Self) !void { try self.input.addToEpoll(); inputs.global_logind = &self.systemd; } pub fn newOutput(self: *Self) !DRMOutput { var drm = try DRM.init(); // try drm.addToEpoll(); var gbm = try GBM.init(&drm); var egl = try EGL.init(&gbm); return DRMOutput { .backend = self, .drm = drm, .gbm = gbm, .egl = egl, }; } pub fn deinit(self: *Self) void { self.systemd.deinit(); self.input.deinit(); } }; pub fn new() !DRMBackend { var sysd = try systemd.create(); try sysd.init(); var input = try Input.create(&sysd); // try input.addToEpoll(); return DRMBackend { .systemd = sysd, .input = input, }; } pub const DRMOutput = struct { backend: *DRMBackend, drm: DRM, gbm: GBM, egl: EGL, const Self = @This(); pub fn addToEpoll(self: *Self) !void { try self.drm.addToEpoll(); } pub fn begin(self: Self) void { } pub fn end(self: Self) void { } pub fn isPageFlipScheduled(self: Self) bool { return DRM.isPageFlipScheduled(); } pub fn swap(self: *Self) !void { if (DRM.isPageFlipScheduled()) { return; } self.egl.swapBuffers(); var new_bo = self.gbm.surfaceLockFrontBuffer(); if (new_bo == null) { return error.SurfaceLockFrontBufferFailed; } var handle = GBM.boGetHandle(new_bo.?); var pitch = GBM.boGetStride(new_bo.?); var fb: u32 = 0; _ = self.drm.modeAddFb(24, 32, pitch, handle.u32, &fb); _ = self.drm.modePageFlip(fb); DRM.schedulePageFlip(); if (self.gbm.bo) |bo| { _ = try self.drm.modeRmFb(); self.gbm.surfaceReleaseBuffer(); } self.gbm.bo = new_bo.?; self.drm.fb = fb; } pub fn getWidth(self: Self) i32 { return self.drm.modeWidth(); } pub fn getHeight(self: Self) i32 { return self.drm.modeHeight(); } pub fn shouldClose(self: Self) bool { return false; } pub fn deinit(self: *Self) void { self.egl.deinit(); } };
src/backend/drm.zig
const std = @import("std"); const build_options = @import("build_options"); const stdx = @import("stdx"); const t = stdx.testing; const math = stdx.math; const Mat4 = math.Mat4; const sdl = @import("sdl"); const gl = @import("gl"); const vk = @import("vk"); const builtin = @import("builtin"); const Backend = build_options.GraphicsBackend; const window = @import("window.zig"); const Config = window.Config; const Mode = window.Mode; const log = stdx.log.scoped(.window_gl); const IsWebGL2 = builtin.target.isWasm(); extern "graphics" fn jsSetCanvasBuffer(width: u32, height: u32) u8; const IsDesktop = !IsWebGL2; pub const Window = struct { id: u32, sdl_window: *sdl.SDL_Window, // Since other windows can use the same context, we defer deinit until the last window. alloc: std.mem.Allocator, inner: switch (Backend) { .OpenGL => struct { gl_ctx_ref_count: *u32, gl_ctx: *anyopaque, }, .Vulkan => struct { instance: vk.VkInstance, physical_device: vk.VkPhysicalDevice, device: vk.VkDevice, surface: vk.VkSurfaceKHR, queue_family: VkQueueFamilyPair, }, else => @compileError("unsupported"), }, width: u32, height: u32, // When creating a window with high dpi, the buffer size can differ from // the logical window size. (Usually a multiple, eg. 2x) buf_width: u32, buf_height: u32, // Depth pixel ratio. Buffer size / logical window size. dpr: u8, // Initialize to the default gl framebuffer. // If we are doing MSAA, then we'll need to set this to the multisample framebuffer. fbo_id: gl.GLuint = 0, msaa: ?MsaaFrameBuffer = null, const Self = @This(); pub fn init(alloc: std.mem.Allocator, config: Config) !Self { if (IsDesktop) { try sdl.ensureVideoInit(); } var res = Window{ .id = undefined, .sdl_window = undefined, .alloc = alloc, .inner = undefined, .width = undefined, .height = undefined, .buf_width = undefined, .buf_height = undefined, .dpr = undefined, }; if (IsDesktop) { const flags = getSdlWindowFlags(config); switch (Backend) { .OpenGL => { try initGL_Window(alloc, &res, config, flags); try initGL_Context(&res); }, .Vulkan => { try initVulkanWindow(alloc, &res, config, flags); }, else => stdx.unsupported(), } } else if (IsWebGL2) { const dpr = jsSetCanvasBuffer(config.width, config.height); res.width = @intCast(u32, config.width); res.height = @intCast(u32, config.height); res.buf_width = dpr * res.width; res.buf_height = dpr * res.height; res.dpr = dpr; } // Initialize graphics. switch (Backend) { .OpenGL => { res.inner.gl_ctx_ref_count = alloc.create(u32) catch unreachable; res.inner.gl_ctx_ref_count.* = 1; if (config.anti_alias) { if (createMsaaFrameBuffer(res.buf_width, res.buf_height, res.dpr)) |msaa| { res.fbo_id = msaa.fbo; res.msaa = msaa; } } }, else => {}, } return res; } /// Currently, we share a GL context by simply reusing the same handle. /// There is a different concept of sharing a context supported by GL in which textures and internal data are shared /// and a new GL context is created to operate on that. SDL can do this with SDL_GL_SHARE_WITH_CURRENT_CONTEXT = 1. /// However, it could involve reorganizing how Graphics does rendering because not everything is shared. /// There doesn't seem to be a good reason to use GL's shared context so prefer the simpler method and don't create a new context here. pub fn initWithSharedContext(alloc: std.mem.Allocator, config: Config, existing_win: Self) !Self { try sdl.ensureVideoInit(); var res = Window{ .id = undefined, .sdl_window = undefined, .alloc = alloc, .gl_ctx_ref_count = undefined, .gl_ctx = undefined, .width = undefined, .height = undefined, .buf_width = undefined, .buf_height = undefined, .dpr = undefined, }; const flags = getSdlWindowFlags(config); switch (Backend) { .OpenGL => try initGL_Window(alloc, &res, config, flags), else => stdx.unsupported(), } // Reuse existing window's GL context. res.gl_ctx = existing_win.gl_ctx; res.alloc = existing_win.alloc; res.gl_ctx_ref_count = existing_win.gl_ctx_ref_count; res.gl_ctx_ref_count.* += 1; res.graphics = existing_win.graphics; if (config.anti_alias) { if (createMsaaFrameBuffer(res.buf_width, res.buf_height, res.dpr)) |msaa| { res.fbo_id = msaa.fbo; res.msaa = msaa; } } return res; } pub fn deinit(self: Self) void { switch (Backend) { .OpenGL => { if (self.inner.gl_ctx_ref_count.* == 1) { if (IsDesktop) { sdl.SDL_GL_DeleteContext(self.inner.gl_ctx); } self.alloc.destroy(self.inner.gl_ctx_ref_count); } else { self.inner.gl_ctx_ref_count.* -= 1; } }, .Vulkan => { vk.destroyDevice(self.inner.device, null); vk.destroySurfaceKHR(self.inner.instance, self.inner.surface, null); vk.destroyInstance(self.inner.instance, null); }, else => stdx.panicUnsupported(), } if (IsDesktop) { // Destroy window after destroying graphics context. sdl.SDL_DestroyWindow(self.sdl_window); } } pub fn handleResize(self: *Self, width: u32, height: u32) void { self.width = width; self.height = height; if (IsDesktop) { var buf_width: c_int = undefined; var buf_height: c_int = undefined; sdl.SDL_GL_GetDrawableSize(self.sdl_window, &buf_width, &buf_height); self.buf_width = @intCast(u32, buf_width); self.buf_height = @intCast(u32, buf_height); } else { self.buf_width = self.dpr * self.width; self.buf_height = self.dpr * self.height; } // The default frame buffer already resizes to the window. // The msaa texture was created separately, so it needs to update. if (self.msaa) |msaa| { resizeMsaaFrameBuffer(msaa, self.buf_width, self.buf_height); } } pub fn resize(self: *Self, width: u32, height: u32) void { if (IsDesktop) { sdl.SDL_SetWindowSize(self.sdl_window, @intCast(c_int, width), @intCast(c_int, height)); var cur_width: c_int = undefined; var cur_height: c_int = undefined; sdl.SDL_GetWindowSize(self.sdl_window, &cur_width, &cur_height); self.width = @intCast(u32, cur_width); self.height = @intCast(u32, cur_height); var buf_width: c_int = undefined; var buf_height: c_int = undefined; sdl.SDL_GL_GetDrawableSize(self.sdl_window, &buf_width, &buf_height); self.buf_width = @intCast(u32, buf_width); self.buf_height = @intCast(u32, buf_height); } else { _ = jsSetCanvasBuffer(width, height); self.width = width; self.height = height; self.buf_width = width * self.dpr; self.buf_height = height * self.dpr; } if (self.msaa) |msaa| { resizeMsaaFrameBuffer(msaa, self.buf_width, self.buf_height); } } pub fn minimize(self: Self) void { sdl.SDL_MinimizeWindow(self.sdl_window); } pub fn maximize(self: Self) void { sdl.SDL_MaximizeWindow(self.sdl_window); } pub fn restore(self: Self) void { sdl.SDL_RestoreWindow(self.sdl_window); } pub fn setMode(self: Self, mode: Mode) void { switch (mode) { .Windowed => _ = sdl.SDL_SetWindowFullscreen(self.sdl_window, 0), .PseudoFullscreen => _ = sdl.SDL_SetWindowFullscreen(self.sdl_window, sdl.SDL_WINDOW_FULLSCREEN_DESKTOP), .Fullscreen => _ = sdl.SDL_SetWindowFullscreen(self.sdl_window, sdl.SDL_WINDOW_FULLSCREEN), } } pub fn setPosition(self: Self, x: i32, y: i32) void { sdl.SDL_SetWindowPosition(self.sdl_window, x, y); } pub fn center(self: Self) void { sdl.SDL_SetWindowPosition(self.sdl_window, sdl.SDL_WINDOWPOS_CENTERED, sdl.SDL_WINDOWPOS_CENTERED); } pub fn focus(self: Self) void { sdl.SDL_RaiseWindow(self.sdl_window); } pub fn makeCurrent(self: Self) void { _ = sdl.SDL_GL_MakeCurrent(self.sdl_window, self.gl_ctx); } pub fn setTitle(self: Self, title: []const u8) void { const cstr = std.cstr.addNullByte(self.alloc, title) catch unreachable; defer self.alloc.free(cstr); sdl.SDL_SetWindowTitle(self.sdl_window, cstr); } pub fn getTitle(self: Self, alloc: std.mem.Allocator) []const u8 { const cstr = sdl.SDL_GetWindowTitle(self.sdl_window); return alloc.dupe(u8, std.mem.span(cstr)) catch unreachable; } }; pub fn disableVSync() !void { if (sdl.SDL_GL_SetSwapInterval(0) != 0) { log.warn("unable to turn off vsync: {s}", .{sdl.SDL_GetError()}); return error.Failed; } } fn glSetAttr(attr: sdl.SDL_GLattr, val: c_int) !void { if (sdl.SDL_GL_SetAttribute(attr, val) != 0) { log.warn("sdl set attribute: {s}", .{sdl.SDL_GetError()}); return error.Failed; } } fn initVulkanWindow(alloc: std.mem.Allocator, win: *Window, config: Config, flags: c_int) !void { var window_flags = flags | sdl.SDL_WINDOW_VULKAN; win.sdl_window = sdl.createWindow(alloc, config.title, sdl.SDL_WINDOWPOS_UNDEFINED, sdl.SDL_WINDOWPOS_UNDEFINED, @intCast(c_int, config.width), @intCast(c_int, config.height), @bitCast(u32, window_flags)) orelse { log.err("Unable to create window: {s}", .{sdl.SDL_GetError()}); return error.Failed; }; if (builtin.os.tag == .macos) { vk.initMacVkInstanceFuncs(); } if (vk_enable_validation_layers and !vkCheckValidationLayerSupport(alloc)) { stdx.panic("validation layers requested, but not available."); } // SDL will query platform specific extensions. var count: c_uint = undefined; if (sdl.SDL_Vulkan_GetInstanceExtensions(win.sdl_window, &count, null) == 0) { log.err("SDL_Vulkan_GetInstanceExtensions: {s}", .{sdl.SDL_GetError()}); return error.Failed; } var enabled_extensions = std.ArrayList([*:0]const u8).init(alloc); defer enabled_extensions.deinit(); const extensions = alloc.alloc([*:0]const u8, count) catch @panic("error"); defer alloc.free(extensions); if (sdl.SDL_Vulkan_GetInstanceExtensions(win.sdl_window, &count, @ptrCast([*c][*c]const u8, extensions.ptr)) == 0) { log.err("SDL_Vulkan_GetInstanceExtensions: {s}", .{sdl.SDL_GetError()}); return error.Failed; } enabled_extensions.appendSlice(extensions) catch stdx.fatal(); if (builtin.os.tag == .macos) { // Macos needs VK_KHR_get_physical_device_properties2 for device extension: VK_KHR_portability_subset. enabled_extensions.append("VK_KHR_get_physical_device_properties2") catch stdx.fatal(); } var instance: vk.VkInstance = undefined; // Create instance. const app_info = vk.VkApplicationInfo{ .sType = vk.VK_STRUCTURE_TYPE_APPLICATION_INFO, .pApplicationName = "App", .applicationVersion = vk.VK_MAKE_VERSION(1, 0, 0), .pEngineName = "No Engine", .engineVersion = vk.VK_MAKE_VERSION(1, 0, 0), .apiVersion = vk.VK_API_VERSION_1_0, .pNext = null, }; const create_info = vk.VkInstanceCreateInfo{ .sType = vk.VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, .pApplicationInfo = &app_info, .enabledExtensionCount = @intCast(u32, enabled_extensions.items.len), .ppEnabledExtensionNames = enabled_extensions.items.ptr, // Validation layer disabled. .enabledLayerCount = if (vk_enable_validation_layers) @intCast(u32, VkRequiredValidationLayers.len) else 0, .ppEnabledLayerNames = if (vk_enable_validation_layers) &VkRequiredValidationLayers else null, .pNext = null, .flags = 0, }; var res = vk.createInstance(&create_info, null, &instance); vk.assertSuccess(res); win.inner.instance = instance; if (builtin.os.tag == .macos) { vk.initMacVkFunctions(instance); } // Create surface. var surface: vk.VkSurfaceKHR = undefined; if (sdl.SDL_Vulkan_CreateSurface(win.sdl_window, @ptrCast(sdl.VkInstance, instance), @ptrCast(*sdl.VkSurfaceKHR, &surface)) == 0) { log.err("SDL_Vulkan_CreateSurface: {s}", .{sdl.SDL_GetError()}); return error.Failed; } win.inner.surface = surface; // Get physical device. var num_devices: u32 = 0; res = vk.enumeratePhysicalDevices(instance, &num_devices, null); vk.assertSuccess(res); if (num_devices == 0) { return error.NoVulkanDevice; } const devices = alloc.alloc(vk.VkPhysicalDevice, num_devices) catch @panic("error"); defer alloc.free(devices); res = vk.enumeratePhysicalDevices(instance, &num_devices, devices.ptr); vk.assertSuccess(res); const physical_device = for (devices) |device| { if (try isVkDeviceSuitable(alloc, device, surface)) { break device; } } else return error.NoSuitableDevice; win.inner.physical_device = physical_device; // Create logical device. const q_family = queryQueueFamily(alloc, physical_device, surface); if (q_family.graphics_family.? != q_family.present_family.?) { return error.UnsupportedQueueFamily; } win.inner.queue_family = q_family; const uniq_families: []const u32 = &.{ q_family.graphics_family.? }; var queue_priority: f32 = 1; var queue_create_infos = std.ArrayList(vk.VkDeviceQueueCreateInfo).init(alloc); defer queue_create_infos.deinit(); const queue_create_info = vk.VkDeviceQueueCreateInfo{ .sType = vk.VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO, .queueFamilyIndex = uniq_families[0], .queueCount = 1, .pQueuePriorities = &queue_priority, .pNext = null, .flags = 0, }; try queue_create_infos.append(queue_create_info); var enabled_dextensions = std.ArrayList([*:0]const u8).init(alloc); defer enabled_dextensions.deinit(); enabled_dextensions.appendSlice(&VkRequiredDeviceExtensions) catch stdx.fatal(); const device_extensions = getDeviceExtensionProperties(alloc, physical_device); defer alloc.free(device_extensions); for (device_extensions) |ext| { const name_slice = std.mem.span(@ptrCast([*:0]const u8, &ext.extensionName)); if (std.mem.eql(u8, name_slice, "VK_KHR_portability_subset")) { // If the device reports this extension it wants to translate to a non Vulkan API. eg. Translate to Metal on macos. enabled_dextensions.append("VK_KHR_portability_subset") catch stdx.fatal(); } } var device_features: vk.VkPhysicalDeviceFeatures = undefined; vk.getPhysicalDeviceFeatures(physical_device, &device_features); if (device_features.shaderSampledImageArrayDynamicIndexing == vk.VK_FALSE) { return error.MissingRequiredFeature; } var enabled_features = std.mem.zeroInit(vk.VkPhysicalDeviceFeatures, .{}); enabled_features.shaderSampledImageArrayDynamicIndexing = vk.VK_TRUE; enabled_features.fillModeNonSolid = vk.VK_TRUE; const d_create_info = vk.VkDeviceCreateInfo{ .sType = vk.VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, .queueCreateInfoCount = @intCast(u32, queue_create_infos.items.len), .pQueueCreateInfos = queue_create_infos.items.ptr, .pEnabledFeatures = &enabled_features, .enabledExtensionCount = @intCast(u32, enabled_dextensions.items.len), .ppEnabledExtensionNames = enabled_dextensions.items.ptr, .enabledLayerCount = 0, .ppEnabledLayerNames = null, .pNext = null, .flags = 0, }; res = vk.createDevice(physical_device, &d_create_info, null, &win.inner.device); vk.assertSuccess(res); win.id = sdl.SDL_GetWindowID(win.sdl_window); win.width = @intCast(u32, config.width); win.height = @intCast(u32, config.height); var buf_width: c_int = undefined; var buf_height: c_int = undefined; switch (Backend) { .OpenGL => sdl.SDL_GL_GetDrawableSize(win.sdl_window, &buf_width, &buf_height), .Vulkan => sdl.SDL_Vulkan_GetDrawableSize(win.sdl_window, &buf_width, &buf_height), else => stdx.unsupported(), } win.buf_width = @intCast(u32, buf_width); win.buf_height = @intCast(u32, buf_height); win.dpr = @intCast(u8, win.buf_width / win.width); } const SwapChainInfo = struct { capabilities: vk.VkSurfaceCapabilitiesKHR, formats: []vk.VkSurfaceFormatKHR, present_modes: []vk.VkPresentModeKHR, pub fn deinit(self: SwapChainInfo, alloc: std.mem.Allocator) void { alloc.free(self.formats); alloc.free(self.present_modes); } pub fn getDefaultExtent(self: SwapChainInfo) vk.VkExtent2D { if (self.capabilities.currentExtent.width != std.math.maxInt(u32)) { return self.capabilities.currentExtent; } else { var extent = vk.VkExtent2D{ .width = 800, .height = 600, }; extent.width = std.math.max(self.capabilities.minImageExtent.width, std.math.min(self.capabilities.maxImageExtent.width, extent.width)); extent.height = std.math.max(self.capabilities.minImageExtent.height, std.math.min(self.capabilities.maxImageExtent.height, extent.height)); return extent; } } pub fn getDefaultSurfaceFormat(self: SwapChainInfo) vk.VkSurfaceFormatKHR { if (self.formats.len == 1 and self.formats[0].format == vk.VK_FORMAT_UNDEFINED) { return vk.VkSurfaceFormatKHR{ .format = vk.VK_FORMAT_B8G8R8A8_UNORM, .colorSpace = vk.VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, }; } for (self.formats) |format| { if (format.format == vk.VK_FORMAT_B8G8R8A8_UNORM and format.colorSpace == vk.VK_COLOR_SPACE_SRGB_NONLINEAR_KHR) { return format; } } return self.formats[0]; } pub fn getDefaultPresentMode(self: SwapChainInfo) vk.VkPresentModeKHR { var best: vk.VkPresentModeKHR = vk.VK_PRESENT_MODE_FIFO_KHR; for (self.present_modes) |mode| { if (mode == vk.VK_PRESENT_MODE_MAILBOX_KHR) { return mode; } else if (mode == vk.VK_PRESENT_MODE_IMMEDIATE_KHR) { best = mode; } } return best; } }; /// Currently in the platform module to find a suitable physical device. pub fn vkQuerySwapChainSupport(alloc: std.mem.Allocator, device: vk.VkPhysicalDevice, surface: vk.VkSurfaceKHR) SwapChainInfo { var new = SwapChainInfo{ .capabilities = undefined, .formats = undefined, .present_modes = undefined, }; var res = vk.getPhysicalDeviceSurfaceCapabilitiesKHR(device, surface, &new.capabilities); vk.assertSuccess(res); var format_count: u32 = undefined; res = vk.getPhysicalDeviceSurfaceFormatsKHR(device, surface, &format_count, null); vk.assertSuccess(res); new.formats = alloc.alloc(vk.VkSurfaceFormatKHR, format_count) catch @panic("error"); res = vk.getPhysicalDeviceSurfaceFormatsKHR(device, surface, &format_count, new.formats.ptr); vk.assertSuccess(res); var present_mode_count: u32 = undefined; res = vk.getPhysicalDeviceSurfacePresentModesKHR(device, surface, &present_mode_count, null); vk.assertSuccess(res); new.present_modes = alloc.alloc(vk.VkPresentModeKHR, present_mode_count) catch @panic("error"); res = vk.getPhysicalDeviceSurfacePresentModesKHR(device, surface, &present_mode_count, new.present_modes.ptr); vk.assertSuccess(res); return new; } const VkRequiredDeviceExtensions = [_][*:0]const u8{ vk.VK_KHR_SWAPCHAIN_EXTENSION_NAME, }; const VkRequiredValidationLayers = [_][*:0]const u8{ // "VK_LAYER_LUNARG_standard_validation", "VK_LAYER_KHRONOS_validation", // Available with MoltenVK }; const vk_enable_validation_layers = true and builtin.mode == .Debug; pub const VkQueueFamilyPair = struct { graphics_family: ?u32, present_family: ?u32, fn isValid(self: VkQueueFamilyPair) bool { return self.graphics_family != null and self.present_family != null; } }; fn queryQueueFamily(alloc: std.mem.Allocator, device: vk.VkPhysicalDevice, surface: vk.VkSurfaceKHR) VkQueueFamilyPair { // Check queue family. var family_count: u32 = 0; vk.getPhysicalDeviceQueueFamilyProperties(device, &family_count, null); const families = alloc.alloc(vk.VkQueueFamilyProperties, family_count) catch @panic("error"); defer alloc.free(families); vk.getPhysicalDeviceQueueFamilyProperties(device, &family_count, families.ptr); var new = VkQueueFamilyPair{ .graphics_family = null, .present_family = null, }; for (families) |family, idx| { if (family.queueCount > 0 and family.queueFlags & vk.VK_QUEUE_GRAPHICS_BIT != 0) { new.graphics_family = @intCast(u32, idx); } var present_support: vk.VkBool32 = 0; const res = vk.getPhysicalDeviceSurfaceSupportKHR(device, @intCast(u32, idx), surface, &present_support); vk.assertSuccess(res); if (family.queueCount > 0 and present_support != 0) { new.present_family = @intCast(u32, idx); } if (new.isValid()) { break; } } return new; } fn getDeviceExtensionProperties(alloc: std.mem.Allocator, device: vk.VkPhysicalDevice) []const vk.VkExtensionProperties { var extension_count: u32 = undefined; var res = vk.enumerateDeviceExtensionProperties(device, null, &extension_count, null); vk.assertSuccess(res); const extensions = alloc.alloc(vk.VkExtensionProperties, extension_count) catch stdx.fatal(); res = vk.enumerateDeviceExtensionProperties(device, null, &extension_count, extensions.ptr); vk.assertSuccess(res); return extensions; } fn isVkDeviceSuitable(alloc: std.mem.Allocator, device: vk.VkPhysicalDevice, surface: vk.VkSurfaceKHR) !bool { const q_family = queryQueueFamily(alloc, device, surface); if (!q_family.isValid()) { return false; } // Check required extensions. const extensions = getDeviceExtensionProperties(alloc, device); defer alloc.free(extensions); var req_exts = std.StringHashMap(void).init(alloc); defer req_exts.deinit(); for (VkRequiredDeviceExtensions) |ext| { const ext_slice = std.mem.span(ext); req_exts.put(ext_slice, {}) catch @panic("error"); } for (extensions) |ext| { const name_slice = std.mem.span(@ptrCast([*:0]const u8, &ext.extensionName)); _ = req_exts.remove(name_slice); } if (req_exts.count() != 0) { return false; } // Check swap chain. const swap_chain = vkQuerySwapChainSupport(alloc, device, surface); defer swap_chain.deinit(alloc); if (swap_chain.formats.len == 0 or swap_chain.present_modes.len == 0) { return false; } return true; } fn vkCheckValidationLayerSupport(alloc: std.mem.Allocator) bool { var layer_count: u32 = undefined; var res = vk.enumerateInstanceLayerProperties(&layer_count, null); vk.assertSuccess(res); const available_layers = alloc.alloc(vk.VkLayerProperties, layer_count) catch stdx.fatal(); defer alloc.free(available_layers); res = vk.enumerateInstanceLayerProperties(&layer_count, available_layers.ptr); vk.assertSuccess(res); for (VkRequiredValidationLayers) |layer| { var found = false; for (available_layers) |it| { if (std.cstr.cmp(layer, @ptrCast([*:0]const u8, &it.layerName)) == 0) { found = true; break; } } if (!found) { return false; } } return true; } fn initGL_Window(alloc: std.mem.Allocator, win: *Window, config: Config, flags: c_int) !void { try glSetAttr(sdl.SDL_GL_CONTEXT_FLAGS, sdl.SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG); try glSetAttr(sdl.SDL_GL_CONTEXT_PROFILE_MASK, sdl.SDL_GL_CONTEXT_PROFILE_CORE); // Use GL 3.3 to stay close to GLES. try glSetAttr(sdl.SDL_GL_CONTEXT_MAJOR_VERSION, 3); try glSetAttr(sdl.SDL_GL_CONTEXT_MINOR_VERSION, 3); try glSetAttr(sdl.SDL_GL_DOUBLEBUFFER, 1); try glSetAttr(sdl.SDL_GL_DEPTH_SIZE, 24); try glSetAttr(sdl.SDL_GL_STENCIL_SIZE, 8); var window_flags = flags | sdl.SDL_WINDOW_OPENGL; win.sdl_window = sdl.createWindow(alloc, config.title, sdl.SDL_WINDOWPOS_UNDEFINED, sdl.SDL_WINDOWPOS_UNDEFINED, @intCast(c_int, config.width), @intCast(c_int, config.height), @bitCast(u32, window_flags)) orelse { log.err("Unable to create window: {s}", .{sdl.SDL_GetError()}); return error.Failed; }; win.id = sdl.SDL_GetWindowID(win.sdl_window); win.width = @intCast(u32, config.width); win.height = @intCast(u32, config.height); var buf_width: c_int = undefined; var buf_height: c_int = undefined; sdl.SDL_GL_GetDrawableSize(win.sdl_window, &buf_width, &buf_height); win.buf_width = @intCast(u32, buf_width); win.buf_height = @intCast(u32, buf_height); win.dpr = @intCast(u8, win.buf_width / win.width); } fn initGL_Context(win: *Window) !void { if (sdl.SDL_GL_CreateContext(win.sdl_window)) |ctx| { win.inner.gl_ctx = ctx; // GL version on some platforms is only available after the context is created and made current. // This also means it's better to start initing opengl functions (GetProcAddress) on windows after an opengl context is created. var major: i32 = undefined; var minor: i32 = undefined; gl.getIntegerv(gl.GL_MAJOR_VERSION, &major); gl.getIntegerv(gl.GL_MINOR_VERSION, &minor); _ = minor; if (major < 3) { log.err("OpenGL Version Unsupported: {s}", .{gl.glGetString(gl.GL_VERSION)}); return error.OpenGLUnsupported; } if (builtin.os.tag == .windows) { gl.initWinGL_Functions(); } log.debug("OpenGL: {s}", .{gl.glGetString(gl.GL_VERSION)}); } else { log.err("Create GLContext: {s}", .{sdl.SDL_GetError()}); return error.Failed; } // Not necessary but better to be explicit. if (sdl.SDL_GL_MakeCurrent(win.sdl_window, win.inner.gl_ctx) != 0) { log.err("Unable to attach gl context to window: {s}", .{sdl.SDL_GetError()}); return error.Failed; } } // Should be called for cleanup before app exists. pub fn quit() void { sdl.SDL_Quit(); } fn getSdlWindowFlags(config: Config) c_int { var flags: c_int = 0; if (config.resizable) flags |= sdl.SDL_WINDOW_RESIZABLE; // TODO: Implement high dpi if it doesn't work on windows: https://nlguillemot.wordpress.com/2016/12/11/high-dpi-rendering/ if (config.high_dpi) flags |= sdl.SDL_WINDOW_ALLOW_HIGHDPI; if (config.mode == .PseudoFullscreen) { flags |= sdl.SDL_WINDOW_FULLSCREEN_DESKTOP; } else if (config.mode == .Fullscreen) { flags |= sdl.SDL_WINDOW_FULLSCREEN; } return flags; } fn resizeMsaaFrameBuffer(msaa: MsaaFrameBuffer, width: u32, height: u32) void { gl.bindFramebuffer(gl.GL_DRAW_FRAMEBUFFER, msaa.fbo); if (IsDesktop) { gl.bindTexture(gl.GL_TEXTURE_2D_MULTISAMPLE, msaa.tex.?); gl.texImage2DMultisample(gl.GL_TEXTURE_2D_MULTISAMPLE, @intCast(c_int, msaa.num_samples), gl.GL_RGB, @intCast(c_int, width), @intCast(c_int, height), gl.GL_TRUE); gl.framebufferTexture2D(gl.GL_FRAMEBUFFER, gl.GL_COLOR_ATTACHMENT0, gl.GL_TEXTURE_2D_MULTISAMPLE, msaa.tex.?, 0); gl.bindTexture(gl.GL_TEXTURE_2D_MULTISAMPLE, 0); } else { gl.bindRenderbuffer(gl.GL_RENDERBUFFER, msaa.rbo.?); gl.renderbufferStorageMultisample(gl.GL_RENDERBUFFER, @intCast(c_int, msaa.num_samples), gl.GL_RGBA8, @intCast(c_int, width), @intCast(c_int, height)); gl.framebufferRenderbuffer(gl.GL_FRAMEBUFFER, gl.GL_COLOR_ATTACHMENT0, gl.GL_RENDERBUFFER, msaa.rbo.?); } } pub fn createMsaaFrameBuffer(width: u32, height: u32, dpr: u8) ?MsaaFrameBuffer { // Setup multisampling anti alias. // See: https://learnopengl.com/Advanced-OpenGL/Anti-Aliasing const max_samples = gl.getMaxSamples(); log.debug("max samples: {}", .{max_samples}); if (max_samples >= 2) { const msaa_preferred_samples: u32 = switch (dpr) { 1 => 8, // Since the draw buffer is already a supersample, we don't need much msaa samples. 2 => 4, else => 2, }; const num_samples = std.math.min(max_samples, msaa_preferred_samples); var ms_fbo: gl.GLuint = 0; gl.genFramebuffers(1, &ms_fbo); gl.bindFramebuffer(gl.GL_DRAW_FRAMEBUFFER, ms_fbo); if (IsDesktop) { var ms_tex: gl.GLuint = undefined; gl.genTextures(1, &ms_tex); gl.enable(gl.GL_MULTISAMPLE); // gl.glHint(gl.GL_MULTISAMPLE_FILTER_HINT_NV, gl.GL_NICEST); gl.bindTexture(gl.GL_TEXTURE_2D_MULTISAMPLE, ms_tex); gl.texImage2DMultisample(gl.GL_TEXTURE_2D_MULTISAMPLE, @intCast(c_int, num_samples), gl.GL_RGB, @intCast(c_int, width), @intCast(c_int, height), gl.GL_TRUE); gl.framebufferTexture2D(gl.GL_FRAMEBUFFER, gl.GL_COLOR_ATTACHMENT0, gl.GL_TEXTURE_2D_MULTISAMPLE, ms_tex, 0); gl.bindTexture(gl.GL_TEXTURE_2D_MULTISAMPLE, 0); log.debug("msaa framebuffer created with {} samples", .{num_samples}); return MsaaFrameBuffer{ .fbo = ms_fbo, .tex = ms_tex, .rbo = null, .num_samples = num_samples, }; } else if (IsWebGL2) { // webgl2 does not support texture multisampling but it does support renderbuffer multisampling. var rbo: gl.GLuint = undefined; gl.genRenderbuffers(1, &rbo); gl.bindRenderbuffer(gl.GL_RENDERBUFFER, rbo); gl.renderbufferStorageMultisample(gl.GL_RENDERBUFFER, @intCast(c_int, num_samples), gl.GL_RGBA8, @intCast(c_int, width), @intCast(c_int, height)); gl.framebufferRenderbuffer(gl.GL_FRAMEBUFFER, gl.GL_COLOR_ATTACHMENT0, gl.GL_RENDERBUFFER, rbo); const status = gl.checkFramebufferStatus(gl.GL_FRAMEBUFFER); if (status != gl.GL_FRAMEBUFFER_COMPLETE) { log.debug("unexpected status: {}", .{status}); unreachable; } return MsaaFrameBuffer{ .fbo = ms_fbo, .tex = null, .rbo = rbo, .num_samples = num_samples, }; } else unreachable; } else { return null; } } const MsaaFrameBuffer = struct { fbo: gl.GLuint, // For desktop. tex: ?gl.GLuint, // For webgl2. rbo: ?gl.GLuint, num_samples: u32, };
platform/window_sdl.zig
const std = @import("std"); const builtin = @import("builtin"); const mem = std.mem; const expect = std.testing.expect; const expectEqualStrings = std.testing.expectEqualStrings; // normal comment /// this is a documentation comment /// doc comment line 2 fn emptyFunctionWithComments() void {} test "empty function with comments" { emptyFunctionWithComments(); } test "truncate" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; try expect(testTruncate(0x10fd) == 0xfd); comptime try expect(testTruncate(0x10fd) == 0xfd); } fn testTruncate(x: u32) u8 { return @truncate(u8, x); } test "truncate to non-power-of-two integers" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; try testTrunc(u32, u1, 0b10101, 0b1); try testTrunc(u32, u1, 0b10110, 0b0); try testTrunc(u32, u2, 0b10101, 0b01); try testTrunc(u32, u2, 0b10110, 0b10); try testTrunc(i32, i5, -4, -4); try testTrunc(i32, i5, 4, 4); try testTrunc(i32, i5, -28, 4); try testTrunc(i32, i5, 28, -4); try testTrunc(i32, i5, std.math.maxInt(i32), -1); } fn testTrunc(comptime Big: type, comptime Little: type, big: Big, little: Little) !void { try expect(@truncate(Little, big) == little); } const g1: i32 = 1233 + 1; var g2: i32 = 0; test "global variables" { try expect(g2 == 0); g2 = g1; try expect(g2 == 1234); } test "comptime keyword on expressions" { const x: i32 = comptime x: { break :x 1 + 2 + 3; }; try expect(x == comptime 6); } test "type equality" { try expect(*const u8 != *u8); } test "pointer dereferencing" { var x = @as(i32, 3); const y = &x; y.* += 1; try expect(x == 4); try expect(y.* == 4); } test "const expression eval handling of variables" { var x = true; while (x) { x = false; } } test "character literals" { try expect('\'' == single_quote); } const single_quote = '\''; test "non const ptr to aliased type" { const int = i32; try expect(?*int == ?*i32); } test "cold function" { thisIsAColdFn(); comptime thisIsAColdFn(); } fn thisIsAColdFn() void { @setCold(true); } test "unicode escape in character literal" { var a: u24 = '\u{01f4a9}'; try expect(a == 128169); } test "unicode character in character literal" { try expect('💩' == 128169); } fn first4KeysOfHomeRow() []const u8 { return "aoeu"; } test "return string from function" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; try expect(mem.eql(u8, first4KeysOfHomeRow(), "aoeu")); } test "hex escape" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; try expect(mem.eql(u8, "\x68\x65\x6c\x6c\x6f", "hello")); } test "multiline string" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; const s1 = \\one \\two) \\three ; const s2 = "one\ntwo)\nthree"; try expect(mem.eql(u8, s1, s2)); } test "multiline string comments at start" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; const s1 = //\\one \\two) \\three ; const s2 = "two)\nthree"; try expect(mem.eql(u8, s1, s2)); } test "multiline string comments at end" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; const s1 = \\one \\two) //\\three ; const s2 = "one\ntwo)"; try expect(mem.eql(u8, s1, s2)); } test "multiline string comments in middle" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; const s1 = \\one //\\two) \\three ; const s2 = "one\nthree"; try expect(mem.eql(u8, s1, s2)); } test "multiline string comments at multiple places" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; const s1 = \\one //\\two \\three //\\four \\five ; const s2 = "one\nthree\nfive"; try expect(mem.eql(u8, s1, s2)); } test "string concatenation" { try expect(mem.eql(u8, "OK" ++ " IT " ++ "WORKED", "OK IT WORKED")); } test "array mult operator" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; try expect(mem.eql(u8, "ab" ** 5, "ababababab")); } const OpaqueA = opaque {}; const OpaqueB = opaque {}; test "opaque types" { if (builtin.zig_backend == .stage1) { // stage1 gets the type names wrong return error.SkipZigTest; } if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO try expect(*OpaqueA != *OpaqueB); try expect(mem.eql(u8, @typeName(OpaqueA), "behavior.basic.OpaqueA")); try expect(mem.eql(u8, @typeName(OpaqueB), "behavior.basic.OpaqueB")); } const global_a: i32 = 1234; const global_b: *const i32 = &global_a; const global_c: *const f32 = @ptrCast(*const f32, global_b); test "compile time global reinterpret" { const d = @ptrCast(*const i32, global_c); try expect(d.* == 1234); } test "cast undefined" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; const array: [100]u8 = undefined; const slice = @as([]const u8, &array); testCastUndefined(slice); } fn testCastUndefined(x: []const u8) void { _ = x; } test "implicit cast after unreachable" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; try expect(outer() == 1234); } fn inner() i32 { return 1234; } fn outer() i64 { return inner(); } test "comptime if inside runtime while which unconditionally breaks" { testComptimeIfInsideRuntimeWhileWhichUnconditionallyBreaks(true); comptime testComptimeIfInsideRuntimeWhileWhichUnconditionallyBreaks(true); } fn testComptimeIfInsideRuntimeWhileWhichUnconditionallyBreaks(cond: bool) void { while (cond) { if (false) {} break; } } test "implicit comptime while" { while (false) { @compileError("bad"); } } fn fnThatClosesOverLocalConst() type { const c = 1; return struct { fn g() i32 { return c; } }; } test "function closes over local const" { const x = fnThatClosesOverLocalConst().g(); try expect(x == 1); } test "volatile load and store" { var number: i32 = 1234; const ptr = @as(*volatile i32, &number); ptr.* += 1; try expect(ptr.* == 1235); } fn fA() []const u8 { return "a"; } fn fB() []const u8 { return "b"; } test "call function pointer in struct" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage1) return error.SkipZigTest; try expect(mem.eql(u8, f3(true), "a")); try expect(mem.eql(u8, f3(false), "b")); } fn f3(x: bool) []const u8 { var wrapper: FnPtrWrapper = .{ .fn_ptr = fB, }; if (x) { wrapper.fn_ptr = fA; } return wrapper.fn_ptr(); } const FnPtrWrapper = struct { fn_ptr: *const fn () []const u8, }; test "const ptr from var variable" { if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; var x: u64 = undefined; var y: u64 = undefined; x = 78; copy(&x, &y); try expect(x == y); } fn copy(src: *const u64, dst: *u64) void { dst.* = src.*; } test "call result of if else expression" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO try expect(mem.eql(u8, f2(true), "a")); try expect(mem.eql(u8, f2(false), "b")); } fn f2(x: bool) []const u8 { return (if (x) fA else fB)(); } test "memcpy and memset intrinsics" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; try testMemcpyMemset(); // TODO add comptime test coverage //comptime try testMemcpyMemset(); } fn testMemcpyMemset() !void { var foo: [20]u8 = undefined; var bar: [20]u8 = undefined; @memset(&foo, 'A', foo.len); @memcpy(&bar, &foo, bar.len); try expect(bar[0] == 'A'); try expect(bar[11] == 'A'); try expect(bar[19] == 'A'); } test "variable is allowed to be a pointer to an opaque type" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO var x: i32 = 1234; _ = hereIsAnOpaqueType(@ptrCast(*OpaqueA, &x)); } fn hereIsAnOpaqueType(ptr: *OpaqueA) *OpaqueA { var a = ptr; return a; } test "take address of parameter" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; try testTakeAddressOfParameter(12.34); } fn testTakeAddressOfParameter(f: f32) !void { const f_ptr = &f; try expect(f_ptr.* == 12.34); } test "pointer to void return type" { if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO try testPointerToVoidReturnType(); } fn testPointerToVoidReturnType() anyerror!void { const a = testPointerToVoidReturnType2(); return a.*; } const test_pointer_to_void_return_type_x = void{}; fn testPointerToVoidReturnType2() *const void { return &test_pointer_to_void_return_type_x; } test "array 2D const double ptr" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO const rect_2d_vertexes = [_][1]f32{ [_]f32{1.0}, [_]f32{2.0}, }; try testArray2DConstDoublePtr(&rect_2d_vertexes[0][0]); } test "array 2D const double ptr with offset" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; const rect_2d_vertexes = [_][2]f32{ [_]f32{ 3.0, 4.239 }, [_]f32{ 1.0, 2.0 }, }; try testArray2DConstDoublePtr(&rect_2d_vertexes[1][0]); } test "array 3D const double ptr with offset" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO const rect_3d_vertexes = [_][2][2]f32{ [_][2]f32{ [_]f32{ 3.0, 4.239 }, [_]f32{ 3.5, 7.2 }, }, [_][2]f32{ [_]f32{ 3.0, 4.239 }, [_]f32{ 1.0, 2.0 }, }, }; try testArray2DConstDoublePtr(&rect_3d_vertexes[1][1][0]); } fn testArray2DConstDoublePtr(ptr: *const f32) !void { const ptr2 = @ptrCast([*]const f32, ptr); try expect(ptr2[0] == 1.0); try expect(ptr2[1] == 2.0); } test "double implicit cast in same expression" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; var x = @as(i32, @as(u16, nine())); try expect(x == 9); } fn nine() u8 { return 9; } test "struct inside function" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; try testStructInFn(); comptime try testStructInFn(); } fn testStructInFn() !void { const BlockKind = u32; const Block = struct { kind: BlockKind, }; var block = Block{ .kind = 1234 }; block.kind += 1; try expect(block.kind == 1235); } test "fn call returning scalar optional in equality expression" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; try expect(getNull() == null); } fn getNull() ?*i32 { return null; } test "global variable assignment with optional unwrapping with var initialized to undefined" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; const S = struct { var data: i32 = 1234; fn foo() ?*i32 { return &data; } }; global_foo = S.foo() orelse { @panic("bad"); }; try expect(global_foo.* == 1234); } var global_foo: *i32 = undefined; test "peer result location with typed parent, runtime condition, comptime prongs" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; const S = struct { fn doTheTest(arg: i32) i32 { const st = Structy{ .bleh = if (arg == 1) 1 else 1, }; if (st.bleh == 1) return 1234; return 0; } const Structy = struct { bleh: i32, }; }; try expect(S.doTheTest(0) == 1234); try expect(S.doTheTest(1) == 1234); } test "non-ambiguous reference of shadowed decls" { try expect(ZA().B().Self != ZA().Self); } fn ZA() type { return struct { b: B(), const Self = @This(); fn B() type { return struct { const Self = @This(); }; } }; } test "use of declaration with same name as primitive" { const S = struct { const @"u8" = u16; const alias = @"u8"; }; const a: S.u8 = 300; try expect(a == 300); const b: S.alias = 300; try expect(b == 300); const @"u8" = u16; const c: @"u8" = 300; try expect(c == 300); } test "constant equal function pointers" { const alias = emptyFn; try expect(comptime x: { break :x emptyFn == alias; }); } fn emptyFn() void {} const addr1 = @ptrCast(*const u8, &emptyFn); test "comptime cast fn to ptr" { if (builtin.zig_backend == .stage1) return error.SkipZigTest; const addr2 = @ptrCast(*const u8, &emptyFn); comptime try expect(addr1 == addr2); } test "equality compare fn ptrs" { if (builtin.zig_backend == .stage1) return error.SkipZigTest; var a = &emptyFn; try expect(a == a); } test "self reference through fn ptr field" { if (builtin.zig_backend == .stage1) return error.SkipZigTest; if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; const S = struct { const A = struct { f: *const fn (A) u8, }; fn foo(a: A) u8 { _ = a; return 12; } }; var a: S.A = undefined; a.f = S.foo; try expect(a.f(a) == 12); } test "global variable initialized to global variable array element" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; try expect(global_ptr == &gdt[0]); } const GDTEntry = struct { field: i32, }; var gdt = [_]GDTEntry{ GDTEntry{ .field = 1 }, GDTEntry{ .field = 2 }, }; var global_ptr = &gdt[0]; test "global constant is loaded with a runtime-known index" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; const S = struct { fn doTheTest() !void { var index: usize = 1; const ptr = &pieces[index].field; try expect(ptr.* == 2); } const Piece = struct { field: i32, }; const pieces = [_]Piece{ Piece{ .field = 1 }, Piece{ .field = 2 }, Piece{ .field = 3 } }; }; try S.doTheTest(); } test "multiline string literal is null terminated" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; const s1 = \\one \\two) \\three ; const s2 = "one\ntwo)\nthree"; try expect(std.cstr.cmp(s1, s2) == 0); } test "string escapes" { if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; try expectEqualStrings("\"", "\x22"); try expectEqualStrings("\'", "\x27"); try expectEqualStrings("\n", "\x0a"); try expectEqualStrings("\r", "\x0d"); try expectEqualStrings("\t", "\x09"); try expectEqualStrings("\\", "\x5c"); try expectEqualStrings("\u{1234}\u{069}\u{1}", "\xe1\x88\xb4\x69\x01"); } test "explicit cast optional pointers" { const a: ?*i32 = undefined; const b: ?*f32 = @ptrCast(?*f32, a); _ = b; } test "pointer comparison" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; const a = @as([]const u8, "a"); const b = &a; try expect(ptrEql(b, b)); } fn ptrEql(a: *const []const u8, b: *const []const u8) bool { return a == b; } test "string concatenation" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; const a = "OK" ++ " IT " ++ "WORKED"; const b = "OK IT WORKED"; comptime try expect(@TypeOf(a) == *const [12:0]u8); comptime try expect(@TypeOf(b) == *const [12:0]u8); const len = mem.len(b); const len_with_null = len + 1; { var i: u32 = 0; while (i < len_with_null) : (i += 1) { try expect(a[i] == b[i]); } } try expect(a[len] == 0); try expect(b[len] == 0); } test "thread local variable" { if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch != .x86_64) return error.SkipZigTest; // TODO const S = struct { threadlocal var t: i32 = 1234; }; S.t += 1; try expect(S.t == 1235); } test "result location is optional inside error union" { if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO const x = maybe(true) catch unreachable; try expect(x.? == 42); } fn maybe(x: bool) anyerror!?u32 { return switch (x) { true => @as(u32, 42), else => null, }; } test "pointer to thread local array" { if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch != .x86_64) return error.SkipZigTest; // TODO const s = "Hello world"; std.mem.copy(u8, buffer[0..], s); try std.testing.expectEqualSlices(u8, buffer[0..], s); } threadlocal var buffer: [11]u8 = undefined; test "auto created variables have correct alignment" { if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO const S = struct { fn foo(str: [*]const u8) u32 { for (@ptrCast([*]align(1) const u32, str)[0..1]) |v| { return v; } return 0; } }; try expect(S.foo("\x7a\x7a\x7a\x7a") == 0x7a7a7a7a); comptime try expect(S.foo("\x7a\x7a\x7a\x7a") == 0x7a7a7a7a); } test "extern variable with non-pointer opaque type" { if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO @export(var_to_export, .{ .name = "opaque_extern_var" }); try expect(@ptrCast(*align(1) u32, &opaque_extern_var).* == 42); } extern var opaque_extern_var: opaque {}; var var_to_export: u32 = 42; test "lazy typeInfo value as generic parameter" { const S = struct { fn foo(args: anytype) void { _ = args; } }; S.foo(@typeInfo(@TypeOf(.{}))); } test "variable name containing underscores does not shadow int primitive" { const _u0 = 0; const i_8 = 0; const u16_ = 0; const i3_2 = 0; const u6__4 = 0; const i2_04_8 = 0; _ = _u0; _ = i_8; _ = u16_; _ = i3_2; _ = u6__4; _ = i2_04_8; } test "if expression type coercion" { var cond: bool = true; const x: u16 = if (cond) 1 else 0; try expect(@as(u16, x) == 1); } test "discarding the result of various expressions" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO const S = struct { fn foo() !u32 { return 1; } fn bar() ?u32 { return 1; } }; _ = S.bar() orelse { // do nothing }; _ = S.foo() catch { // do nothing }; _ = switch (1) { 1 => 1, 2 => {}, else => return, }; _ = try S.foo(); _ = if (S.bar()) |some| some else {}; _ = blk: { if (S.bar()) |some| break :blk some; break :blk; }; _ = while (S.bar()) |some| break some else {}; _ = for ("foo") |char| break char else {}; } test "labeled block implicitly ends in a break" { var a = false; blk: { if (a) break :blk; } }
test/behavior/basic.zig
const aoc = @import("../aoc.zig"); const std = @import("std"); const PairCounts = std.StringHashMap(usize); const AtomCounts = std.AutoHashMap(u8, usize); pub fn run(problem: *aoc.Problem) !aoc.Solution { const polymer_template = problem.line().?; var pair_insertions = std.StringHashMap(u8).init(problem.allocator); defer pair_insertions.deinit(); while (problem.line()) |line| { var tokens = std.mem.tokenize(u8, line, " ->"); try pair_insertions.put(tokens.next().?, tokens.next().?[0]); } var pair_counts = PairCounts.init(problem.allocator); defer pair_counts.deinit(); var atom_counts = AtomCounts.init(problem.allocator); defer atom_counts.deinit(); for (polymer_template[0..polymer_template.len - 1]) |atom, idx| { (try pair_counts.getOrPutValue(polymer_template[idx..idx + 2], 0)).value_ptr.* += 1; (try atom_counts.getOrPutValue(atom, 0)).value_ptr.* += 1; } (try atom_counts.getOrPutValue(polymer_template[polymer_template.len - 1], 0)).value_ptr.* += 1; var atom_diff_10: usize = undefined; const atom_diff_40 = blk: { var step: u8 = 0; while (step < 40) : (step += 1) { var new_pair_counts = PairCounts.init(problem.allocator); var iter = pair_counts.iterator(); while (iter.next()) |old_pair_count| { const rule = pair_insertions.getEntry(old_pair_count.key_ptr.*).?; var buf: [2]u8 = undefined; buf[0] = old_pair_count.key_ptr.*[0]; buf[1] = rule.value_ptr.*; (try new_pair_counts.getOrPutValue(pair_insertions.getEntry(&buf).?.key_ptr.*, 0)).value_ptr.* += old_pair_count.value_ptr.*; buf[0] = rule.value_ptr.*; buf[1] = old_pair_count.key_ptr.*[1]; (try new_pair_counts.getOrPutValue(pair_insertions.getEntry(&buf).?.key_ptr.*, 0)).value_ptr.* += old_pair_count.value_ptr.*; (try atom_counts.getOrPutValue(rule.value_ptr.*, 0)).value_ptr.* += old_pair_count.value_ptr.*; } pair_counts.deinit(); pair_counts = new_pair_counts; if (step == 9) { atom_diff_10 = atomDiff(&atom_counts); } } break :blk atomDiff(&atom_counts); }; return problem.solution(atom_diff_10, atom_diff_40); } fn atomDiff(atom_counts: *const AtomCounts) usize { var most_common: usize = 0; var least_common: usize = std.math.maxInt(usize); var iter = atom_counts.iterator(); while (iter.next()) |atom_count| { if (atom_count.value_ptr.* > most_common) { most_common = atom_count.value_ptr.*; } if (atom_count.value_ptr.* < least_common) { least_common = atom_count.value_ptr.*; } } return most_common - least_common; }
src/main/zig/2021/day14.zig
const std = @import("std"); const string = []const u8; const u = @import("./index.zig"); // // // zig fmt: off pub const DepType = enum { local, // A 'package' derived from files in the same repository. system_lib, // std.build.LibExeObjStep.linkSystemLibrary framework, // std.build.LibExeObjStep.linkFramework git, // https://git-scm.com/ hg, // https://www.mercurial-scm.org/ http, // https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol // svn, // https://subversion.apache.org/ // fossil, // https://fossil-scm.org/ // cvs, // https://nongnu.org/cvs/ // darcs, // http://darcs.net/ // // // bazaar, // https://bazaar.canonical.com/en/ // pijul, // https://pijul.org/ // // // ftp, // https://en.wikipedia.org/wiki/File_Transfer_Protocol // ssh, // https://www.ssh.com/ssh/ // onion, // https://www.torproject.org/ // i2p, // https://geti2p.net/en/ // torrent, // https://en.wikipedia.org/wiki/BitTorrent // magnet, // https://en.wikipedia.org/wiki/BitTorrent // dat, // https://www.datprotocol.com/ // ipfs, // https://www.ipfs.com/ // hypercore, // https://hypercore-protocol.org/ // zig fmt: on pub fn pull(self: DepType, alloc: std.mem.Allocator, rpath: string, dpath: string) !void { switch (self) { .local => {}, .system_lib => {}, .framework => {}, .git => { u.assert((try u.run_cmd(alloc, null, &.{ "git", "clone", "--recurse-submodules", rpath, dpath })) == 0, "git clone {s} failed", .{rpath}); }, .hg => { u.assert((try u.run_cmd(alloc, null, &.{ "hg", "clone", rpath, dpath })) == 0, "hg clone {s} failed", .{rpath}); }, .http => { try std.fs.cwd().makePath(dpath); u.assert((try u.run_cmd(alloc, dpath, &.{ "wget", rpath })) == 0, "wget {s} failed", .{rpath}); const f = rpath[std.mem.lastIndexOf(u8, rpath, "/").? + 1 ..]; if (std.mem.endsWith(u8, f, ".zip")) { u.assert((try u.run_cmd(alloc, dpath, &.{ "unzip", f, "-d", "." })) == 0, "unzip {s} failed", .{f}); } if (std.mem.endsWith(u8, f, ".tar") or std.mem.endsWith(u8, f, ".tar.gz") or std.mem.endsWith(u8, f, ".tar.xz") or std.mem.endsWith(u8, f, ".tar.zst")) { u.assert((try u.run_cmd(alloc, dpath, &.{ "tar", "-xf", f, "-C", "." })) == 0, "un-tar {s} failed", .{f}); } }, } } pub fn update(self: DepType, alloc: std.mem.Allocator, dpath: string, rpath: string) !void { _ = rpath; switch (self) { .local => {}, .system_lib => {}, .framework => {}, .git => { u.assert((try u.run_cmd(alloc, dpath, &.{ "git", "fetch" })) == 0, "git fetch failed", .{}); u.assert((try u.run_cmd(alloc, dpath, &.{ "git", "pull" })) == 0, "git pull failed", .{}); }, .hg => { u.assert((try u.run_cmd(alloc, dpath, &.{ "hg", "pull" })) == 0, "hg pull failed", .{}); }, .http => { // }, } } pub fn exact_version(self: DepType, alloc: std.mem.Allocator, mpath: string) !string { var mdir = try std.fs.cwd().openDir(mpath, .{}); defer mdir.close(); return switch (self) { .local => "", .system_lib => "", .framework => "", .git => try std.fmt.allocPrint(alloc, "commit-{s}", .{(try u.git_rev_HEAD(alloc, mdir))}), .hg => "", .http => "", }; } pub fn isLocal(self: DepType) bool { return switch (self) { .local => true, .system_lib => true, .framework => true, .git => false, .hg => false, .http => false, }; } pub const GitVersion = enum { branch, tag, commit, pub fn frozen(self: GitVersion) bool { return switch (self) { .branch => false, .tag => true, .commit => true, }; } }; };
src/util/dep_type.zig
const std = @import("std"); /// A fixed size ring buffer designed for use with scatter/gather I/O. /// `size` must be a power of two greater than one. pub fn RingBuffer(comptime T: type, comptime size: usize) type { if (size < 2 or !std.math.isPowerOfTwo(size)) @compileError("`size` must be a power of two greater than one"); return struct { const Self = @This(); /// The integer type capable of holding an index into the buffer. pub const Index = std.meta.Int(.unsigned, std.math.log2_int(usize, size)); /// The error returned from functions that write to the buffer. pub const Error = error{BufferFull}; /// The storage for the buffer. data: [size]T, /// The index where the next element will be written. head: Index, /// The index where the next element will be read from. tail: Index, /// Creates an empty `RingBuffer`. pub fn init() Self { return .{ .data = undefined, .head = 0, .tail = 0, }; } /// Returns the number of elements that can be read. pub fn readableLength(rb: Self) Index { return rb.head -% rb.tail; } /// Returns the number of elements that can be written. pub fn writableLength(rb: Self) Index { return rb.tail -% rb.head -% 1; } /// Returns the last element of the buffer, if any. pub fn pop(rb: *Self) ?T { if (rb.readableLength() == 0) return null; const item = rb.data[rb.head -% 1]; rb.head -%= 1; return item; } /// Returns the first element of the buffer, if any. pub fn popFirst(rb: *Self) ?T { if (rb.readableLength() == 0) return null; const item = rb.data[rb.tail]; rb.tail +%= 1; return item; } /// Appends an element to the buffer, if there is space. pub fn prepend(rb: *Self, item: T) Error!void { if (rb.writableLength() == 0) return error.BufferFull; rb.data[rb.head] = item; rb.head +%= 1; } /// Prepends an element to the buffer, if there is space. pub fn append(rb: *Self, item: T) Error!void { if (rb.writableLength() == 0) return error.BufferFull; rb.tail -%= 1; rb.data[rb.tail] = item; } /// Copies elements to the front of the buffer, if there is space. /// Note that this is not the same as individually prepending elements, /// as extending {4, 5, 6} with {1, 2, 3} yields {1, 2, 3, 4, 5, 6}. pub fn prependSlice(rb: *Self, items: []const T) Error!void { if (items.len > rb.writableLength()) return error.BufferFull; const len = @intCast(Index, items.len); const start = rb.tail -% len; if (start <= rb.tail) { std.mem.copy(T, rb.data[start..], items); } else { const split = size - start; std.mem.copy(T, rb.data[0..], items[split..]); std.mem.copy(T, rb.data[start..], items[0..split]); } rb.tail -%= len; } /// Copies elements to the back of the buffer, if there is space. pub fn appendSlice(rb: *Self, items: []const T) Error!void { if (items.len > rb.writableLength()) return error.BufferFull; const len = @intCast(Index, items.len); if (rb.head + len <= size) { std.mem.copy(T, rb.data[rb.head..], items); } else { const split = size - rb.head; std.mem.copy(T, rb.data[rb.head..], items[0..split]); std.mem.copy(T, rb.data[0..], items[split..]); } rb.head +%= len; } /// Ensures that the next `n` readable items are stored contiguously in /// the buffer, meaning the first slice returned from readableSlices() is /// guaranteed to be at least `n` items long. /// `n` must be less than or equal to readableLength(). pub fn ensureContiguous(rb: *Self, n: usize) void { std.debug.assert(n <= rb.readableLength()); if (size - rb.tail < n) { var buf: [size / 2]T = undefined; const difference = @intCast(Index, n - (size - rb.tail)); std.mem.copy(T, buf[0..difference], rb.data[0..difference]); std.mem.copy(T, rb.data[0..], rb.data[difference..]); std.mem.copy(T, rb.data[size - difference ..], buf[0..difference]); rb.tail -%= difference; rb.head -%= difference; } } /// Returns two slices, which in order constitute the readable buffer contents. /// The first slice is of of length zero if the buffer is empty. /// The second slice is of length zero if all readable elements are contiguous. /// To discard elements once read, use a wrapping add on `tail`. pub fn readableSlices(rb: *const Self) [2][]const T { if (rb.tail <= rb.head) { return .{ rb.data[rb.tail..rb.head], rb.data[0..0], }; } else { return .{ rb.data[rb.tail..size], rb.data[0..rb.head], }; } } /// Returns two slices, which in order constitute the unused space in the buffer. /// To add elements once written, use a wrapping add on `head`. pub fn writableSlices(rb: *Self) [2][]T { if (rb.head < rb.tail) { return .{ rb.data[rb.head .. rb.tail -% 1], rb.data[0..0], }; } else if (rb.tail == 0) { return .{ rb.data[rb.head .. size -% 1], rb.data[0..0], }; } else { return .{ rb.data[rb.head..size], rb.data[0 .. rb.tail -% 1], }; } } }; } test "RingBuffer" { const expectError = std.testing.expectError; const expectEqual = std.testing.expectEqual; { const Rb = RingBuffer(u8, 2); var rb = Rb.init(); { try expectEqual(@as(Rb.Index, 0), rb.readableLength()); try expectEqual(@as(Rb.Index, 1), rb.writableLength()); try expectEqual(@as(usize, 0), rb.readableSlices()[0].len); try expectEqual(@as(usize, 0), rb.readableSlices()[1].len); try expectEqual(@as(usize, 1), rb.writableSlices()[0].len); try expectEqual(@as(usize, 0), rb.writableSlices()[1].len); } try rb.prepend(0); { try expectEqual(@as(Rb.Index, 1), rb.readableLength()); try expectEqual(@as(Rb.Index, 0), rb.writableLength()); try expectEqual(@as(usize, 1), rb.readableSlices()[0].len); try expectEqual(@as(usize, 0), rb.readableSlices()[1].len); try expectEqual(@as(usize, 0), rb.writableSlices()[0].len); try expectEqual(@as(usize, 0), rb.writableSlices()[1].len); try expectEqual(@as(u8, 0), rb.readableSlices()[0][0]); } try expectError(error.BufferFull, rb.prepend(1)); { try expectEqual(@as(Rb.Index, 1), rb.readableLength()); try expectEqual(@as(Rb.Index, 0), rb.writableLength()); try expectEqual(@as(usize, 1), rb.readableSlices()[0].len); try expectEqual(@as(usize, 0), rb.readableSlices()[1].len); try expectEqual(@as(usize, 0), rb.writableSlices()[0].len); try expectEqual(@as(usize, 0), rb.writableSlices()[1].len); try expectEqual(@as(u8, 0), rb.readableSlices()[0][0]); } try expectEqual(@as(?u8, 0), rb.popFirst()); { try expectEqual(@as(Rb.Index, 0), rb.readableLength()); try expectEqual(@as(Rb.Index, 1), rb.writableLength()); try expectEqual(@as(usize, 0), rb.readableSlices()[0].len); try expectEqual(@as(usize, 0), rb.readableSlices()[1].len); try expectEqual(@as(usize, 1), rb.writableSlices()[0].len); try expectEqual(@as(usize, 0), rb.writableSlices()[1].len); } try rb.prepend(1); { try expectEqual(@as(Rb.Index, 1), rb.readableLength()); try expectEqual(@as(Rb.Index, 0), rb.writableLength()); try expectEqual(@as(usize, 1), rb.readableSlices()[0].len); try expectEqual(@as(usize, 0), rb.readableSlices()[1].len); try expectEqual(@as(usize, 0), rb.writableSlices()[0].len); try expectEqual(@as(usize, 0), rb.writableSlices()[1].len); try expectEqual(@as(u8, 1), rb.readableSlices()[0][0]); } try expectEqual(@as(?u8, 1), rb.popFirst()); { try expectEqual(@as(Rb.Index, 0), rb.readableLength()); try expectEqual(@as(Rb.Index, 1), rb.writableLength()); try expectEqual(@as(usize, 0), rb.readableSlices()[0].len); try expectEqual(@as(usize, 0), rb.readableSlices()[1].len); try expectEqual(@as(usize, 1), rb.writableSlices()[0].len); try expectEqual(@as(usize, 0), rb.writableSlices()[1].len); } try rb.append(2); { try expectEqual(@as(Rb.Index, 1), rb.readableLength()); try expectEqual(@as(Rb.Index, 0), rb.writableLength()); try expectEqual(@as(usize, 1), rb.readableSlices()[0].len); try expectEqual(@as(usize, 0), rb.readableSlices()[1].len); try expectEqual(@as(usize, 0), rb.writableSlices()[0].len); try expectEqual(@as(usize, 0), rb.writableSlices()[1].len); try expectEqual(@as(u8, 2), rb.readableSlices()[0][0]); } } { const Rb = RingBuffer(u8, 16); var rb = Rb.init(); try rb.appendSlice(&[_]u8{ 7, 8, 9 }); try rb.prependSlice(&[_]u8{ 4, 5, 6 }); try rb.prependSlice(&[_]u8{ 1, 2, 3 }); rb.ensureContiguous(9); try expectEqual(@as(usize, 9), rb.readableSlices()[0].len); try expectEqual(@as(usize, 0), rb.readableSlices()[1].len); try expectEqual(@as(?u8, 9), rb.pop()); try expectEqual(@as(?u8, 8), rb.pop()); try expectEqual(@as(?u8, 7), rb.pop()); try expectEqual(@as(?u8, 1), rb.popFirst()); try expectEqual(@as(?u8, 2), rb.popFirst()); try expectEqual(@as(?u8, 3), rb.popFirst()); rb.ensureContiguous(3); try expectEqual(@as(usize, 3), rb.readableSlices()[0].len); try expectEqual(@as(usize, 0), rb.readableSlices()[1].len); try expectEqual(@as(usize, 4), rb.readableSlices()[0][0]); try expectEqual(@as(usize, 5), rb.readableSlices()[0][1]); try expectEqual(@as(usize, 6), rb.readableSlices()[0][2]); } { const Rb = RingBuffer(u8, 4096); var rb = Rb.init(); { try expectEqual(@as(Rb.Index, 0), rb.readableLength()); try expectEqual(@as(Rb.Index, 4095), rb.writableLength()); try expectEqual(@as(usize, 0), rb.readableSlices()[0].len); try expectEqual(@as(usize, 0), rb.readableSlices()[1].len); try expectEqual(@as(usize, 4095), rb.writableSlices()[0].len); try expectEqual(@as(usize, 0), rb.writableSlices()[1].len); } var i: u8 = 0; while (i < 255) { try rb.prepend(i); i += 1; { try expectEqual(@as(Rb.Index, 0) + i, rb.readableLength()); try expectEqual(@as(Rb.Index, 4095) - i, rb.writableLength()); try expectEqual(@as(usize, 0) + i, rb.readableSlices()[0].len); try expectEqual(@as(usize, 0), rb.readableSlices()[1].len); try expectEqual(@as(usize, 4095) - i, rb.writableSlices()[0].len); try expectEqual(@as(usize, 0), rb.writableSlices()[1].len); } } i = 0; while (i < 255) { try expectEqual(@as(?u8, i), rb.popFirst()); i += 1; { try expectEqual(@as(Rb.Index, 255) - i, rb.readableLength()); try expectEqual(@as(Rb.Index, 3840) + i, rb.writableLength()); try expectEqual(@as(usize, 255) - i, rb.readableSlices()[0].len); try expectEqual(@as(usize, 0), rb.readableSlices()[1].len); if (i == 1) { try expectEqual(@as(usize, 3841), rb.writableSlices()[0].len); try expectEqual(@as(usize, 0), rb.writableSlices()[1].len); } else { try expectEqual(@as(usize, 3841), rb.writableSlices()[0].len); try expectEqual(@as(usize, i) - 1, rb.writableSlices()[1].len); } } } try expectEqual(@as(?u8, null), rb.popFirst()); } }
src/common/ring_buffer.zig
const std = @import("std"); const os = std.os; const mem = std.mem; const log = std.log; const net = std.net; const time = std.time; const assert = std.debug.assert; const Allocator = std.mem.Allocator; const ArenaAllocator = std.heap.ArenaAllocator; const web = @import("zhp.zig"); const util = @import("util.zig"); const Datetime = web.datetime.Datetime; const mimetypes = web.mimetypes; const Request = web.Request; const Response = web.Response; const IOStream = util.IOStream; const handlers = web.handlers; const root = @import("root"); const regex = @import("ctregex.zig"); // A handler is simply a a factory function which returns a RequestHandler pub const Handler = if (std.io.is_async) fn(app: *Application, server_request: *ServerRequest) callconv(.Async) anyerror!void else fn(app: *Application, server_request: *ServerRequest) anyerror!void; // A utility function so the user doesn't have to use @fieldParentPtr all the time // This seems a bit excessive... pub fn createHandler(comptime T: type) Handler { const RequestHandler = struct { pub fn execute(app: *Application, server_request: *ServerRequest) anyerror!void { const request = &server_request.request; const response = &server_request.response; switch (server_request.state) { .Start => { const self = try response.allocator.create(T); // Create the request handler if (@hasField(T, "server_request")) { self.* = T{ .server_request = server_request }; } else { self.* = T{}; } if (@bitSizeOf(T) > 0) { server_request.handler = @ptrToInt(self); } else if (@hasDecl(T, "stream")) { // We need to be able to store the pointer @compileError("Stream handlers must contain context"); } if (@hasDecl(T, "dispatch")) { return try self.dispatch(request, response); } else { inline for (std.meta.fields(Request.Method)) |f| { comptime const name = [_]u8{std.ascii.toLower(f.name[0])} ++ f.name[1..]; if (@hasDecl(T, name)) { if (request.method == @intToEnum(Request.Method, f.value)) { const handler = @field(self, name); return try handler(request, response); } } } response.status = web.responses.METHOD_NOT_ALLOWED; return; } }, .Finish => { if (@hasDecl(T, "stream")) { if (server_request.handler) |addr| { const self = @intToPtr(*T, addr); _ = try self.stream(server_request.stream.?); return; } return error.ServerError; // Something is missing here... } } } } }; return RequestHandler.execute; } pub const ServerRequest = struct { pub const State = enum { Start, Finish }; allocator: *Allocator, application: *Application, // Storage the fixed buffer allocator used for each request handler storage: []u8 = undefined, buffer: std.heap.FixedBufferAllocator = undefined, // Request and response passed to the request handler request: Request, response: Response, stream: ?*IOStream = null, // Pointer to the handler that is used for streaming state: State = .Start, handler: ?usize = null, // Request parse error or some handler error err: ?anyerror = null, pub fn init(allocator: *Allocator, app: *Application) !ServerRequest { return ServerRequest{ .allocator = allocator, .application = app, .storage = try allocator.alloc( u8, app.options.handler_buffer_size), .request = try Request.initCapacity( allocator, app.options.request_buffer_size, app.options.max_header_count, app.options.max_cookie_count), .response = try Response.initCapacity( allocator, app.options.response_buffer_size, app.options.response_header_count), }; } // This should be in init but doesn't work due to return results being copied pub fn prepare(self: *ServerRequest) void { self.buffer = std.heap.FixedBufferAllocator.init(self.storage); // Setup the stream self.response.prepare(); // Replace the allocator so request handlers have limited memory self.response.allocator = &self.buffer.allocator; } // Reset so it can be reused pub fn reset(self: *ServerRequest) void { self.buffer.reset(); self.request.reset(); self.response.reset(); self.err = null; self.handler = null; self.state = .Start; } // Release this request back into the pool pub fn release(self: *ServerRequest) void { self.stream = null; const app = self.application; const lock = app.request_pool.lock.acquire(); defer lock.release(); app.request_pool.release(self); } pub fn deinit(self: *ServerRequest) void { self.request.deinit(); self.response.deinit(); self.allocator.free(self.storage); } }; // A single client connection // if the client requests keep-alive and the server allows // the connection is reused to process futher requests. pub const ServerConnection = struct { const Frame = @Frame(startRequestLoop); const RequestList = std.ArrayList(*ServerRequest); application: *Application, io: IOStream = undefined, address: net.Address = undefined, frame: *Frame, // Outstanding requests //requests: RequestList, pub fn init(allocator: *Allocator, app: *Application) !ServerConnection { return ServerConnection{ .application = app, .io = try IOStream.initCapacity(allocator, null, 0, mem.page_size), .frame = try allocator.create(Frame), }; } // Handles a connection pub fn startRequestLoop(self: *ServerConnection, conn: net.StreamServer.Connection) !void { defer self.release(); self.requestLoop(conn) catch |err| { log.err("unexpected error: {s}", .{@errorName(err)}); }; // log.debug("Closed {}", .{conn}); } fn requestLoop(self: *ServerConnection, conn: net.StreamServer.Connection) !void { self.address = conn.address; const app = self.application; const params = &app.options; const stream = &self.io.writer(); self.io.reinit(conn.stream); defer self.io.close(); // Grab a request // at some point this should be moved into the loop to handle // pipelining but it currently makes it slower var server_request: *ServerRequest = undefined; { const lock = app.request_pool.lock.acquire(); defer lock.release(); if (app.request_pool.get()) |c| { server_request = c; } else { server_request = try app.request_pool.create(); server_request.* = try ServerRequest.init(app.allocator, app); server_request.prepare(); } } server_request.stream = &self.io; defer server_request.release(); const request = &server_request.request; const response = &server_request.response; const options = Request.ParseOptions{ .max_request_line_size = params.max_request_line_size, .max_header_size = params.max_request_headers_size, .max_content_length = params.max_content_length, .dump_buffer = params.dump_request_buffer, }; request.client = conn.address; request.stream = &self.io; defer request.stream = null; // Start serving requests while (true) { defer server_request.reset(); var processed_response = false; // Parse the request line and headers request.parse(&self.io, options) catch |err| switch (err) { error.ConnectionResetByPeer, error.BrokenPipe, error.EndOfStream => return, // Ignore else => { server_request.err = err; // if (params.debug) { // if (@errorReturnTrace()) |trace| { // try std.debug.writeStackTrace( // trace.*, // &std.io.getStdErr().writer(), // response.allocator, // try std.debug.getSelfDebugInfo(), // std.debug.detectTTYConfig()); // } // } } }; // Get the function used to build the handler for the request // if this is null it means that handler should not be used // as one of the middleware handlers took care of it const intercepted = try app.processRequest(server_request); // Let middleware cleanup errdefer if (!processed_response) app.processResponse(server_request) catch |err| { log.err("unexpected processing response: {}", .{err}); }; if (server_request.err == null and !intercepted) { app.execute(server_request) catch |err| { server_request.err = err; }; } // If the request handler didn't read the body, do it now if (!request.read_finished) { request.readBody(&self.io) catch |err| { if (server_request.err == null) { server_request.err = err; } }; } // If an error ocurred during parsing or running the handler // invoke the error handler if (server_request.err) |err| { try app.error_handler(server_request); switch (err) { error.BrokenPipe, error.EndOfStream, error.ConnectionResetByPeer, error.NotOpenForReading => { self.io.closed = true; // Make sure no response is sent // Only log if it was a partial request if (request.method != .Unknown) { log.warn("connection error: {} {}", .{err, self.address}); } }, else => { if (self.application.options.debug) { log.warn("server error: {} {}", .{err, request}); } else { log.warn("server error: {} {}", .{err, self.address}); } }, } } // Let middleware process the response processed_response = true; try app.processResponse(server_request); // Request handler already sent the response if (self.io.closed or response.finished) return; try self.sendResponse(server_request); const keep_alive = self.canKeepAlive(request); if (self.io.closed or !keep_alive) return; } } fn canKeepAlive(self: *ServerConnection, request: *Request) bool { const headers = &request.headers; if (request.version == .Http1_1) { return !headers.eqlIgnoreCase("Connection", "close"); } else if (headers.contains("Content-Length") or headers.eqlIgnoreCase("Transfer-Encoding", "chunked") or request.method == .Head or request.method == .Get){ return headers.eqlIgnoreCase("Connection", "keep-alive"); } return false; } // Write the request pub fn sendResponse(self: *ServerConnection, server_request: *ServerRequest) !void { const request = &server_request.request; const response = &server_request.response; const stream = &self.io.writer(); const content_length = response.body.items.len; // Write status line try stream.print("HTTP/1.1 {d} {s}\r\n", .{ response.status.code, response.status.phrase }); // Write headers for (response.headers.headers.items) |header| { try stream.print("{s}: {s}\r\n", .{header.key, header.value}); } // Set default content type if (!response.headers.contains("Content-Type")) { _ = try stream.write("Content-Type: text/html\r\n"); } // Send content length if missing otherwise the client hangs reading if (!response.send_stream and !response.headers.contains("Content-Length")) { try stream.print("Content-Length: {d}\r\n", .{content_length}); } // End of headers try stream.writeAll("\r\n"); server_request.state = .Finish; // Write body // if (response.chunking_output) { // var start = 0; // TODO // // try stream.write("0\r\n\r\n"); // } var total_wrote: usize = 0; if (response.send_stream) { try self.application.execute(server_request); } else if (response.body.items.len > 0) { try stream.writeAll(response.body.items); total_wrote += response.body.items.len; } // Flush anything left try self.io.flush(); // Make sure the content-length was correct otherwise the client // will hang waiting if (!response.send_stream and total_wrote != content_length) { log.warn("Response content-length is invalid: {} != {}", .{total_wrote, content_length}); return error.ServerError; } // Finish // If the app finished the request while we're still reading, // divert any remaining data away from the delegate and // close the connection when we're done sending our response. // Closing the connection is the only way to avoid reading the // whole input body. if (!request.read_finished or response.disconnect_on_finish) { self.io.close(); } response.finished = true; } pub fn release(self: *ServerConnection) void { const app = self.application; const lock = app.connection_pool.lock.acquire(); defer lock.release(); app.connection_pool.release(self); } pub fn deinit(self: *ServerConnection) void { const allocator = self.application.allocator; allocator.destroy(self.frame); self.io.deinit(); } }; pub const Route = struct { name: []const u8, // Reverse url name pattern: []const u8, handler: Handler, // Create a route for the handler // It uses a django style format for parameters, eg // /pages/<int>/edit pub fn create(comptime name: []const u8, comptime path: []const u8, comptime T: type) Route { if (path[0] != '/') { @compileError("Route url path must start with /"); } return Route{ .name=name, .pattern=path, .handler=createHandler(T) }; } pub fn static(comptime name: []const u8, comptime path: []const u8, comptime file_path: []const u8) Route { if (path.len < 2 or path[0] != '/' or path[path.len-1] != '/') { @compileError("Route url path must start and end with /"); } return Route{ .name=name, .pattern=path++".*", .handler=createHandler(handlers.StaticFileHandler(path, file_path)), }; } pub fn websocket(comptime name: []const u8, comptime path: []const u8, comptime T: type) Route { return create(name, path, handlers.WebsocketHandler(T)); } }; pub const Clock = struct { buffer: [32]u8 = undefined, last_updated: i64 = 0, lock: util.Lock = util.Lock{}, value: []const u8 = "", pub fn get(self: *Clock) []const u8 { var lock = self.lock.acquire(); defer lock.release(); return self.value; } pub fn update(self: *Clock) void { const t = time.milliTimestamp(); if (t - self.last_updated > 1000) { var lock = self.lock.acquire(); defer lock.release(); self.value = Datetime.formatHttpFromTimestamp( &self.buffer, t) catch unreachable; self.last_updated = t; } } }; const default_route = [_]Route{ Route.create("index", "/", handlers.IndexHandler), }; pub const Middleware = struct { init: ?fn(app: *Application) anyerror!void = null, processRequest: ?Handler = null, processResponse: ?Handler = null, deinit: ?fn(app: *Application) void = null, pub fn create(comptime T: type) Middleware { return Middleware{ .init = if (@hasDecl(T, "init")) T.init else null, .processRequest = if (@hasDecl(T, "processRequest")) T.processRequest else null, .processResponse = if (@hasDecl(T, "processResponse")) T.processResponse else null, .deinit = if (@hasDecl(T, "deinit")) T.deinit else null, }; } }; const default_middleware = [_]Middleware{}; pub const Application = struct { pub const ConnectionPool = util.ObjectPool(ServerConnection); pub const RequestPool = util.ObjectPool(ServerRequest); pub const Options = struct { xheaders: bool = false, protocol: []const u8 = "HTTP/1.1", decompress_request: bool = false, chunk_size: u32 = 65536, /// Will only parse this many request headers max_header_count: usize = 32, max_cookie_count: usize = 32, // If headers are longer than this return a request headers too large error max_request_headers_size: u32 = 10*1024, /// Size of request buffer request_buffer_size: u32 = 65536, // Fixed memory buffer size for request handlers to allocate in handler_buffer_size: u32 = 5*1024, // If request line is longer than this return a request uri too long error max_request_line_size: u32 = 4096, // Log request buffer dump_request_buffer: bool = false, // If the content length is over the request buffer size // it will spool to a temp file on disk up to this size max_content_length: u64 = 50*1024*1024, // 50 MB /// Size of response buffer response_buffer_size: u32 = 65536, /// Initial number of response headers to allocate response_header_count: u8 = 12, // Timeout in millis idle_connection_timeout: u32 = 300 * time.ms_per_s, // 5 min header_timeout: u32 = 300 * time.ms_per_s, // 5 min body_timeout: u32 = 900 * time.ms_per_s, // 15 min // List of trusted downstream (ie proxy) servers trust_x_headers: bool = true, server_options: net.StreamServer.Options = net.StreamServer.Options{ .kernel_backlog = 1024, .reuse_address = true, }, // Salt secret_key: []const u8 = "DoNotUSEthis_in[production]", // Debugging debug: bool = false, }; // ------------------------------------------------------------------------ // Server Config // ------------------------------------------------------------------------ pub const routes: []const Route = if (@hasDecl(root, "routes")) root.routes[0..] else default_route[0..]; pub const middleware: []const Middleware = if (@hasDecl(root, "middleware")) root.middleware[0..] else default_middleware[0..]; pub const error_handler = createHandler(if (@hasDecl(root, "error_handler")) root.error_handler else handlers.ServerErrorHandler); pub const not_found_handler = createHandler(if (@hasDecl(root, "not_found_handler")) root.not_found_handler else handlers.NotFoundHandler); pub var instance: ?*Application = null; // ------------------------------------------------------------------------ // Server setup // ------------------------------------------------------------------------ allocator: *Allocator, server: net.StreamServer, connection_pool: ConnectionPool, request_pool: RequestPool, running: bool = false, options: Options, clock: Clock = Clock{}, // ------------------------------------------------------------------------ // Setup // ------------------------------------------------------------------------ pub fn init(allocator: *Allocator, options: Options,) Application { mimetypes.instance = mimetypes.Registry.init(allocator); return Application{ .allocator = allocator, .options = options, .server = net.StreamServer.init(options.server_options), .connection_pool = ConnectionPool.init(allocator), .request_pool = RequestPool.init(allocator), }; } pub fn listen(self: *Application, address: []const u8, port: u16) !void { const addr = try net.Address.parseIp4(address, port); try self.server.listen(addr); log.info("Listing on {s}:{d}\n", .{address, port}); } // Start serving requests For each incoming connection. // The connections may be kept alive to handle more than one request. pub fn start(self: *Application) !void { try mimetypes.instance.?.load(); self.clock.update(); // Ignore sigpipe var act = os.Sigaction{ .handler = .{.sigaction = os.SIG_IGN }, .mask = os.empty_sigset, .flags = 0, }; os.sigaction(os.SIGPIPE, &act, null); Application.instance = self; self.running = true; // Init middleware inline for (middleware) |m| { if (m.init) |f| { try f(self); } } var background = async self.backgroundLoop(); // Make sure the background task stops if an error occurs defer { self.running = false; await background; } while (self.running) { // Grab a frame const lock = self.connection_pool.lock.acquire(); var server_conn: *ServerConnection = undefined; if (self.connection_pool.get()) |c| { server_conn = c; } else { server_conn = try self.connection_pool.create(); server_conn.* = try ServerConnection.init(self.allocator, self); //server_conn.server_request.prepare(); } lock.release(); const conn = try self.server.accept(); //log.debug("Accepted {s}", .{conn}); // Start processing requests if (comptime std.io.is_async) { server_conn.frame.* = async server_conn.startRequestLoop(conn); } else { try server_conn.startRequestLoop(conn); } } } // ------------------------------------------------------------------------ // Routing and Middleware // ------------------------------------------------------------------------ pub fn processRequest(self: *Application, server_request: *ServerRequest) !bool { // Let middleware process the request // the request body has not yet been read at this point // if the middleware returns true the response is considered to be // handled and request processing stops here inline for (middleware) |m| { if (m.processRequest) |f| { try f(self, server_request); if (server_request.response.finished) return true; } } return false; } pub fn execute(self: *Application, server_request: *ServerRequest) !void { // Inline the routing to avoid using function pointers and async call // which seems to have a pretty significant effect on speed @setEvalBranchQuota(50000); const path = server_request.request.path; inline for (routes) |*route| { if (try regex.match(route.pattern, .{.encoding=.ascii}, path)) |*match| { //std.debug.warn("Route: name={s} path={s}\n", .{route.name, request.path}); if (match.captures.len > 0) { server_request.request.args = match.captures[0..]; } try route.handler(self, server_request); return; } } try self.not_found_handler(server_request); } pub fn processResponse(self: *Application, server_request: *ServerRequest) !void { const request = &server_request.request; const response = &server_request.response; // Add server headers try response.headers.append("Server", "ZHP/0.1"); // TODO: Does this need to use the lock try response.headers.append("Date", self.clock.value); inline for (middleware) |m| { if (m.processResponse) |f| { try f(self, server_request); } } } // ------------------------------------------------------------------------ // Cleanup // ------------------------------------------------------------------------ // Periodically go through the pools and cleanup pub fn backgroundLoop(self: *Application) void { while (self.running) { time.sleep(1*time.ns_per_s); self.clock.update(); { var lock = self.connection_pool.lock.acquire(); defer lock.release(); if (self.connection_pool.free_objects.popOrNull()) |conn| { conn.deinit(); self.connection_pool.allocator.destroy(conn); } } { var lock = self.request_pool.lock.acquire(); defer lock.release(); if (self.request_pool.free_objects.popOrNull()) |req| { req.deinit(); self.request_pool.allocator.destroy(req); } } } } pub fn closeAllConnections(self: *Application) void { const lock = self.connection_pool.lock.acquire(); defer lock.release(); var n: usize = 0; for (self.connection_pool.objects.items) |server_conn| { if (!server_conn.io.closed) continue; server_conn.io.close(); n += 1; } log.info(" Closed {d} connections.", .{n}); } pub fn deinit(self: *Application) void { log.info(" Shutting down...", .{}); // Init middleware inline for (middleware) |m| { if (m.deinit) |f| { f(self); } } self.closeAllConnections(); self.server.deinit(); self.connection_pool.deinit(); self.request_pool.deinit(); } }; test "app" { std.testing.refAllDecls(@This()); }
src/app.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const Module = @import("Module.zig"); const fs = std.fs; const trace = @import("tracy.zig").trace; const Package = @import("Package.zig"); const Type = @import("type.zig").Type; const build_options = @import("build_options"); pub const producer_string = if (std.builtin.is_test) "zig test" else "zig " ++ build_options.version; pub const Options = struct { target: std.Target, output_mode: std.builtin.OutputMode, link_mode: std.builtin.LinkMode, object_format: std.builtin.ObjectFormat, optimize_mode: std.builtin.Mode, root_name: []const u8, root_pkg: *const Package, /// Used for calculating how much space to reserve for symbols in case the binary file /// does not already have a symbol table. symbol_count_hint: u64 = 32, /// Used for calculating how much space to reserve for executable program code in case /// the binary file deos not already have such a section. program_code_size_hint: u64 = 256 * 1024, entry_addr: ?u64 = null, }; pub const File = struct { tag: Tag, options: Options, file: ?fs.File, allocator: *Allocator, pub const LinkBlock = union { elf: Elf.TextBlock, macho: MachO.TextBlock, c: void, wasm: void, }; pub const LinkFn = union { elf: Elf.SrcFn, macho: MachO.SrcFn, c: void, wasm: ?Wasm.FnData, }; /// For DWARF .debug_info. pub const DbgInfoTypeRelocsTable = std.HashMapUnmanaged(Type, DbgInfoTypeReloc, Type.hash, Type.eql, std.hash_map.DefaultMaxLoadPercentage); /// For DWARF .debug_info. pub const DbgInfoTypeReloc = struct { /// Offset from `TextBlock.dbg_info_off` (the buffer that is local to a Decl). /// This is where the .debug_info tag for the type is. off: u32, /// Offset from `TextBlock.dbg_info_off` (the buffer that is local to a Decl). /// List of DW.AT_type / DW.FORM_ref4 that points to the type. relocs: std.ArrayListUnmanaged(u32), }; /// Attempts incremental linking, if the file already exists. If /// incremental linking fails, falls back to truncating the file and /// rewriting it. A malicious file is detected as incremental link failure /// and does not cause Illegal Behavior. This operation is not atomic. pub fn openPath(allocator: *Allocator, dir: fs.Dir, sub_path: []const u8, options: Options) !*File { switch (options.object_format) { .unknown => unreachable, .coff => return error.TODOImplementCoff, .elf => return Elf.openPath(allocator, dir, sub_path, options), .macho => return MachO.openPath(allocator, dir, sub_path, options), .wasm => return Wasm.openPath(allocator, dir, sub_path, options), .c => return C.openPath(allocator, dir, sub_path, options), .hex => return error.TODOImplementHex, .raw => return error.TODOImplementRaw, } } pub fn cast(base: *File, comptime T: type) ?*T { if (base.tag != T.base_tag) return null; return @fieldParentPtr(T, "base", base); } pub fn makeWritable(base: *File, dir: fs.Dir, sub_path: []const u8) !void { switch (base.tag) { .elf, .macho => { if (base.file != null) return; base.file = try dir.createFile(sub_path, .{ .truncate = false, .read = true, .mode = determineMode(base.options), }); }, .c, .wasm => {}, } } pub fn makeExecutable(base: *File) !void { switch (base.tag) { .c => unreachable, .wasm => {}, else => if (base.file) |f| { f.close(); base.file = null; }, } } /// May be called before or after updateDeclExports but must be called /// after allocateDeclIndexes for any given Decl. pub fn updateDecl(base: *File, module: *Module, decl: *Module.Decl) !void { switch (base.tag) { .elf => return @fieldParentPtr(Elf, "base", base).updateDecl(module, decl), .macho => return @fieldParentPtr(MachO, "base", base).updateDecl(module, decl), .c => return @fieldParentPtr(C, "base", base).updateDecl(module, decl), .wasm => return @fieldParentPtr(Wasm, "base", base).updateDecl(module, decl), } } pub fn updateDeclLineNumber(base: *File, module: *Module, decl: *Module.Decl) !void { switch (base.tag) { .elf => return @fieldParentPtr(Elf, "base", base).updateDeclLineNumber(module, decl), .macho => return @fieldParentPtr(MachO, "base", base).updateDeclLineNumber(module, decl), .c, .wasm => {}, } } /// Must be called before any call to updateDecl or updateDeclExports for /// any given Decl. pub fn allocateDeclIndexes(base: *File, decl: *Module.Decl) !void { switch (base.tag) { .elf => return @fieldParentPtr(Elf, "base", base).allocateDeclIndexes(decl), .macho => return @fieldParentPtr(MachO, "base", base).allocateDeclIndexes(decl), .c, .wasm => {}, } } pub fn deinit(base: *File) void { if (base.file) |f| f.close(); switch (base.tag) { .elf => @fieldParentPtr(Elf, "base", base).deinit(), .macho => @fieldParentPtr(MachO, "base", base).deinit(), .c => @fieldParentPtr(C, "base", base).deinit(), .wasm => @fieldParentPtr(Wasm, "base", base).deinit(), } } pub fn destroy(base: *File) void { switch (base.tag) { .elf => { const parent = @fieldParentPtr(Elf, "base", base); parent.deinit(); base.allocator.destroy(parent); }, .macho => { const parent = @fieldParentPtr(MachO, "base", base); parent.deinit(); base.allocator.destroy(parent); }, .c => { const parent = @fieldParentPtr(C, "base", base); parent.deinit(); base.allocator.destroy(parent); }, .wasm => { const parent = @fieldParentPtr(Wasm, "base", base); parent.deinit(); base.allocator.destroy(parent); }, } } pub fn flush(base: *File, module: *Module) !void { const tracy = trace(@src()); defer tracy.end(); try switch (base.tag) { .elf => @fieldParentPtr(Elf, "base", base).flush(module), .macho => @fieldParentPtr(MachO, "base", base).flush(module), .c => @fieldParentPtr(C, "base", base).flush(module), .wasm => @fieldParentPtr(Wasm, "base", base).flush(module), }; } pub fn freeDecl(base: *File, decl: *Module.Decl) void { switch (base.tag) { .elf => @fieldParentPtr(Elf, "base", base).freeDecl(decl), .macho => @fieldParentPtr(MachO, "base", base).freeDecl(decl), .c => unreachable, .wasm => @fieldParentPtr(Wasm, "base", base).freeDecl(decl), } } pub fn errorFlags(base: *File) ErrorFlags { return switch (base.tag) { .elf => @fieldParentPtr(Elf, "base", base).error_flags, .macho => @fieldParentPtr(MachO, "base", base).error_flags, .c => return .{ .no_entry_point_found = false }, .wasm => return ErrorFlags{}, }; } /// May be called before or after updateDecl, but must be called after /// allocateDeclIndexes for any given Decl. pub fn updateDeclExports( base: *File, module: *Module, decl: *const Module.Decl, exports: []const *Module.Export, ) !void { switch (base.tag) { .elf => return @fieldParentPtr(Elf, "base", base).updateDeclExports(module, decl, exports), .macho => return @fieldParentPtr(MachO, "base", base).updateDeclExports(module, decl, exports), .c => return {}, .wasm => return @fieldParentPtr(Wasm, "base", base).updateDeclExports(module, decl, exports), } } pub fn getDeclVAddr(base: *File, decl: *const Module.Decl) u64 { switch (base.tag) { .elf => return @fieldParentPtr(Elf, "base", base).getDeclVAddr(decl), .macho => return @fieldParentPtr(MachO, "base", base).getDeclVAddr(decl), .c => unreachable, .wasm => unreachable, } } pub const Tag = enum { elf, macho, c, wasm, }; pub const ErrorFlags = struct { no_entry_point_found: bool = false, }; pub const C = @import("link/C.zig"); pub const Elf = @import("link/Elf.zig"); pub const MachO = @import("link/MachO.zig"); pub const Wasm = @import("link/Wasm.zig"); }; pub fn determineMode(options: Options) fs.File.Mode { // On common systems with a 0o022 umask, 0o777 will still result in a file created // with 0o755 permissions, but it works appropriately if the system is configured // more leniently. As another data point, C's fopen seems to open files with the // 666 mode. const executable_mode = if (std.Target.current.os.tag == .windows) 0 else 0o777; switch (options.output_mode) { .Lib => return switch (options.link_mode) { .Dynamic => executable_mode, .Static => fs.File.default_mode, }, .Exe => return executable_mode, .Obj => return fs.File.default_mode, } }
src-self-hosted/link.zig
const std = @import("std"); const with_trace = true; const assert = std.debug.assert; fn trace(comptime fmt: []const u8, args: anytype) void { if (with_trace) std.debug.print(fmt, args); } const Replacement = struct { from: []const u8, to: []const u8, }; fn parse_line(line: []const u8) ?Replacement { // H => HO const trimmed = std.mem.trim(u8, line, " \n\r\t"); var sep = std.mem.indexOf(u8, trimmed, " => "); if (sep) |s| { return Replacement{ .from = line[0..s], .to = line[s + 4 ..] }; } else { return null; } } fn compute_mutation(molecule: []const u8, rule: Replacement, startindex: *usize, allocator: std.mem.Allocator) !?[]const u8 { var idx = std.mem.indexOfPos(u8, molecule, startindex.*, rule.from); if (idx) |i| { startindex.* = i + 1; const m = try allocator.alloc(u8, molecule.len + rule.to.len - rule.from.len); std.mem.copy(u8, m[0..i], molecule[0..i]); std.mem.copy(u8, m[i .. i + rule.to.len], rule.to); std.mem.copy(u8, m[i + rule.to.len ..], molecule[i + rule.from.len ..]); return m; } else { return null; } } fn compute_reversemutation(molecule: []const u8, rule: Replacement, startindex: *usize, memory: []u8) ?[]const u8 { var idx = std.mem.indexOfPos(u8, molecule, startindex.*, rule.to); if (idx) |i| { startindex.* = i + 1; const m = memory[0 .. molecule.len + rule.from.len - rule.to.len]; std.mem.copy(u8, m[0..i], molecule[0..i]); std.mem.copy(u8, m[i .. i + rule.from.len], rule.from); std.mem.copy(u8, m[i + rule.from.len ..], molecule[i + rule.to.len ..]); return m; } else { return null; } } fn dfs(molecule: []const u8, rules: []const Replacement, depth: u32) usize { if (molecule.len == 1 and molecule[0] == 'e') { trace("whooohho {}\n", depth); return depth; } var memory: [512]u8 = undefined; var min: usize = 9999; for (rules) |r| { var startindex: usize = 0; while (compute_reversemutation(molecule, r, &startindex, &memory)) |m| { const d = dfs(m, rules, depth + 1); if (d != 9999) { trace("after applying {}->{}, {}\n", r.from, r.to, molecule); return d; } min = if (d > min) min else d; } } return min; } pub fn main() anyerror!void { var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); defer arena.deinit(); const allocator = arena.allocator(); const limit = 1 * 1024 * 1024 * 1024; const text = try std.fs.cwd().readFileAlloc(allocator, "day19.txt", limit); const molecule = "CRnCaCaCaSiRnBPTiMgArSiRnSiRnMgArSiRnCaFArTiTiBSiThFYCaFArCaCaSiThCaPBSiThSiThCaCaPTiRnPBSiThRnFArArCaCaSiThCaSiThSiRnMgArCaPTiBPRnFArSiThCaSiRnFArBCaSiRnCaPRnFArPMgYCaFArCaPTiTiTiBPBSiThCaPTiBPBSiRnFArBPBSiRnCaFArBPRnSiRnFArRnSiRnBFArCaFArCaCaCaSiThSiThCaCaPBPTiTiRnFArCaPTiBSiAlArPBCaCaCaCaCaSiRnMgArCaSiThFArThCaSiThCaSiRnCaFYCaSiRnFYFArFArCaSiRnFYFArCaSiRnBPMgArSiThPRnFArCaSiRnFArTiRnSiRnFYFArCaSiRnBFArCaSiRnTiMgArSiThCaSiThCaFArPRnFArSiRnFArTiTiTiTiBCaCaSiRnCaCaFYFArSiThCaPTiBPTiBCaSiThSiRnMgArCaF"; var rules_mem: [1000]Replacement = undefined; var rules = rules_mem[0..0]; { var it = std.mem.tokenize(u8, text, "\n"); while (it.next()) |line| { const newrule = parse_line(line); if (newrule) |r| { trace("rule= {} -> {}\n", r.from, r.to); rules = rules_mem[0 .. rules.len + 1]; rules[rules.len - 1] = r; } } } // bon en fait en dfs et en prennant le plus gros qui matche ça donne le bon resultat. // mais c'est en fait que c'est pas random, et que c'est le règles d'une grammaire générative. var steps: usize = 0; steps = dfs(molecule, rules, 0); if (false) { var sets: [500]std.StringHashMap(bool) = undefined; for (sets) |*s| { s.* = std.StringHashMap(bool).init(allocator); } defer { for (sets) |*s| { s.deinit(); } } _ = try sets[0].put(molecule, true); var shortest: usize = 9999999; while (true) { for (rules) |r| { var step: u32 = 1; while (true) { const set = &sets[step]; const prevset = sets[step - 1]; if (prevset.count() == 0) break; var prevmolecules = prevset.iterator(); while (prevmolecules.next()) |it| { const base = it.key; var startindex: usize = 0; var memory: [512]u8 = undefined; while (compute_reversemutation(base, r, &startindex, &memory)) |m| { if (m.len < shortest) { shortest = m.len; } var dup = false; for (sets[0 .. step + 1]) |s| { if (set.get(m)) |_| { dup = true; } } if (!dup) { const newmol = try allocator.alloc(u8, m.len); std.mem.copy(u8, newmol, m); _ = try set.put(newmol, true); } } } step += 1; } trace("after applying {}->{}, shotest={}\n", r.to, r.from, shortest); for (sets) |*s| { const c = s.count(); trace(" {}\n", c); if (c == 0) break; } } } } const out = std.io.getStdOut().writer(); try out.print("ans = {}\n", steps); // return error.SolutionNotFound; }
2015/day19.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; const input = @embedFile("../input/day17.txt"); const Cube = struct { dim_x: usize, dim_y: usize, dim_z: usize, data: []bool, allocator: *Allocator, const Self = @This(); pub fn init(allocator: *Allocator, string: []const u8) !*Self { var dim: usize = 0; while (string[dim] != '\n') : (dim += 1) {} var cube = try create(allocator, dim, dim, 1); var lines = std.mem.tokenize(string, "\n"); var y: usize = 0; while (lines.next()) |line| : (y += 1) { for (line) |c, x| { if (c == '#') cube.setActive(x, y, 0, true); } } return cube; } pub fn create(allocator: *Allocator, dim_x: usize, dim_y: usize, dim_z: usize) !*Self { var data = try allocator.alloc(bool, dim_x * dim_y * dim_z); std.mem.set(bool, data, false); var cube = try allocator.create(Self); cube.* = Self{ .dim_x = dim_x, .dim_y = dim_y, .dim_z = dim_z, .data = data, .allocator = allocator, }; return cube; } pub fn deinit(self: *Self) void { self.allocator.free(self.data); self.allocator.destroy(self); } pub fn step(self: Self) !*Self { var src = try self.expand(2); defer src.deinit(); var next = try create(self.allocator, self.dim_x + 2, self.dim_y + 2, self.dim_z + 2); defer next.deinit(); var min_x: usize = next.dim_x; var min_y: usize = next.dim_y; var min_z: usize = next.dim_z; var max_x: usize = 0; var max_y: usize = 0; var max_z: usize = 0; var z: usize = 0; while (z < next.dim_z) : (z += 1) { var y: usize = 0; while (y < next.dim_y) : (y += 1) { var x: usize = 0; while (x < next.dim_x) : (x += 1) { var n: usize = 0; var dz: usize = 0; while (dz < 3) : (dz += 1) { var dy: usize = 0; while (dy < 3) : (dy += 1) { var dx: usize = 0; while (dx < 3) : (dx += 1) { if (dx == 1 and dy == 1 and dz == 1) continue; if (src.isActive(x + dx, y + dy, z + dz)) n += 1; } } } if (src.isActive(x + 1, y + 1, z + 1)) { next.setActive(x, y, z, n == 2 or n == 3); } else { next.setActive(x, y, z, n == 3); } if (next.isActive(x, y, z)) { min_x = std.math.min(x, min_x); min_y = std.math.min(y, min_y); min_z = std.math.min(z, min_z); max_x = std.math.max(x, max_x); max_y = std.math.max(y, max_y); max_z = std.math.max(z, max_z); } } } } return try next.shrink(min_x, max_x, min_y, max_y, min_z, max_z); } fn expand(self: Self, e: usize) !*Self { var result = try Self.create(self.allocator, self.dim_x + 2 * e, self.dim_y + 2 * e, self.dim_z + 2 * e); var z: usize = 0; while (z < self.dim_z) : (z += 1) { var y: usize = 0; while (y < self.dim_y) : (y += 1) { var x: usize = 0; while (x < self.dim_x) : (x += 1) { result.setActive(e + x, e + y, e + z, self.isActive(x, y, z)); } } } return result; } fn shrink(self: Self, min_x: usize, max_x: usize, min_y: usize, max_y: usize, min_z: usize, max_z: usize) !*Self { assert(min_x < max_x); assert(min_y < max_y); assert(min_z < max_z); var result = try Self.create(self.allocator, max_x + 1 - min_x, max_y + 1 - min_y, max_z + 1 - min_z); var z: usize = 0; while (z < result.dim_z) : (z += 1) { var y: usize = 0; while (y < result.dim_y) : (y += 1) { var x: usize = 0; while (x < result.dim_x) : (x += 1) { result.setActive(x, y, z, self.isActive(min_x + x, min_y + y, min_z + z)); } } } return result; } fn index(self: Self, x: usize, y: usize, z: usize) usize { return z * self.dim_y * self.dim_x + y * self.dim_x + x; } fn isActive(self: Self, x: usize, y: usize, z: usize) bool { return self.data[self.index(x, y, z)]; } fn setActive(self: *Self, x: usize, y: usize, z: usize, active: bool) void { self.data[self.index(x, y, z)] = active; } fn numActive(self: Self) usize { var num: usize = 0; for (self.data) |b| { if (b) num += 1; } return num; } fn print(self: Self) void { var z: usize = 0; while (z < self.dim_z) : (z += 1) { print("\nz={}\n", .{z}); var y: usize = 0; while (y < self.dim_y) : (y += 1) { var x: usize = 0; while (x < self.dim_x) : (x += 1) { if (self.isActive(x, y, z)) { print("#", .{}); } else { print(".", .{}); } } print("\n", .{}); } } } }; const HyperCube = struct { dim_x: usize, dim_y: usize, dim_z: usize, dim_w: usize, data: []bool, allocator: *Allocator, const Self = @This(); pub fn init(allocator: *Allocator, string: []const u8) !*Self { var dim: usize = 0; while (string[dim] != '\n') : (dim += 1) {} var cube = try create(allocator, dim, dim, 1, 1); var lines = std.mem.tokenize(string, "\n"); var y: usize = 0; while (lines.next()) |line| : (y += 1) { for (line) |c, x| { if (c == '#') cube.setActive(x, y, 0, 0, true); } } return cube; } pub fn create(allocator: *Allocator, dim_x: usize, dim_y: usize, dim_z: usize, dim_w: usize) !*Self { var data = try allocator.alloc(bool, dim_x * dim_y * dim_z * dim_w); std.mem.set(bool, data, false); var cube = try allocator.create(Self); cube.* = Self{ .dim_x = dim_x, .dim_y = dim_y, .dim_z = dim_z, .dim_w = dim_w, .data = data, .allocator = allocator, }; return cube; } pub fn deinit(self: *Self) void { self.allocator.free(self.data); self.allocator.destroy(self); } pub fn step(self: Self) !*Self { var src = try self.expand(2); defer src.deinit(); var next = try create(self.allocator, self.dim_x + 2, self.dim_y + 2, self.dim_z + 2, self.dim_w + 2); defer next.deinit(); var min_x: usize = next.dim_x; var min_y: usize = next.dim_y; var min_z: usize = next.dim_z; var min_w: usize = next.dim_w; var max_x: usize = 0; var max_y: usize = 0; var max_z: usize = 0; var max_w: usize = 0; var w: usize = 0; while (w < next.dim_w) : (w += 1) { var z: usize = 0; while (z < next.dim_z) : (z += 1) { var y: usize = 0; while (y < next.dim_y) : (y += 1) { var x: usize = 0; while (x < next.dim_x) : (x += 1) { var n: usize = 0; var dw: usize = 0; while (dw < 3) : (dw += 1) { var dz: usize = 0; while (dz < 3) : (dz += 1) { var dy: usize = 0; while (dy < 3) : (dy += 1) { var dx: usize = 0; while (dx < 3) : (dx += 1) { if (dx == 1 and dy == 1 and dz == 1 and dw == 1) continue; if (src.isActive(x + dx, y + dy, z + dz, w + dw)) n += 1; } } } } if (src.isActive(x + 1, y + 1, z + 1, w + 1)) { next.setActive(x, y, z, w, n == 2 or n == 3); } else { next.setActive(x, y, z, w, n == 3); } if (next.isActive(x, y, z, w)) { min_x = std.math.min(x, min_x); min_y = std.math.min(y, min_y); min_z = std.math.min(z, min_z); min_w = std.math.min(w, min_w); max_x = std.math.max(x, max_x); max_y = std.math.max(y, max_y); max_z = std.math.max(z, max_z); max_w = std.math.max(w, max_w); } } } } } return try next.shrink(min_x, max_x, min_y, max_y, min_z, max_z, min_w, max_w); } fn expand(self: Self, e: usize) !*Self { var result = try Self.create(self.allocator, self.dim_x + 2 * e, self.dim_y + 2 * e, self.dim_z + 2 * e, self.dim_w + 2 * e); var w: usize = 0; while (w < self.dim_w) : (w += 1) { var z: usize = 0; while (z < self.dim_z) : (z += 1) { var y: usize = 0; while (y < self.dim_y) : (y += 1) { var x: usize = 0; while (x < self.dim_x) : (x += 1) { result.setActive(e + x, e + y, e + z, e + w, self.isActive(x, y, z, w)); } } } } return result; } fn shrink(self: Self, min_x: usize, max_x: usize, min_y: usize, max_y: usize, min_z: usize, max_z: usize, min_w: usize, max_w: usize) !*Self { assert(min_x < max_x); assert(min_y < max_y); assert(min_z < max_z); var result = try Self.create(self.allocator, max_x + 1 - min_x, max_y + 1 - min_y, max_z + 1 - min_z, max_w + 1 - min_w); var w: usize = 0; while (w < result.dim_w) : (w += 1) { var z: usize = 0; while (z < result.dim_z) : (z += 1) { var y: usize = 0; while (y < result.dim_y) : (y += 1) { var x: usize = 0; while (x < result.dim_x) : (x += 1) { result.setActive(x, y, z, w, self.isActive(min_x + x, min_y + y, min_z + z, min_w + w)); } } } } return result; } fn index(self: Self, x: usize, y: usize, z: usize, w: usize) usize { return w * self.dim_z * self.dim_y * self.dim_x + z * self.dim_y * self.dim_x + y * self.dim_x + x; } fn isActive(self: Self, x: usize, y: usize, z: usize, w: usize) bool { return self.data[self.index(x, y, z, w)]; } fn setActive(self: *Self, x: usize, y: usize, z: usize, w: usize, active: bool) void { self.data[self.index(x, y, z, w)] = active; } fn numActive(self: Self) usize { var num: usize = 0; for (self.data) |b| { if (b) num += 1; } return num; } }; pub fn main() !void { var gpa = std.heap.GeneralPurposeAllocator(.{}){}; var allocator = &gpa.allocator; var cube = try Cube.init(allocator, input); defer cube.deinit(); var i: usize = 0; while (i < 6) : (i += 1) { //cube.print(); var next = try cube.step(); cube.deinit(); cube = next; } print("part1: {}\n", .{cube.numActive()}); var hyper_cube = try HyperCube.init(allocator, input); defer hyper_cube.deinit(); i = 0; while (i < 6) : (i += 1) { var next = try hyper_cube.step(); hyper_cube.deinit(); hyper_cube = next; } print("part2: {}\n", .{hyper_cube.numActive()}); } const example = \\.#. \\..# \\### ;
src/day17.zig
pub const NETWORK_ALIVE_LAN = @as(u32, 1); pub const NETWORK_ALIVE_WAN = @as(u32, 2); pub const NETWORK_ALIVE_AOL = @as(u32, 4); pub const NETWORK_ALIVE_INTERNET = @as(u32, 8); pub const CONNECTION_AOL = @as(u32, 4); pub const SENSGUID_PUBLISHER = Guid.initString("5fee1bd6-5b9b-11d1-8dd2-00aa004abd5e"); pub const SENSGUID_SUBSCRIBER_LCE = Guid.initString("d3938ab0-5b9d-11d1-8dd2-00aa004abd5e"); pub const SENSGUID_SUBSCRIBER_WININET = Guid.initString("d3938ab5-5b9d-11d1-8dd2-00aa004abd5e"); pub const SENSGUID_EVENTCLASS_NETWORK = Guid.initString("d5978620-5b9f-11d1-8dd2-00aa004abd5e"); pub const SENSGUID_EVENTCLASS_LOGON = Guid.initString("d5978630-5b9f-11d1-8dd2-00aa004abd5e"); pub const SENSGUID_EVENTCLASS_ONNOW = Guid.initString("d5978640-5b9f-11d1-8dd2-00aa004abd5e"); pub const SENSGUID_EVENTCLASS_LOGON2 = Guid.initString("d5978650-5b9f-11d1-8dd2-00aa004abd5e"); //-------------------------------------------------------------------------------- // Section: Types (8) //-------------------------------------------------------------------------------- pub const SENS_CONNECTION_TYPE = enum(u32) { LAN = 0, WAN = 1, }; pub const CONNECTION_LAN = SENS_CONNECTION_TYPE.LAN; pub const CONNECTION_WAN = SENS_CONNECTION_TYPE.WAN; pub const QOCINFO = extern struct { dwSize: u32, dwFlags: u32, dwInSpeed: u32, dwOutSpeed: u32, }; const CLSID_SENS_Value = @import("../zig.zig").Guid.initString("d597cafe-5b9f-11d1-8dd2-00aa004abd5e"); pub const CLSID_SENS = &CLSID_SENS_Value; pub const SENS_QOCINFO = extern struct { dwSize: u32, dwFlags: u32, dwOutSpeed: u32, dwInSpeed: u32, }; // TODO: this type is limited to platform 'windows5.1.2600' const IID_ISensNetwork_Value = @import("../zig.zig").Guid.initString("d597bab1-5b9f-11d1-8dd2-00aa004abd5e"); pub const IID_ISensNetwork = &IID_ISensNetwork_Value; pub const ISensNetwork = extern struct { pub const VTable = extern struct { base: IDispatch.VTable, ConnectionMade: fn( self: *const ISensNetwork, bstrConnection: ?BSTR, ulType: u32, lpQOCInfo: ?*SENS_QOCINFO, ) callconv(@import("std").os.windows.WINAPI) HRESULT, ConnectionMadeNoQOCInfo: fn( self: *const ISensNetwork, bstrConnection: ?BSTR, ulType: u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, ConnectionLost: fn( self: *const ISensNetwork, bstrConnection: ?BSTR, ulType: SENS_CONNECTION_TYPE, ) callconv(@import("std").os.windows.WINAPI) HRESULT, DestinationReachable: fn( self: *const ISensNetwork, bstrDestination: ?BSTR, bstrConnection: ?BSTR, ulType: u32, lpQOCInfo: ?*SENS_QOCINFO, ) callconv(@import("std").os.windows.WINAPI) HRESULT, DestinationReachableNoQOCInfo: fn( self: *const ISensNetwork, bstrDestination: ?BSTR, bstrConnection: ?BSTR, ulType: u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IDispatch.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISensNetwork_ConnectionMade(self: *const T, bstrConnection: ?BSTR, ulType: u32, lpQOCInfo: ?*SENS_QOCINFO) callconv(.Inline) HRESULT { return @ptrCast(*const ISensNetwork.VTable, self.vtable).ConnectionMade(@ptrCast(*const ISensNetwork, self), bstrConnection, ulType, lpQOCInfo); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISensNetwork_ConnectionMadeNoQOCInfo(self: *const T, bstrConnection: ?BSTR, ulType: u32) callconv(.Inline) HRESULT { return @ptrCast(*const ISensNetwork.VTable, self.vtable).ConnectionMadeNoQOCInfo(@ptrCast(*const ISensNetwork, self), bstrConnection, ulType); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISensNetwork_ConnectionLost(self: *const T, bstrConnection: ?BSTR, ulType: SENS_CONNECTION_TYPE) callconv(.Inline) HRESULT { return @ptrCast(*const ISensNetwork.VTable, self.vtable).ConnectionLost(@ptrCast(*const ISensNetwork, self), bstrConnection, ulType); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISensNetwork_DestinationReachable(self: *const T, bstrDestination: ?BSTR, bstrConnection: ?BSTR, ulType: u32, lpQOCInfo: ?*SENS_QOCINFO) callconv(.Inline) HRESULT { return @ptrCast(*const ISensNetwork.VTable, self.vtable).DestinationReachable(@ptrCast(*const ISensNetwork, self), bstrDestination, bstrConnection, ulType, lpQOCInfo); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISensNetwork_DestinationReachableNoQOCInfo(self: *const T, bstrDestination: ?BSTR, bstrConnection: ?BSTR, ulType: u32) callconv(.Inline) HRESULT { return @ptrCast(*const ISensNetwork.VTable, self.vtable).DestinationReachableNoQOCInfo(@ptrCast(*const ISensNetwork, self), bstrDestination, bstrConnection, ulType); } };} pub usingnamespace MethodMixin(@This()); }; // TODO: this type is limited to platform 'windows5.1.2600' const IID_ISensOnNow_Value = @import("../zig.zig").Guid.initString("d597bab2-5b9f-11d1-8dd2-00aa004abd5e"); pub const IID_ISensOnNow = &IID_ISensOnNow_Value; pub const ISensOnNow = extern struct { pub const VTable = extern struct { base: IDispatch.VTable, OnACPower: fn( self: *const ISensOnNow, ) callconv(@import("std").os.windows.WINAPI) HRESULT, OnBatteryPower: fn( self: *const ISensOnNow, dwBatteryLifePercent: u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, BatteryLow: fn( self: *const ISensOnNow, dwBatteryLifePercent: u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IDispatch.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISensOnNow_OnACPower(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const ISensOnNow.VTable, self.vtable).OnACPower(@ptrCast(*const ISensOnNow, self)); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISensOnNow_OnBatteryPower(self: *const T, dwBatteryLifePercent: u32) callconv(.Inline) HRESULT { return @ptrCast(*const ISensOnNow.VTable, self.vtable).OnBatteryPower(@ptrCast(*const ISensOnNow, self), dwBatteryLifePercent); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISensOnNow_BatteryLow(self: *const T, dwBatteryLifePercent: u32) callconv(.Inline) HRESULT { return @ptrCast(*const ISensOnNow.VTable, self.vtable).BatteryLow(@ptrCast(*const ISensOnNow, self), dwBatteryLifePercent); } };} pub usingnamespace MethodMixin(@This()); }; // TODO: this type is limited to platform 'windows5.1.2600' const IID_ISensLogon_Value = @import("../zig.zig").Guid.initString("d597bab3-5b9f-11d1-8dd2-00aa004abd5e"); pub const IID_ISensLogon = &IID_ISensLogon_Value; pub const ISensLogon = extern struct { pub const VTable = extern struct { base: IDispatch.VTable, Logon: fn( self: *const ISensLogon, bstrUserName: ?BSTR, ) callconv(@import("std").os.windows.WINAPI) HRESULT, Logoff: fn( self: *const ISensLogon, bstrUserName: ?BSTR, ) callconv(@import("std").os.windows.WINAPI) HRESULT, StartShell: fn( self: *const ISensLogon, bstrUserName: ?BSTR, ) callconv(@import("std").os.windows.WINAPI) HRESULT, DisplayLock: fn( self: *const ISensLogon, bstrUserName: ?BSTR, ) callconv(@import("std").os.windows.WINAPI) HRESULT, DisplayUnlock: fn( self: *const ISensLogon, bstrUserName: ?BSTR, ) callconv(@import("std").os.windows.WINAPI) HRESULT, StartScreenSaver: fn( self: *const ISensLogon, bstrUserName: ?BSTR, ) callconv(@import("std").os.windows.WINAPI) HRESULT, StopScreenSaver: fn( self: *const ISensLogon, bstrUserName: ?BSTR, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IDispatch.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISensLogon_Logon(self: *const T, bstrUserName: ?BSTR) callconv(.Inline) HRESULT { return @ptrCast(*const ISensLogon.VTable, self.vtable).Logon(@ptrCast(*const ISensLogon, self), bstrUserName); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISensLogon_Logoff(self: *const T, bstrUserName: ?BSTR) callconv(.Inline) HRESULT { return @ptrCast(*const ISensLogon.VTable, self.vtable).Logoff(@ptrCast(*const ISensLogon, self), bstrUserName); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISensLogon_StartShell(self: *const T, bstrUserName: ?BSTR) callconv(.Inline) HRESULT { return @ptrCast(*const ISensLogon.VTable, self.vtable).StartShell(@ptrCast(*const ISensLogon, self), bstrUserName); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISensLogon_DisplayLock(self: *const T, bstrUserName: ?BSTR) callconv(.Inline) HRESULT { return @ptrCast(*const ISensLogon.VTable, self.vtable).DisplayLock(@ptrCast(*const ISensLogon, self), bstrUserName); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISensLogon_DisplayUnlock(self: *const T, bstrUserName: ?BSTR) callconv(.Inline) HRESULT { return @ptrCast(*const ISensLogon.VTable, self.vtable).DisplayUnlock(@ptrCast(*const ISensLogon, self), bstrUserName); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISensLogon_StartScreenSaver(self: *const T, bstrUserName: ?BSTR) callconv(.Inline) HRESULT { return @ptrCast(*const ISensLogon.VTable, self.vtable).StartScreenSaver(@ptrCast(*const ISensLogon, self), bstrUserName); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISensLogon_StopScreenSaver(self: *const T, bstrUserName: ?BSTR) callconv(.Inline) HRESULT { return @ptrCast(*const ISensLogon.VTable, self.vtable).StopScreenSaver(@ptrCast(*const ISensLogon, self), bstrUserName); } };} pub usingnamespace MethodMixin(@This()); }; // TODO: this type is limited to platform 'windows5.1.2600' const IID_ISensLogon2_Value = @import("../zig.zig").Guid.initString("d597bab4-5b9f-11d1-8dd2-00aa004abd5e"); pub const IID_ISensLogon2 = &IID_ISensLogon2_Value; pub const ISensLogon2 = extern struct { pub const VTable = extern struct { base: IDispatch.VTable, Logon: fn( self: *const ISensLogon2, bstrUserName: ?BSTR, dwSessionId: u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, Logoff: fn( self: *const ISensLogon2, bstrUserName: ?BSTR, dwSessionId: u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, SessionDisconnect: fn( self: *const ISensLogon2, bstrUserName: ?BSTR, dwSessionId: u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, SessionReconnect: fn( self: *const ISensLogon2, bstrUserName: ?BSTR, dwSessionId: u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, PostShell: fn( self: *const ISensLogon2, bstrUserName: ?BSTR, dwSessionId: u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IDispatch.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISensLogon2_Logon(self: *const T, bstrUserName: ?BSTR, dwSessionId: u32) callconv(.Inline) HRESULT { return @ptrCast(*const ISensLogon2.VTable, self.vtable).Logon(@ptrCast(*const ISensLogon2, self), bstrUserName, dwSessionId); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISensLogon2_Logoff(self: *const T, bstrUserName: ?BSTR, dwSessionId: u32) callconv(.Inline) HRESULT { return @ptrCast(*const ISensLogon2.VTable, self.vtable).Logoff(@ptrCast(*const ISensLogon2, self), bstrUserName, dwSessionId); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISensLogon2_SessionDisconnect(self: *const T, bstrUserName: ?BSTR, dwSessionId: u32) callconv(.Inline) HRESULT { return @ptrCast(*const ISensLogon2.VTable, self.vtable).SessionDisconnect(@ptrCast(*const ISensLogon2, self), bstrUserName, dwSessionId); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISensLogon2_SessionReconnect(self: *const T, bstrUserName: ?BSTR, dwSessionId: u32) callconv(.Inline) HRESULT { return @ptrCast(*const ISensLogon2.VTable, self.vtable).SessionReconnect(@ptrCast(*const ISensLogon2, self), bstrUserName, dwSessionId); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISensLogon2_PostShell(self: *const T, bstrUserName: ?BSTR, dwSessionId: u32) callconv(.Inline) HRESULT { return @ptrCast(*const ISensLogon2.VTable, self.vtable).PostShell(@ptrCast(*const ISensLogon2, self), bstrUserName, dwSessionId); } };} pub usingnamespace MethodMixin(@This()); }; //-------------------------------------------------------------------------------- // Section: Functions (3) //-------------------------------------------------------------------------------- // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SensApi" fn IsDestinationReachableA( lpszDestination: ?[*:0]const u8, lpQOCInfo: ?*QOCINFO, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SensApi" fn IsDestinationReachableW( lpszDestination: ?[*:0]const u16, lpQOCInfo: ?*QOCINFO, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SensApi" fn IsNetworkAlive( lpdwFlags: ?*u32, ) callconv(@import("std").os.windows.WINAPI) BOOL; //-------------------------------------------------------------------------------- // Section: Unicode Aliases (1) //-------------------------------------------------------------------------------- const thismodule = @This(); pub usingnamespace switch (@import("../zig.zig").unicode_mode) { .ansi => struct { pub const IsDestinationReachable = thismodule.IsDestinationReachableA; }, .wide => struct { pub const IsDestinationReachable = thismodule.IsDestinationReachableW; }, .unspecified => if (@import("builtin").is_test) struct { pub const IsDestinationReachable = *opaque{}; } else struct { pub const IsDestinationReachable = @compileError("'IsDestinationReachable' requires that UNICODE be set to true or false in the root module"); }, }; //-------------------------------------------------------------------------------- // Section: Imports (7) //-------------------------------------------------------------------------------- const Guid = @import("../zig.zig").Guid; const BOOL = @import("../foundation.zig").BOOL; const BSTR = @import("../foundation.zig").BSTR; const HRESULT = @import("../foundation.zig").HRESULT; const IDispatch = @import("../system/com.zig").IDispatch; const PSTR = @import("../foundation.zig").PSTR; const PWSTR = @import("../foundation.zig").PWSTR; test { @setEvalBranchQuota( @import("std").meta.declarations(@This()).len * 3 ); // reference all the pub declarations if (!@import("builtin").is_test) return; inline for (@import("std").meta.declarations(@This())) |decl| { if (decl.is_pub) { _ = decl; } } }
win32/system/event_notification_service.zig
const std = @import("std"); pub inline fn __builtin_bswap16(val: u16) u16 { return @byteSwap(u16, val); } pub inline fn __builtin_bswap32(val: u32) u32 { return @byteSwap(u32, val); } pub inline fn __builtin_bswap64(val: u64) u64 { return @byteSwap(u64, val); } pub inline fn __builtin_signbit(val: f64) c_int { return @boolToInt(std.math.signbit(val)); } pub inline fn __builtin_signbitf(val: f32) c_int { return @boolToInt(std.math.signbit(val)); } pub inline fn __builtin_popcount(val: c_uint) c_int { // popcount of a c_uint will never exceed the capacity of a c_int @setRuntimeSafety(false); return @bitCast(c_int, @as(c_uint, @popCount(c_uint, val))); } pub inline fn __builtin_ctz(val: c_uint) c_int { // Returns the number of trailing 0-bits in val, starting at the least significant bit position. // In C if `val` is 0, the result is undefined; in zig it's the number of bits in a c_uint @setRuntimeSafety(false); return @bitCast(c_int, @as(c_uint, @ctz(c_uint, val))); } pub inline fn __builtin_clz(val: c_uint) c_int { // Returns the number of leading 0-bits in x, starting at the most significant bit position. // In C if `val` is 0, the result is undefined; in zig it's the number of bits in a c_uint @setRuntimeSafety(false); return @bitCast(c_int, @as(c_uint, @clz(c_uint, val))); } pub inline fn __builtin_sqrt(val: f64) f64 { return @sqrt(val); } pub inline fn __builtin_sqrtf(val: f32) f32 { return @sqrt(val); } pub inline fn __builtin_sin(val: f64) f64 { return @sin(val); } pub inline fn __builtin_sinf(val: f32) f32 { return @sin(val); } pub inline fn __builtin_cos(val: f64) f64 { return @cos(val); } pub inline fn __builtin_cosf(val: f32) f32 { return @cos(val); } pub inline fn __builtin_exp(val: f64) f64 { return @exp(val); } pub inline fn __builtin_expf(val: f32) f32 { return @exp(val); } pub inline fn __builtin_exp2(val: f64) f64 { return @exp2(val); } pub inline fn __builtin_exp2f(val: f32) f32 { return @exp2(val); } pub inline fn __builtin_log(val: f64) f64 { return @log(val); } pub inline fn __builtin_logf(val: f32) f32 { return @log(val); } pub inline fn __builtin_log2(val: f64) f64 { return @log2(val); } pub inline fn __builtin_log2f(val: f32) f32 { return @log2(val); } pub inline fn __builtin_log10(val: f64) f64 { return @log10(val); } pub inline fn __builtin_log10f(val: f32) f32 { return @log10(val); } // Standard C Library bug: The absolute value of the most negative integer remains negative. pub inline fn __builtin_abs(val: c_int) c_int { return std.math.absInt(val) catch std.math.minInt(c_int); } pub inline fn __builtin_fabs(val: f64) f64 { return @fabs(val); } pub inline fn __builtin_fabsf(val: f32) f32 { return @fabs(val); } pub inline fn __builtin_floor(val: f64) f64 { return @floor(val); } pub inline fn __builtin_floorf(val: f32) f32 { return @floor(val); } pub inline fn __builtin_ceil(val: f64) f64 { return @ceil(val); } pub inline fn __builtin_ceilf(val: f32) f32 { return @ceil(val); } pub inline fn __builtin_trunc(val: f64) f64 { return @trunc(val); } pub inline fn __builtin_truncf(val: f32) f32 { return @trunc(val); } pub inline fn __builtin_round(val: f64) f64 { return @round(val); } pub inline fn __builtin_roundf(val: f32) f32 { return @round(val); } pub inline fn __builtin_strlen(s: [*c]const u8) usize { return std.mem.sliceTo(s, 0).len; } pub inline fn __builtin_strcmp(s1: [*c]const u8, s2: [*c]const u8) c_int { return @as(c_int, std.cstr.cmp(s1, s2)); } pub inline fn __builtin_object_size(ptr: ?*const anyopaque, ty: c_int) usize { _ = ptr; // clang semantics match gcc's: https://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html // If it is not possible to determine which objects ptr points to at compile time, // __builtin_object_size should return (size_t) -1 for type 0 or 1 and (size_t) 0 // for type 2 or 3. if (ty == 0 or ty == 1) return @bitCast(usize, -@as(isize, 1)); if (ty == 2 or ty == 3) return 0; unreachable; } pub inline fn __builtin___memset_chk( dst: ?*anyopaque, val: c_int, len: usize, remaining: usize, ) ?*anyopaque { if (len > remaining) @panic("std.c.builtins.memset_chk called with len > remaining"); return __builtin_memset(dst, val, len); } pub inline fn __builtin_memset(dst: ?*anyopaque, val: c_int, len: usize) ?*anyopaque { const dst_cast = @ptrCast([*c]u8, dst); @memset(dst_cast, @bitCast(u8, @truncate(i8, val)), len); return dst; } pub inline fn __builtin___memcpy_chk( noalias dst: ?*anyopaque, noalias src: ?*const anyopaque, len: usize, remaining: usize, ) ?*anyopaque { if (len > remaining) @panic("std.c.builtins.memcpy_chk called with len > remaining"); return __builtin_memcpy(dst, src, len); } pub inline fn __builtin_memcpy( noalias dst: ?*anyopaque, noalias src: ?*const anyopaque, len: usize, ) ?*anyopaque { const dst_cast = @ptrCast([*c]u8, dst); const src_cast = @ptrCast([*c]const u8, src); @memcpy(dst_cast, src_cast, len); return dst; } /// The return value of __builtin_expect is `expr`. `c` is the expected value /// of `expr` and is used as a hint to the compiler in C. Here it is unused. pub inline fn __builtin_expect(expr: c_long, c: c_long) c_long { _ = c; return expr; } /// returns a quiet NaN. Quiet NaNs have many representations; tagp is used to select one in an /// implementation-defined way. /// This implementation is based on the description for __builtin_nan provided in the GCC docs at /// https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005fnan /// Comment is reproduced below: /// Since ISO C99 defines this function in terms of strtod, which we do not implement, a description /// of the parsing is in order. /// The string is parsed as by strtol; that is, the base is recognized by leading ‘0’ or ‘0x’ prefixes. /// The number parsed is placed in the significand such that the least significant bit of the number is /// at the least significant bit of the significand. /// The number is truncated to fit the significand field provided. /// The significand is forced to be a quiet NaN. /// /// If tagp contains any non-numeric characters, the function returns a NaN whose significand is zero. /// If tagp is empty, the function returns a NaN whose significand is zero. pub inline fn __builtin_nanf(tagp: []const u8) f32 { const parsed = std.fmt.parseUnsigned(c_ulong, tagp, 0) catch 0; const bits = @truncate(u23, parsed); // single-precision float trailing significand is 23 bits return @bitCast(f32, @as(u32, bits) | std.math.qnan_u32); } pub inline fn __builtin_huge_valf() f32 { return std.math.inf(f32); } pub inline fn __builtin_inff() f32 { return std.math.inf(f32); } pub inline fn __builtin_isnan(x: anytype) c_int { return @boolToInt(std.math.isNan(x)); } pub inline fn __builtin_isinf(x: anytype) c_int { return @boolToInt(std.math.isInf(x)); } /// Similar to isinf, except the return value is -1 for an argument of -Inf and 1 for an argument of +Inf. pub inline fn __builtin_isinf_sign(x: anytype) c_int { if (!std.math.isInf(x)) return 0; return if (std.math.isPositiveInf(x)) 1 else -1; } pub inline fn __has_builtin(func: anytype) c_int { _ = func; return @boolToInt(true); } pub inline fn __builtin_assume(cond: bool) void { if (!cond) unreachable; } pub inline fn __builtin_unreachable() noreturn { unreachable; } pub inline fn __builtin_constant_p(expr: anytype) c_int { _ = expr; return @boolToInt(false); } pub fn __builtin_mul_overflow(a: anytype, b: anytype, result: *@TypeOf(a, b)) c_int { return @boolToInt(@mulWithOverflow(@TypeOf(a, b), a, b, result)); } // __builtin_alloca_with_align is not currently implemented. // It is used in a run-translated-c test and a test-translate-c test to ensure that non-implemented // builtins are correctly demoted. If you implement __builtin_alloca_with_align, please update the // run-translated-c test and the test-translate-c test to use a different non-implemented builtin. // pub fn __builtin_alloca_with_align(size: usize, alignment: usize) callconv(.Inline) *anyopaque {}
lib/std/zig/c_builtins.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const unicode = std.unicode; const warn = std.debug.warn; const mem = std.mem; const form_feed = 0x0C; const line_tabulation = 0x0B; const space = ' '; const Position = struct { begin: usize, end: usize, }; const Lexer = struct { input: []const u8, state: ?*lexState, /// This is the current position in the input stream. current_pos: usize, /// start_pos index on the current token starting point in the input stream start_pos: usize, width: usize, /// position of the last emitted token. last_pos: ?Position, lexme_list: LexMeList, allocator: *Allocator, fn init(allocator: *Allocator) Lexer { var lx: Lexer = undefined; lx.allocator = allocator; lx.lexme_list = LexMeList.init(allocator); return lx; } fn deinit(self: *Lexer) void { self.lexme_list.deinit(); } fn next(self: *Lexer) !?u32 { if (self.current_pos >= self.input.len) { return null; } const c = try unicode.utf8Decode(self.input[self.current_pos..]); const width = try unicode.utf8CodepointSequenceLength(c); self.width = @intCast(usize, width); self.current_pos += self.width; return c; } fn backup(self: *Lexer) void { self.current_pos -= self.width; } fn peek(self: *Lexer) !?u32 { const r = try self.next(); self.backup(); return r; } fn run(self: *Lexer) !void { self.state = lex_any; while (self.state) |state| { self.state = try state.lex(self); } } const lexState = struct { lexFn: fn (lx: *lexState, lexer: *Lexer) anyerror!?*lexState, fn lex(self: *lexState, lx: *Lexer) !?*lexState { return self.lexFn(self, lx); } }; const LexMeList = std.ArrayList(LexMe); const LexMe = struct { id: Id, pos: Position, const Id = enum { EOF, NewLine, HTML, Heading, BlockQuote, List, ListItem, FencedCodeBlock, Hr, // horizontal rule Table, LpTable, TableRow, TableCell, Strong, Italic, Strike, Code, Link, DefLink, RefLink, AutoLink, Image, RefImage, Text, Br, Pipe, Indent, }; }; const IterLine = struct { src: []const u8, current_pos: usize, fn init(src: []const u8, current_pos: usize) IterLine { return IterLine{ .src = src, .current_pos = current_pos, }; } fn next(self: *IterLine) ?Position { if (self.current_pos >= self.src.len) { return null; } if (Util.index(self.src[self.current_pos..], "\n")) |idx| { const c = self.current_pos; self.current_pos += idx + 1; return Position{ .begin = c, .end = self.current_pos - 1, }; } const c = self.current_pos; self.current_pos = self.src.len; return Position{ .begin = c, .end = self.current_pos, }; } fn reset(self: *IterLine, src: []const u8, pos: usize) void { self.current_pos = pos; self.src = src; } }; fn emit(self: *Lexer, id: LexMe.Id) !void { var a = &self.lexme_list; try a.append(LexMe{ .id = id, .pos = Position{ .begin = self.start_pos, .end = self.current_pos, }, }); self.start_pos = self.current_pos; } // findSetextHeading checks if in is begins with a setext heading. Returns // the offset of the heading relative to the beginning of the in where the // setext block ends. // // The returned offset includes the - or == sequence line up to and // including its line ending. fn findSetextHeading(in: []const u8) ?usize { if (Util.isBlank(in)) { return null; } // If setext sequence char is at the begininning of input then we // treat it as break. if (in[0] == '-' or in[0] == '=') { return null; } const x = Util.indentation(in); if (x <= 3 and (x + 1 < in.len)) { const c = in[x + 1]; if (c == '-' or c == '=') { return null; } } if (findSetextSequence(in)) |seq| { const idx = seq.idx; var scratch: [2]?Position = undefined; var iter = &IterLine.init(in[0..idx], 0); while (iter.next()) |pos| { const line = in[pos.begin..pos.end]; if (Util.isBlank(line)) { // This can span multiple lines when they don't contain a // blank line. scratch[0] = null; scratch[1] = null; continue; } if (scratch[0] == null) { scratch[0] = pos; } else { scratch[1] = pos; } const indent = Util.indentation(in[pos.begin..pos.end]); if (indent > 3) { return null; } } if (scratch[0] == null and scratch[1] == null) { return null; } iter.reset(in, idx); const pos = iter.next(); if (pos == null) { return null; } const line = in[pos.?.begin..pos.?.end]; // what is left is to verify that line conforms to a valid setext // sequence line. var space_zone = false; const indent = Util.indentation(line); for (line[indent..]) |c| { if (c == seq.char) {} else { if (Util.isHorizontalSpace(c)) { if (!space_zone) { space_zone = true; } } else { if (Util.isHorizontalSpace(c)) { if (!space_zone) { space_zone = true; } } else { return null; } } } } return pos.?.end; } return null; } const Seq = struct { char: u8, idx: usize, }; fn findSetextSequence(in: []const u8) ?Seq { if (Util.index(in, "=")) |idx| { return Seq{ .char = '=', .idx = idx }; } if (Util.index(in, "-")) |idx| { return Seq{ .char = '-', .idx = idx }; } return null; } // returns position for Thematic breaks // // see https://github.github.com/gfm/#thematic-breaks fn findHorizontalRules(in: []const u8) ?usize { const indent = Util.indentation(in); if (indent > 3) { return null; } var index = in.len; if (Util.index(in, "\n")) |idx| { index = idx; } const hr_prospect = in[indent..index]; var active_char: ?u8 = null; var space_zone = false; for (hr_prospect) |c| { switch (c) { '-', '_', '*' => { if (space_zone) { return null; } if (active_char) |char| { if (char != c) { return null; } } }, else => { if (Util.isHorizontalSpace(c)) { if (!space_zone) { space_zone = true; } } else { return null; } }, } } var o: usize = 0; if (index == in.len) { o = index; } else { o = index + 1; } return o; } const fenced_tilde_prefix = [][]const u8{ "", "", "", "```", "````", "`````", "``````", "```````", }; const fenced_backtick_prefix = [][]const u8{ "", "", "", "~~~", "~~~~", "~~~~~", "~~~~~~", "~~~~~~~", }; // returns position for Fenced code blocks // // see https://github.github.com/gfm/#fenced-code-blocks fn findFencedCodeBlock(in: []const u8) ?usize { const indent = Util.indentation(in); const block = in[indent..]; var fenced_char = block[0]; switch (fenced_char) { '`', '~' => {}, else => { return null; }, } const count = Util.countStartsWith(block, fenced_char); // This is enforced by this library. It is just madness to have seven // backticks just describing a code block if (count < 3 or count > 7) { return null; } // checking the info string if (Util.index(in, "\n")) |idx| { // we are adding indent here to preserve offsets relative to in // because the position we return are from in stream. var i = indent + count + 1; while (i < idx) { if (in[i] == fenced_char) { return null; } i += 1; } const closing_index = switch (fenced_char) { '~' => fenced_tilde_prefix[count], '`' => fenced_backtick_prefix[count], else => unreachable, }; if (Util.index(in[i..], closing_index)) |idx| { // The closing fenced block line may be indented, we are walking // backward to count the amount of indentation var indent_count: usize = 0; var j = idx - 1; while (j > 0) : (j -= 1) { const c = in[j]; switch (c) { ' ', '\t' => { indent_count += 1; }, else => { if (Util.isVersicalSpace(c)) { break; } return null; }, } } if (indent_count > 3) { return null; } j = idx + closing_index.len; while (j < in.len) : (j += 1) { // After the closing code block. The line must only contain // spaces const c = in[j]; if (Util.isVersicalSpace(c)) { break; } if (Util.isHorizontalSpace(c)) { continue; } return null; } return j; } } return null; } const lex_any = &AnyLexer.init().state; const lex_heading = &HeadingLexer.init().state; const lex_horizontal_rule = &HorizontalRuleLexer.init().state; const lex_code_block = &CodeBlockLexer.init().state; const lex_text = &TextLexer.init().state; const lex_html = &HTMLLexer.init().state; const lex_list = &ListLexer.init().state; const lex_block_quote = &BlockQuoteLexer.init().state; const lex_def_link = &DefLinkLexer.init().state; const lex_fenced_code_block = &FencedCodeBlockLexer.init().state; const AnyLexer = struct { state: lexState, fn init() AnyLexer { return AnyLexer{ .state = lexState{ .lexFn = lexFn }, }; } fn lexFn(self: *lexState, lx: *Lexer) !?*lexState { while (try lx.peek()) |r| { switch (r) { '*', '-', '_' => { return lex_horizontal_rule; }, '+', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' => { return lex_list; }, '<' => { return lex_html; }, '>' => { return lex_block_quote; }, '[' => { return lex_def_link; }, '`', '~' => { return lex_fenced_code_block; }, '#' => { return lex_heading; }, else => {}, } } return null; } }; const HeadingLexer = struct { state: lexState, fn init() HeadingLexer { return HeadingLexer{ .state = lexState{ .lexFn = lexFn }, }; } fn lexFn(self: *lexState, lx: *Lexer) !?*lexState { return error.TODO; } }; const HorizontalRuleLexer = struct { state: lexState, fn init() HorizontalRuleLexer { return HorizontalRuleLexer{ .state = lexState{ .lexFn = lexFn }, }; } fn lexFn(self: *lexState, lx: *Lexer) anyerror!?*lexState { if (findHorizontalRules(lx.input[lx.current_pos..])) |pos| { lx.current_pos += pos; try lx.emit(LexMe.Id.Hr); return lex_any; } return lex_list; } }; const CodeBlockLexer = struct { state: lexState, fn init() CodeBlockLexer { return CodeBlockLexer{ .state = lexState{ .lexFn = lexFn }, }; } fn lexFn(self: *lexState, lx: *Lexer) !?*lexState { return error.TODO; } }; const TextLexer = struct { state: lexState, fn init() TextLexer { return TextLexer{ .state = lexState{ .lexFn = lexFn }, }; } fn lexFn(self: *lexState, lx: *Lexer) !?*lexState { while (try lx.peek()) |r| { switch (r) { '\n' => { if (lx.current_pos > lx.start_pos and Util.hasPrefix(lx.input[lx.current_pos + 1 ..], " ")) { _ = try lx.next(); continue; } if (lx.current_pos > ls.start_pos) { try lx.emit(LexMe.Text); } lx.pos += lx.width; try lx.emit(LexMe.NewLine); break; }, else => { if (findSetextHeading(lx.input[lx.current_pos..])) |pos| { lx.current_pos += end; try lx.emit(LexMe.Heading); break; } _ = try lx.next(); }, } } return lex_any; } }; const HTMLLexer = struct { state: lexState, fn init() HTMLLexer { return HTMLLexer{ .state = lexState{ .lexFn = lexFn }, }; } fn lexFn(self: *lexState, lx: *Lexer) !?*lexState { return error.TODO; } }; const ListLexer = struct { state: lexState, fn init() ListLexer { return ListLexer{ .state = lexState{ .lexFn = lexFn }, }; } fn lexFn(self: *lexState, lx: *Lexer) !?*lexState { return error.TODO; } }; const BlockQuoteLexer = struct { state: lexState, fn init() BlockQuoteLexer { return BlockQuoteLexer{ .state = lexState{ .lexFn = lexFn }, }; } fn lexFn(self: *lexState, lx: *Lexer) !?*lexState { return error.TODO; } }; const DefLinkLexer = struct { state: lexState, fn init() DefLinkLexer { return DefLinkLexer{ .state = lexState{ .lexFn = lexFn }, }; } fn lexFn(self: *lexState, lx: *Lexer) !?*lexState { return error.TODO; } }; const FencedCodeBlockLexer = struct { state: lexState, fn init() FencedCodeBlockLexer { return FencedCodeBlockLexer{ .state = lexState{ .lexFn = lexFn }, }; } fn lexFn(self: *lexState, lx: *Lexer) !?*lexState { return error.TODO; } }; }; // Util are utility/helper functions. const Util = struct { const punct_marks = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"; fn isPunct(c: u8) bool { for (punct_marks) |char| { if (c == char) { return true; } } return false; } // returns true if s is a blank line. fn isBlank(s: []const u8) bool { if (s.len == 0) { return true; } for (s) |c| { if (!isHorizontalSpace(c)) { return false; } } return true; } /// returns true if c is a whitespace character. fn isSpace(c: u8) bool { return isHorizontalSpace(c) or isVersicalSpace(c); } fn isBackslashEscaped(data: []const u8, i: usize) bool { var bs: usize = 0; while ((@intCast(isize, i) - @intCast(isize, bs) - 1) >= 0 and data[i - bs - 1] == '\\') { bs += 1; } return bs == 1; } fn isHorizontalSpace(c: u8) bool { return c == ' ' or c == '\t'; } fn isVersicalSpace(c: u8) bool { return c == '\n' or c == '\r' or c == form_feed or c == line_tabulation; } fn isLetter(c: u8) bool { return (c >= 'a' and c <= 'z') or (c >= 'A' and c <= 'Z'); } fn isalnum(c: u8) bool { return (c >= '0' and c <= '9') or isLetter(c); } // Find if a line counts as indented or not. // Returns number of characters the indent is (0 = not indented). fn isIndented(data: []const u8, indent_size: usize) usize { if (data.len == 0) { return 0; } if (data[0] == '\t') { return 1; } if (data.len < indent_size) { return 0; } var i: usize = 0; while (i < indent_size) : (i += 1) { if (data[i] != space) { return 0; } } return indent_size; } fn indentation(data: []const u8) usize { if (data.len == 0) { return 0; } if (data[0] == '\t') { return 1; } var i: usize = 0; var idx: usize = 0; while (i < data.len) : (i += 1) { if (data[i] != ' ') { break; } idx += 1; } return idx; } // countStartsWith counts c character occurance from the beginning of data. fn countStartsWith(data: []const u8, c: u8) usize { if (data.len == 0) { return 0; } var i: usize = 0; while (i < data.len) { if (c != data[i]) { break; } } return i; } /// returns true if sub_slice is within s. pub fn contains(s: []const u8, sub_slice: []const u8) bool { return mem.indexOf(u8, s, sub_slice) != null; } pub fn index(s: []const u8, sub_slice: []const u8) ?usize { return mem.indexOf(u8, s, sub_slice); } /// hasPrefix returns true if slice s begins with prefix. pub fn hasPrefix(s: []const u8, prefix: []const u8) bool { return s.len >= prefix.len and equal(s[0..prefix.len], prefix); } pub fn hasSuffix(s: []const u8, suffix: []const u8) bool { return s.len >= suffix.len and equal(s[s.len - suffix.len ..], suffix); } pub fn trimPrefix(s: []const u8, prefix: []const u8) []const u8 { return mem.trimLeft(u8, s, prefix); } pub fn trimSuffix(s: []const u8, suffix: []const u8) []const u8 { return mem.trimRight(u8, s, suffix); } fn skipUntilChar(text: []const u8, start: usize, c: usize) usize { var i = start; while (i < tag.len and text[i] != c) : (i += 1) {} return i; } fn skipSpace(tag: []const u8, i: usize) usize { while (i < tag.len and isSpace(tag[i])) : (i += 1) {} return i; } fn skipChar(data: []const u8, start: usize, c: u8) usize { var i = start; while (i < data.len and data[i] == c) : (i += 1) {} return i; } fn isRelativeLink(link: []const u8) bool { if (link[0] == '#') { return true; } if (link.len >= 2 and link[0] == '/' and link[1] != '/') { return true; } // current directory : begin with "./" if (hasPrefix(link, "./")) { return true; } // parent directory : begin with "../" if (hasPrefix(link, "../")) { return true; } return false; } }; const suite = @import("test_suite.zig"); const TestCase = suite.TestCase; test "Lexer" { var lx = &Lexer.init(std.debug.global_allocator); defer lx.deinit(); try lx.run(); } test "Lexer.findSetextHeading" { const Helper = struct { fn testTwo(case: *const TestCase, expect: [2]?usize) void { testfindSetextHeading(case, expect[0..]); } fn testOne(case: *const TestCase, expect: [1]?usize) void { testfindSetextHeading(case, expect[0..]); } fn testThree(case: *const TestCase, expect: [3]?usize) void { testfindSetextHeading(case, expect[0..]); } fn testfindSetextHeading(case: *const TestCase, expect: []const ?usize) void { const size = case.markdown.len; var current_pos: usize = 0; var j: usize = 0; for (expect) |value, ix| { if (current_pos < size) { if (Lexer.findSetextHeading(case.markdown[current_pos..])) |idx| { current_pos += idx; if (value) |expect_value| { if (current_pos != expect_value) { warn( "error: {} expected offset={} got offset={}\n", case.example, expect_value, current_pos, ); } } else { warn( "error: {} expected offset=null got offset={}\n", case.example, current_pos, ); } } else { if (value != null) { warn( "error: {} expected offset={} got offset=null\n", case.example, value, ); } } } } } }; const one = Helper.testOne; const two = Helper.testTwo; const three = Helper.testThree; const cases = suite.all_cases[49..75]; two(&cases[0], []?usize{ 19, 40 }); } test "Lexer.findFencedCodeBlock" {} const Parser = struct { const Node = struct { id: Id, const Id = enum { Text, // A plain text Paragraph, // A Paragraph Emphasis, // An emphasis(strong, em, ...) Heading, // A heading (h1, h2, ...) Br, // A link break Hr, // A horizontal rule Image, // An image RefImage, // A image reference List, // A list of ListItems ListItem, // A list item node Link, // A link(href) RefLink, // A link reference DefLink, // A link definition Table, // A table of Rows Row, // A row of Cells Cell, // A table-cell(td) Code, // A code block(wrapped with pre) BlockQuote, // A blockquote HTML, // An inline HTML }; const NodeList = ArrayList(*Node); fn NodeBase(base: type) type { return struct { id: Id, base: base, }; } const Paragraph = struct { const Self = @This(); pos: Position, nodes: ?NodeList, const Context = NodeBase(Self); fn init(pos: Position, nodes: ?NodeList) Context { return Context{ .id = Id.Paragraph, .base = Self{ .pos = pos, .nodes = nodes, }, }; } }; const Text = struct { const Self = @This(); pos: Position, const Context = NodeBase(Self); fn init(pos: Position) Context { return Context{ .id = Id.Text, .base = Self{ .pos = pos }, }; } }; const HTML = struct { const Self = @This(); pos: Position, const Context = NodeBase(Self); fn init(pos: Position) Context { return Context{ .id = Id.HTML, .base = Self{ .pos = pos }, }; } }; const HR = struct { const Self = @This(); pos: Position, const Context = NodeBase(Self); fn init(pos: Position) Context { return Context{ .id = Id.Br, .base = Self{ .pos = pos }, }; } }; const BR = struct { const Self = @This(); pos: Position, const Context = NodeBase(Self); fn init(pos: Position) Context { return Context{ .id = Id.Hr, .base = Self{ .pos = pos }, }; } }; const Emphasis = struct { const Self = @This(); pos: Position, style: Lexer.LexMe, nodes: ?NodeList, const Context = NodeBase(Self); fn init(pos: Position, style: Lexer.LexMe, nodes: ?NodeList) Context { return Context{ .id = Id.Emphasis, .base = Self{ .pos = pos, .style = style, .nodes = nodes, }, }; } }; const Heading = struct { const Self = @This(); pos: Position, levels: usize, //(0.6) text: Position, nodes: ?NodeList, const Context = NodeBase(Self); fn init(pos: Position, levels: usize, text: Position, nodes: ?NodeList) Context { return Context{ .id = Id.Heading, .base = Self{ .pos = pos, .levels = levels, .text = text, .nodes = nodes, }, }; } }; const Code = struct { const Self = @This(); pos: Position, lang: ?Position, text: Position, const Context = NodeBase(Self); fn init(pos: Position, levels: usize, text: Position) Context { return Context{ .id = Id.Code, .base = Self{ .pos = pos, .text = text, }, }; } }; const Link = struct { const Self = @This(); pos: Position, title: ?Position, href: ?Position, nodes: ?NodeList, const Context = NodeBase(Self); fn init(pos: Position, title: ?Position, href: ?Position, nodes: ?NodeList) Context { return Context{ .id = Id.Link, .base = Self{ .pos = pos, .title = title, .href = href, .nodes = nodes, }, }; } }; }; };
src/baki.zig
const std = @import("std"); const mecha = @import("../mecha.zig"); const debug = std.debug; const math = std.math; /// Constructs a parser that only succeeds if the string starts with `i`. pub fn char(comptime i: u8) mecha.Parser(void) { comptime { return mecha.string(&[_]u8{i}); } } test "char" { mecha.expectResult(void, .{ .value = {}, .rest = "" }, char('a')("a")); mecha.expectResult(void, .{ .value = {}, .rest = "a" }, char('a')("aa")); mecha.expectResult(void, null, char('a')("ba")); mecha.expectResult(void, null, char('a')("")); } /// Constructs a parser that only succeeds if the string starts with /// a codepoint that is in between `start` and `end` inclusively. /// The parsers result will be the codepoint parsed. pub fn range(comptime start: u8, comptime end: u8) mecha.Parser(u8) { return struct { const Res = mecha.Result(u8); fn func(str: []const u8) ?Res { if (str.len == 0) return null; switch (str[0]) { start...end => return Res.init(str[0], str[1..]), else => return null, } } }.func; } test "range" { mecha.expectResult(u8, .{ .value = 'a', .rest = "" }, range('a', 'z')("a")); mecha.expectResult(u8, .{ .value = 'i', .rest = "" }, range('a', 'z')("i")); mecha.expectResult(u8, .{ .value = 'z', .rest = "" }, range('a', 'z')("z")); mecha.expectResult(u8, .{ .value = 'a', .rest = "a" }, range('a', 'z')("aa")); mecha.expectResult(u8, .{ .value = 'c', .rest = "a" }, range('a', 'z')("ca")); mecha.expectResult(u8, .{ .value = 'z', .rest = "a" }, range('a', 'z')("za")); mecha.expectResult(u8, null, range('a', 'z')("1")); mecha.expectResult(u8, null, range('a', 'z')("")); } /// A parser that succeeds if the string starts with an upper case /// character. The parsers result will be the character parsed. pub const upper = mecha.oneOf(.{range('A', 'Z')}); test "upper" { var i: u8 = 0; while (i <= math.maxInt(u7)) : (i += 1) { switch (i) { 'A'...'Z' => mecha.expectResult(u8, .{ .value = i, .rest = "" }, upper(&[_]u8{i})), else => mecha.expectResult(u8, null, upper(&[_]u8{i})), } } } /// A parser that succeeds if the string starts with an upper case /// character. The parsers result will be the character parsed. pub const lower = mecha.oneOf(.{range('a', 'z')}); test "lower" { var i: u8 = 0; while (i <= math.maxInt(u7)) : (i += 1) { switch (i) { 'a'...'z' => mecha.expectResult(u8, .{ .value = i, .rest = "" }, lower(&[_]u8{i})), else => mecha.expectResult(u8, null, lower(&[_]u8{i})), } } } /// A parser that succeeds if the string starts with an alphabetic /// character. The parsers result will be the character parsed. pub const alpha = mecha.oneOf(.{ lower, upper }); test "alpha" { var i: u8 = 0; while (i <= math.maxInt(u7)) : (i += 1) { switch (i) { 'a'...'z', 'A'...'Z', => mecha.expectResult(u8, .{ .value = i, .rest = "" }, alpha(&[_]u8{i})), else => mecha.expectResult(u8, null, alpha(&[_]u8{i})), } } } /// Construct a parser that succeeds if the string starts with a /// character that is a digit in `base`. The parsers result will be /// the character parsed. pub fn digit(comptime base: u8) mecha.Parser(u8) { debug.assert(base != 0); if (base <= 10) return range('0', '0' + (base - 1)); return comptime mecha.oneOf(.{ range('0', '9'), range('a', 'a' + (base - 11)), range('A', 'A' + (base - 11)), }); } test "digit" { var i: u8 = 0; i = 0; while (i <= math.maxInt(u7)) : (i += 1) { switch (i) { '0'...'1' => mecha.expectResult(u8, .{ .value = i, .rest = "" }, digit(2)(&[_]u8{i})), else => mecha.expectResult(u8, null, digit(2)(&[_]u8{i})), } } i = 0; while (i <= math.maxInt(u7)) : (i += 1) { switch (i) { '0'...'9' => mecha.expectResult(u8, .{ .value = i, .rest = "" }, digit(10)(&[_]u8{i})), else => mecha.expectResult(u8, null, digit(10)(&[_]u8{i})), } } i = 0; while (i <= math.maxInt(u7)) : (i += 1) { switch (i) { '0'...'9', 'a'...'f', 'A'...'F', => mecha.expectResult(u8, .{ .value = i, .rest = "" }, digit(16)(&[_]u8{i})), else => mecha.expectResult(u8, null, digit(16)(&[_]u8{i})), } } } /// A parser that succeeds if the string starts with an alphabetic /// or numeric character. The parsers result will be the character parsed. pub const alphanum = mecha.oneOf(.{ alpha, digit(10) }); test "alphanum" { var i: u8 = 0; while (i <= math.maxInt(u7)) : (i += 1) { switch (i) { 'a'...'z', 'A'...'Z', '0'...'9', => mecha.expectResult(u8, .{ .value = i, .rest = "" }, alphanum(&[_]u8{i})), else => mecha.expectResult(u8, null, alphanum(&[_]u8{i})), } } } pub const cntrl = mecha.oneOf(.{ range(0, 0x19), range(127, 127), }); test "cntrl" { var i: u8 = 0; while (i <= math.maxInt(u7)) : (i += 1) { switch (i) { 0...0x19, 127 => mecha.expectResult(u8, .{ .value = i, .rest = "" }, cntrl(&[_]u8{i})), else => mecha.expectResult(u8, null, cntrl(&[_]u8{i})), } } } pub const graph = range(0x21, 0x7e); test "graph" { var i: u8 = 0; while (i <= math.maxInt(u7)) : (i += 1) { switch (i) { 0x21...0x7e => mecha.expectResult(u8, .{ .value = i, .rest = "" }, graph(&[_]u8{i})), else => mecha.expectResult(u8, null, graph(&[_]u8{i})), } } } pub const print = range(0x20, 0x7e); test "print" { var i: u8 = 0; while (i <= math.maxInt(u7)) : (i += 1) { switch (i) { 0x20...0x7e => mecha.expectResult(u8, .{ .value = i, .rest = "" }, print(&[_]u8{i})), else => mecha.expectResult(u8, null, print(&[_]u8{i})), } } } pub const space = mecha.oneOf(.{ range(' ', ' '), range('\t', 0x0c), }); test "print" { var i: u8 = 0; while (i <= math.maxInt(u7)) : (i += 1) { switch (i) { 0x20...0x7e => mecha.expectResult(u8, .{ .value = i, .rest = "" }, print(&[_]u8{i})), else => mecha.expectResult(u8, null, print(&[_]u8{i})), } } } pub const punct = mecha.oneOf(.{ range('!', '/'), range(':', '@'), range('[', '`'), range('{', '~'), }); test "punct" { var i: u8 = 0; while (i <= math.maxInt(u7)) : (i += 1) { switch (i) { '!'...'/', ':'...'@', '['...'`', '{'...'~', => mecha.expectResult(u8, .{ .value = i, .rest = "" }, punct(&[_]u8{i})), else => mecha.expectResult(u8, null, punct(&[_]u8{i})), } } } /// Creates a parser that succeeds and parses one ascii character if /// `parser` fails to parse the input string. pub fn not(comptime parser: anytype) mecha.Parser(u8) { return struct { const Res = mecha.Result(u8); fn res(str: []const u8) ?Res { if (str.len == 0) return null; if (parser(str)) |_| return null; return Res.init(str[0], str[1..]); } }.res; } test "not" { const p = not(alpha); var i: u8 = 0; while (i <= math.maxInt(u7)) : (i += 1) { switch (i) { 'a'...'z', 'A'...'Z', => mecha.expectResult(u8, null, p(&[_]u8{i})), else => mecha.expectResult(u8, .{ .value = i, .rest = "" }, p(&[_]u8{i})), } } }
src/ascii.zig
const std = @import("std"); usingnamespace @import("ast.zig"); pub const AstFormatter = struct { indentSize: usize = 4, const Self = @This(); pub fn init() Self { return Self{}; } fn newLine(self: *AstFormatter, writer: anytype, indent: u64) anyerror!void { var i: usize = 0; try writer.writeAll("\n"); while (i < indent * self.indentSize) : (i += 1) { try writer.writeAll(" "); } } pub fn format(self: *AstFormatter, writer: anytype, ast: *Ast, indent: u64) anyerror!void { switch (ast.spec) { // .Access => |*acc| { try writer.writeAll("["); try self.format(writer, acc.left, indent); try writer.writeAll("].["); try self.format(writer, acc.right, indent); try writer.writeAll("]"); }, .Assignment => |*ass| { try self.format(writer, ass.pattern, indent); try writer.writeAll(" = "); try self.format(writer, ass.value, indent); }, .Block => |*block| { try writer.writeAll("{"); for (block.body.items) |arg, i| { try self.newLine(writer, indent + 1); try self.format(writer, arg, indent + 1); } if (block.body.items.len > 0) { try self.newLine(writer, indent); } try writer.writeAll("}"); }, .Call => |*call| { try self.format(writer, call.func, indent); try writer.writeAll("("); for (call.args.items) |arg, i| { if (i > 0) try writer.writeAll(", "); try self.format(writer, arg, indent); } try writer.writeAll(")"); }, .ConstDecl => |*decl| { try self.format(writer, decl.pattern, indent); try writer.writeAll(" :"); if (decl.typ) |typ| { try writer.writeAll(" "); try self.format(writer, typ, indent); try writer.writeAll(" "); } try writer.writeAll(": "); try self.format(writer, decl.value, indent); }, .VarDecl => |*decl| { try self.format(writer, decl.pattern, indent); try writer.writeAll(" :"); if (decl.typ) |typ| { try writer.writeAll(" "); try self.format(writer, typ, indent); try writer.writeAll(" "); } if (decl.value) |value| { try writer.writeAll("= "); try self.format(writer, value, indent); } }, .Float => |float| try std.fmt.format(writer, "{}", .{float.value}), .Function => |float| try std.fmt.format(writer, "@fn", .{}), .Identifier => |id| try writer.writeAll(id.name), .Int => |int| try std.fmt.format(writer, "{}", .{int.value}), .Lambda => |*lambda| { try writer.writeAll("|"); for (lambda.args.items) |arg, i| { if (i > 0) { try writer.writeAll(", "); } try self.format(writer, arg, indent); } try writer.writeAll("| "); try self.format(writer, lambda.body, indent); }, .Pipe => |*pipe| { try self.format(writer, pipe.left, indent); try writer.writeAll(" -> "); try self.format(writer, pipe.right, indent); }, .Return => |ret| { try std.fmt.format(writer, "@return(", .{}); if (ret.value) |value| { try self.format(writer, value, indent); } try std.fmt.format(writer, ")", .{}); }, .String => |text| try std.fmt.format(writer, "\"{s}\"", .{text.value}), .Tuple => |*tuple| { try writer.writeAll(".("); for (tuple.values.items) |value, i| { if (i > 0) { try writer.writeAll(", "); } try self.format(writer, value, indent); } try writer.writeAll(")"); }, //else => try writer.writeAll("<Unknown>"), } } };
src/code_formatter.zig
const std = @import("std"); const mem = std.mem; const Symbol = struct { name: []const u8, section: []const u8, kind: enum { global, weak, }, type: enum { none, function, object, }, protected: bool, }; // Example usage: // objdump --dynamic-syms /path/to/libc.so | ./gen_stubs > lib/libc/musl/libc.s pub fn main() !void { const stdin = std.io.getStdIn().reader(); const stdout = std.io.getStdOut().writer(); var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); defer arena.deinit(); const ally = arena.allocator(); var symbols = std.ArrayList(Symbol).init(ally); var sections = std.ArrayList([]const u8).init(ally); // This is many times larger than any line objdump produces should ever be var buf: [4096]u8 = undefined; var line_number: usize = 0; // Sample input line: // 00000000000241b0 g DF .text 000000000000001b copy_file_range while (try stdin.readUntilDelimiterOrEof(&buf, '\n')) |line| { line_number += 1; // the lines we want all start with a 16 digit hex value if (line.len < 16) continue; _ = std.fmt.parseInt(u64, line[0..16], 16) catch continue; // Ignore non-dynamic symbols if (line[22] != 'D') continue; const section = line[25 .. 25 + mem.indexOfAny(u8, line[25..], &std.ascii.spaces).?]; // the last whitespace-separated column is the symbol name const name = line[1 + mem.lastIndexOfAny(u8, line, &std.ascii.spaces).? ..]; const symbol = Symbol{ .name = try ally.dupe(u8, name), .section = try ally.dupe(u8, section), .kind = if (line[17] == 'g' and line[18] == ' ') .global else if (line[17] == ' ' and line[18] == 'w') .weak else std.debug.panic("unexpected kind on line {d}:\n{s}", .{ line_number, line }), .type = switch (line[23]) { 'F' => .function, 'O' => .object, ' ' => .none, else => unreachable, }, .protected = mem.indexOf(u8, line, ".protected") != null, }; for (sections.items) |s| { if (mem.eql(u8, s, symbol.section)) break; } else { try sections.append(symbol.section); } try symbols.append(symbol); } std.sort.sort(Symbol, symbols.items, {}, cmpSymbols); std.sort.sort([]const u8, sections.items, {}, alphabetical); for (sections.items) |section| { try stdout.print("{s}\n", .{section}); for (symbols.items) |symbol| { if (!mem.eql(u8, symbol.section, section)) continue; switch (symbol.kind) { .global => try stdout.print(".globl {s}\n", .{symbol.name}), .weak => try stdout.print(".weak {s}\n", .{symbol.name}), } switch (symbol.type) { .function => try stdout.print(".type {s}, %function;\n", .{symbol.name}), .object => try stdout.print(".type {s}, %object;\n", .{symbol.name}), .none => {}, } if (symbol.protected) try stdout.print(".protected {s}\n", .{symbol.name}); try stdout.print("{s}:\n", .{symbol.name}); } } } fn cmpSymbols(_: void, lhs: Symbol, rhs: Symbol) bool { return alphabetical({}, lhs.name, rhs.name); } fn alphabetical(_: void, lhs: []const u8, rhs: []const u8) bool { var i: usize = 0; while (i < lhs.len and i < rhs.len) : (i += 1) { if (lhs[i] == rhs[i]) continue; return lhs[i] < rhs[i]; } return lhs.len < rhs.len; }
tools/gen_stubs.zig
const std = @import("std"); const print = std.debug.print; const util = @import("util.zig"); const gpa = util.gpa; const data = @embedFile("../data/day16.txt"); const BitReader = struct { bytes: []u8, byte: u8, byte_index: usize = 0, index: usize = 0, eos: bool = false, const Self = @This(); const ReadError = error{ EndOfSequence, }; fn init(bytes: []u8) Self { return .{ .bytes = bytes, .byte = @bitReverse(u8, bytes[0]) }; } fn next_bit(self: *Self) Self.ReadError!u1 { if (self.eos) return Self.ReadError.EndOfSequence; var bit: u1 = @intCast(u1, self.byte & 0b0000_0001); self.byte >>= 1; if (self.index % 8 == 7) { self.byte_index += 1; if (self.byte_index == self.bytes.len) { self.eos = true; return bit; } self.byte = @bitReverse(u8, self.bytes[self.byte_index]); } self.index += 1; return bit; } fn read(self: *Self, comptime Int: type) Self.ReadError!Int { const int_info = @typeInfo(Int).Int; if (int_info.signedness == .signed) @compileError("Only accepts unsigned integers"); if (int_info.bits == 1) return try self.next_bit(); var value: Int = 0; var i: usize = 0; while (i < int_info.bits) : (i += 1) { value = value * 2 + try self.next_bit(); } return value; } }; pub fn main() !void { var buf: [data.len / 2]u8 = undefined; var bytes = try std.fmt.hexToBytes(&buf, std.mem.trim(u8, data, "\n")); var reader = BitReader.init(bytes); var pkt = try parsePacket(&reader); print("{}\n", .{pkt.version}); print("{}\n", .{pkt.val}); } const Packet = struct { version: usize = 0, id: u8 = 0, op: u8 = 0, val: usize = 0, }; fn parsePacket(reader: *BitReader) BitReader.ReadError!Packet { var pkt: Packet = .{}; pkt.version = try reader.read(u3); pkt.id = try reader.read(u3); switch (pkt.id) { 0b100 => { var more = true; while (more) { more = (try reader.read(u1)) == 1; pkt.val = (pkt.val * (1 << 4)) + try reader.read(u4); } }, else => { var len_id = try reader.read(u1); var num = switch (len_id) { 0 => try reader.read(u15), 1 => try reader.read(u11), }; if (pkt.id == 1) pkt.val = 1; if (pkt.id == 2) pkt.val = std.math.maxInt(usize); if (pkt.id == 3) pkt.val = std.math.minInt(usize); switch (len_id) { 0 => { var end = reader.index + num; while (reader.index < end) { var p = try parsePacket(reader); switch (pkt.id) { 0 => pkt.val += p.val, 1 => pkt.val *= p.val, 2 => if (p.val < pkt.val) { pkt.val = p.val; }, 3 => if (p.val > pkt.val) { pkt.val = p.val; }, 5 => { var p2 = try parsePacket(reader); pkt.version += p2.version; if (p.val > p2.val) { pkt.val = 1; } else pkt.val = 0; }, 6 => { var p2 = try parsePacket(reader); pkt.version += p2.version; if (p.val < p2.val) { pkt.val = 1; } else pkt.val = 0; }, 7 => { var p2 = try parsePacket(reader); pkt.version += p2.version; if (p.val == p2.val) { pkt.val = 1; } else pkt.val = 0; }, else => unreachable, } pkt.version += p.version; } }, 1 => { var i: usize = 0; while (i < num) : (i += 1) { var p = try parsePacket(reader); switch (pkt.id) { 0 => pkt.val += p.val, 1 => pkt.val *= p.val, 2 => if (p.val < pkt.val) { pkt.val = p.val; }, 3 => if (p.val > pkt.val) { pkt.val = p.val; }, 5 => { var p2 = try parsePacket(reader); pkt.version += p2.version; if (p.val > p2.val) { pkt.val = 1; } else pkt.val = 0; i += 1; }, 6 => { var p2 = try parsePacket(reader); pkt.version += p2.version; if (p.val < p2.val) { pkt.val = 1; } else pkt.val = 0; i += 1; }, 7 => { var p2 = try parsePacket(reader); pkt.version += p2.version; if (p.val == p2.val) { pkt.val = 1; } else pkt.val = 0; i += 1; }, else => unreachable, } pkt.version += p.version; } }, } }, } return pkt; }
2021/src/day16.zig
pub const debugConfig = Config{ // Override values here for your build .vulkanVersion = 1001000, // Vulkan 1.1 //.recordingEnabled = true, //.statsStringEnabled = false, //.debugMargin = 64, //.debugDetectCorruption = true, //.debugInitializeAllocations = true, //.debugGlobalMutex = true, //.debugMinBufferImageGranularity = 256, }; pub const releaseConfig = Config{ // Override values here for your build .vulkanVersion = 1001000, // Vulkan 1.1 //.statsStringEnabled = false, }; // Default values here, please do not change // Null in any of these values means that no // define will be passed to the build and the // default value will be used. pub const Config = struct { /// The current version of vulkan vulkanVersion: u32 = 1000000, // Vulkan 1.0 /// Whether to use the KHR Dedicated Allocation extension dedicatedAllocation: bool = false, // NOTE: Please modify values in the instance at the top of this file, not here. /// Whether to use the KHR Bind Memory 2 extension bindMemory2: bool = false, // NOTE: Please modify values in the instance at the top of this file, not here. /// Whether to use the KHR Memory Budget extension memoryBudget: bool = false, // NOTE: Please modify values in the instance at the top of this file, not here. /// If you experience a bug with incorrect and nondeterministic data in your program and you suspect uninitialized memory to be used, /// you can enable automatic memory initialization to verify this. /// To do it, set debugInitializeAllocations to true. /// /// It makes memory of all new allocations initialized to bit pattern `0xDCDCDCDC`. /// Before an allocation is destroyed, its memory is filled with bit pattern `0xEFEFEFEF`. /// Memory is automatically mapped and unmapped if necessary. /// /// If you find these values while debugging your program, good chances are that you incorrectly /// read Vulkan memory that is allocated but not initialized, or already freed, respectively. /// /// Memory initialization works only with memory types that are `HOST_VISIBLE`. /// It works also with dedicated allocations. /// It doesn't work with allocations created with #VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT flag, /// as they cannot be mapped. debugInitializeAllocations: ?bool = null, // NOTE: Please modify values in the instance at the top of this file, not here. /// By default, allocations are laid out in memory blocks next to each other if possible /// (considering required alignment, `bufferImageGranularity`, and `nonCoherentAtomSize`). /// /// ![Allocations without margin](../gfx/Margins_1.png) /// /// Define debugMargin to some non-zero value (e.g. 16) to enforce specified /// number of bytes as a margin before and after every allocation. /// If your bug goes away after enabling margins, it means it may be caused by memory /// being overwritten outside of allocation boundaries. It is not 100% certain though. /// Change in application behavior may also be caused by different order and distribution /// of allocations across memory blocks after margins are applied. /// /// The margin is applied also before first and after last allocation in a block. /// It may occur only once between two adjacent allocations. /// /// Margins work with all types of memory. /// /// Margin is applied only to allocations made out of memory blocks and not to dedicated /// allocations, which have their own memory block of specific size. /// It is thus not applied to allocations made using #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT flag /// or those automatically decided to put into dedicated allocations, e.g. due to its /// large size or recommended by VK_KHR_dedicated_allocation extension. /// Margins are also not active in custom pools created with #VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT flag. /// /// Margins appear in [JSON dump](@ref statistics_json_dump) as part of free space. /// /// Note that enabling margins increases memory usage and fragmentation. debugMargin: ?usize = null, // NOTE: Please modify values in the instance at the top of this file, not here. /// You can additionally set debugDetectCorruption to enable validation /// of contents of the margins. /// /// When this feature is enabled, number of bytes specified as `VMA_DEBUG_MARGIN` /// (it must be multiply of 4) before and after every allocation is filled with a magic number. /// This idea is also know as "canary". /// Memory is automatically mapped and unmapped if necessary. /// /// This number is validated automatically when the allocation is destroyed. /// If it's not equal to the expected value, `VMA_ASSERT()` is executed. /// It clearly means that either CPU or GPU overwritten the memory outside of boundaries of the allocation, /// which indicates a serious bug. /// /// You can also explicitly request checking margins of all allocations in all memory blocks /// that belong to specified memory types by using function vmaCheckCorruption(), /// or in memory blocks that belong to specified custom pool, by using function /// vmaCheckPoolCorruption(). /// /// Margin validation (corruption detection) works only for memory types that are /// `HOST_VISIBLE` and `HOST_COHERENT`. debugDetectCorruption: ?bool = null, // NOTE: Please modify values in the instance at the top of this file, not here. /// Recording functionality is disabled by default. /// To enable it, set recordingEnabled to true. /// /// <b>To record sequence of calls to a file:</b> Fill in /// VmaAllocatorCreateInfo::pRecordSettings member while creating #VmaAllocator /// object. File is opened and written during whole lifetime of the allocator. /// /// <b>To replay file:</b> Use VmaReplay - standalone command-line program. /// Precompiled binary can be found in "bin" directory. /// Its source can be found in "src/VmaReplay" directory. /// Its project is generated by Premake. /// Command line syntax is printed when the program is launched without parameters. /// Basic usage: /// /// VmaReplay.exe MyRecording.csv /// /// <b>Documentation of file format</b> can be found in file: "docs/Recording file format.md". /// It's a human-readable, text file in CSV format (Comma Separated Values). /// /// \section record_and_replay_additional_considerations Additional considerations /// /// - Replaying file that was recorded on a different GPU (with different parameters /// like `bufferImageGranularity`, `nonCoherentAtomSize`, and especially different /// set of memory heaps and types) may give different performance and memory usage /// results, as well as issue some warnings and errors. /// - Current implementation of recording in VMA, as well as VmaReplay application, is /// coded and tested only on Windows. Inclusion of recording code is driven by /// `VMA_RECORDING_ENABLED` macro. Support for other platforms should be easy to /// add. Contributions are welcomed. recordingEnabled: ?bool = null, // NOTE: Please modify values in the instance at the top of this file, not here. /// Minimum value for VkPhysicalDeviceLimits::bufferImageGranularity. /// Set to more than 1 for debugging purposes only. Must be power of two. debugMinBufferImageGranularity: ?usize = null, // NOTE: Please modify values in the instance at the top of this file, not here. /// Set this to 1 for debugging purposes only, to enable single mutex protecting all /// entry calls to the library. Can be useful for debugging multithreading issues. debugGlobalMutex: ?bool = null, // NOTE: Please modify values in the instance at the top of this file, not here. /// Whether to use C++ STL containers for VMA internal data useStlContainers: ?bool = null, // NOTE: Please modify values in the instance at the top of this file, not here. /// Set to true to always use STL mutex, false otherwise. /// If null, the library will choose based on whether /// the compiler supports C++17. useStlSharedMutex: ?bool = null, // NOTE: Please modify values in the instance at the top of this file, not here. // Set this to true to enable functions: vmaBuildStatsString, vmaFreeStatsString. statsStringEnabled: bool = true, // NOTE: Please modify values in the instance at the top of this file, not here. /// Set this value to true to make the library fetch pointers to Vulkan functions /// internally, like: /// /// vulkanFunctions.vkAllocateMemory = &vkAllocateMemory; /// /// Set to false if you are going to provide you own pointers to Vulkan functions via /// AllocatorCreateInfo::pVulkanFunctions. staticVulkanFunctions: bool = true, // NOTE: Please modify values in the instance at the top of this file, not here. };
include/vma_config.zig
const std = @import("std"); const Random = std.rand.Random; const mem = std.mem; const Isaac64 = @This(); random: Random, r: [256]u64, m: [256]u64, a: u64, b: u64, c: u64, i: usize, pub fn init(init_s: u64) Isaac64 { var isaac = Isaac64{ .random = Random{ .fillFn = fill }, .r = undefined, .m = undefined, .a = undefined, .b = undefined, .c = undefined, .i = undefined, }; // seed == 0 => same result as the unseeded reference implementation isaac.seed(init_s, 1); return isaac; } fn step(self: *Isaac64, mix: u64, base: usize, comptime m1: usize, comptime m2: usize) void { const x = self.m[base + m1]; self.a = mix +% self.m[base + m2]; const y = self.a +% self.b +% self.m[@intCast(usize, (x >> 3) % self.m.len)]; self.m[base + m1] = y; self.b = x +% self.m[@intCast(usize, (y >> 11) % self.m.len)]; self.r[self.r.len - 1 - base - m1] = self.b; } fn refill(self: *Isaac64) void { const midpoint = self.r.len / 2; self.c +%= 1; self.b +%= self.c; { var i: usize = 0; while (i < midpoint) : (i += 4) { self.step(~(self.a ^ (self.a << 21)), i + 0, 0, midpoint); self.step(self.a ^ (self.a >> 5), i + 1, 0, midpoint); self.step(self.a ^ (self.a << 12), i + 2, 0, midpoint); self.step(self.a ^ (self.a >> 33), i + 3, 0, midpoint); } } { var i: usize = 0; while (i < midpoint) : (i += 4) { self.step(~(self.a ^ (self.a << 21)), i + 0, midpoint, 0); self.step(self.a ^ (self.a >> 5), i + 1, midpoint, 0); self.step(self.a ^ (self.a << 12), i + 2, midpoint, 0); self.step(self.a ^ (self.a >> 33), i + 3, midpoint, 0); } } self.i = 0; } fn next(self: *Isaac64) u64 { if (self.i >= self.r.len) { self.refill(); } const value = self.r[self.i]; self.i += 1; return value; } fn seed(self: *Isaac64, init_s: u64, comptime rounds: usize) void { // We ignore the multi-pass requirement since we don't currently expose full access to // seeding the self.m array completely. mem.set(u64, self.m[0..], 0); self.m[0] = init_s; // prescrambled golden ratio constants var a = [_]u64{ 0x647c4677a2884b7c, 0xb9f8b322c73ac862, 0x8c0ea5053d4712a0, 0xb29b2e824a595524, 0x82f053db8355e0ce, 0x48fe4a0fa5a09315, 0xae985bf2cbfc89ed, 0x98f5704f6c44c0ab, }; comptime var i: usize = 0; inline while (i < rounds) : (i += 1) { var j: usize = 0; while (j < self.m.len) : (j += 8) { comptime var x1: usize = 0; inline while (x1 < 8) : (x1 += 1) { a[x1] +%= self.m[j + x1]; } a[0] -%= a[4]; a[5] ^= a[7] >> 9; a[7] +%= a[0]; a[1] -%= a[5]; a[6] ^= a[0] << 9; a[0] +%= a[1]; a[2] -%= a[6]; a[7] ^= a[1] >> 23; a[1] +%= a[2]; a[3] -%= a[7]; a[0] ^= a[2] << 15; a[2] +%= a[3]; a[4] -%= a[0]; a[1] ^= a[3] >> 14; a[3] +%= a[4]; a[5] -%= a[1]; a[2] ^= a[4] << 20; a[4] +%= a[5]; a[6] -%= a[2]; a[3] ^= a[5] >> 17; a[5] +%= a[6]; a[7] -%= a[3]; a[4] ^= a[6] << 14; a[6] +%= a[7]; comptime var x2: usize = 0; inline while (x2 < 8) : (x2 += 1) { self.m[j + x2] = a[x2]; } } } mem.set(u64, self.r[0..], 0); self.a = 0; self.b = 0; self.c = 0; self.i = self.r.len; // trigger refill on first value } fn fill(r: *Random, buf: []u8) void { const self = @fieldParentPtr(Isaac64, "random", r); var i: usize = 0; const aligned_len = buf.len - (buf.len & 7); // Fill complete 64-byte segments while (i < aligned_len) : (i += 8) { var n = self.next(); comptime var j: usize = 0; inline while (j < 8) : (j += 1) { buf[i + j] = @truncate(u8, n); n >>= 8; } } // Fill trailing, ignoring excess (cut the stream). if (i != buf.len) { var n = self.next(); while (i < buf.len) : (i += 1) { buf[i] = @truncate(u8, n); n >>= 8; } } } test "isaac64 sequence" { var r = Isaac64.init(0); // from reference implementation const seq = [_]u64{ 0xf67dfba498e4937c, 0x84a5066a9204f380, 0xfee34bd5f5514dbb, 0x4d1664739b8f80d6, 0x8607459ab52a14aa, 0x0e78bc5a98529e49, 0xfe5332822ad13777, 0x556c27525e33d01a, 0x08643ca615f3149f, 0xd0771faf3cb04714, 0x30e86f68a37b008d, 0x3074ebc0488a3adf, 0x270645ea7a2790bc, 0x5601a0a8d3763c6a, 0x2f83071f53f325dd, 0xb9090f3d42d2d2ea, }; for (seq) |s| { try std.testing.expect(s == r.next()); } } test "isaac64 fill" { var r = Isaac64.init(0); // from reference implementation const seq = [_]u64{ 0xf67dfba498e4937c, 0x84a5066a9204f380, 0xfee34bd5f5514dbb, 0x4d1664739b8f80d6, 0x8607459ab52a14aa, 0x0e78bc5a98529e49, 0xfe5332822ad13777, 0x556c27525e33d01a, 0x08643ca615f3149f, 0xd0771faf3cb04714, 0x30e86f68a37b008d, 0x3074ebc0488a3adf, 0x270645ea7a2790bc, 0x5601a0a8d3763c6a, 0x2f83071f53f325dd, 0xb9090f3d42d2d2ea, }; for (seq) |s| { var buf0: [8]u8 = undefined; var buf1: [7]u8 = undefined; std.mem.writeIntLittle(u64, &buf0, s); Isaac64.fill(&r.random, &buf1); try std.testing.expect(std.mem.eql(u8, buf0[0..7], buf1[0..])); } }
lib/std/rand/Isaac64.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const c = @cImport({ @cInclude("stb_image_write.h"); }); pub fn fileRender(outPath: [:0]const u8, shaderContext: anytype, shaderFn: anytype, width: comptime_int, height: comptime_int, allocator: *Allocator, gpa: anytype) !void { var timer = try std.time.Timer.start(); const bufSize = width * height * 3; var allocBuf = try allocator.alloc(u8, bufSize); defer allocator.free(allocBuf); var buf = @ptrCast([*c]u8, allocBuf); const rowStride = width * 3; const ThreadContext = RenderThreadContext(@TypeOf(shaderContext), @TypeOf(shaderFn), width, height); const cpuCount = try std.Thread.cpuCount(); var threadContexts = try allocator.alloc(ThreadContext, cpuCount); defer allocator.free(threadContexts); for (threadContexts) |*threadContext, index| { const partition = Partition.init(height, threadContexts.len, index); threadContext.* = ThreadContext{ .partition = partition, .buf = buf[partition.x0 * rowStride .. partition.x1 * rowStride], .shaderContext = shaderContext, .shaderFn = shaderFn, }; } var threads = try allocator.alloc(?*std.Thread, threadContexts.len); defer allocator.free(threads); for (threads) |*thread| { thread.* = null; } var fail = false; { defer { for (threads) |threadOpt, threadIndex| { if (threadOpt) |thread| { thread.wait(); if (threadContexts[threadIndex].failed) { fail = true; } } else { fail = true; } } } for (threads) |*threadOpt, index| { threadOpt.* = try std.Thread.spawn(ThreadContext.start, &threadContexts[index]); } } if (fail) { return error.ShadingThreadFailed; } const t1 = timer.lap(); var result = c.stbi_write_png(outPath, width, height, 3, buf, rowStride); if (result == 0) { return error.stbi_write_png_failed; } const t2 = timer.lap(); warnTime(t1, "shading"); warnTime(t2, "png"); std.debug.warn(" memory: {d:.1}MiB\n", .{@intToFloat(f64, gpa.total_requested_bytes) / 1024 / 1024}); } fn warnTime(time: u64, name: []const u8) void { std.debug.warn(" {s}: {any}ms\n", .{ name, time * std.time.ms_per_s / std.time.ns_per_s }); } const Partition = struct { const Self = @This(); x0: usize, x1: usize, pub fn init(n: usize, partitions: usize, index: usize) Self { return .{ .x0 = n * index / partitions, .x1 = n * (index + 1) / partitions, }; } }; const RowPartitionIterator = struct { const Self = @This(); xy: Xy, limit: Xy, pub fn init(width: usize, height: usize, rowRange: Partition) Self { return Self{ .xy = .{ .x = 0, .y = rowRange.x0 }, .limit = .{ .x = width, .y = rowRange.x1 }, }; } pub fn next(self: *Self) ?Xy { if (self.xy.y >= self.limit.y) { return null; } var result = self.xy; self.xy.x += 1; if (self.xy.x >= self.limit.x) { self.xy.x = 0; self.xy.y += 1; } return result; } pub const Xy = struct { x: usize, y: usize, }; }; fn RenderThreadContext(comptime ShaderContext: type, comptime ShaderFn: type, width: comptime_int, height: comptime_int) type { return struct { const Self = @This(); partition: Partition, buf: []u8, shaderContext: ShaderContext, shaderFn: ShaderFn, failed: bool = false, fn start(self: *Self) void { self.startCanError() catch |err| { self.failed = true; std.debug.warn("error: {}\n", .{@errorName(err)}); if (@errorReturnTrace()) |trace| { std.debug.dumpStackTrace(trace.*); } }; } fn startCanError(self: *Self) !void { var rest: []u8 = self.buf; var it = RowPartitionIterator.init(width, height, self.partition); while (it.next()) |xy| { const pixel = self.shaderFn(self.shaderContext, xy.x, xy.y); rest[0] = pixel.r; rest[1] = pixel.g; rest[2] = pixel.b; rest = rest[3..]; } } }; }
lib/pngShader.zig
pub fn isDoubleQuote(cp: u21) bool { return cp == 0x22; } pub fn isSingleQuote(cp: u21) bool { return cp == 0x27; } pub fn isHebrewLetter(cp: u21) bool { if (cp < 0x5d0 or cp > 0xfb4f) return false; return switch (cp) { 0x5d0...0x5ea => true, 0x5ef...0x5f2 => true, 0xfb1d => true, 0xfb1f...0xfb28 => true, 0xfb2a...0xfb36 => true, 0xfb38...0xfb3c => true, 0xfb3e => true, 0xfb40...0xfb41 => true, 0xfb43...0xfb44 => true, 0xfb46...0xfb4f => true, else => false, }; } pub fn isCr(cp: u21) bool { return cp == 0xd; } pub fn isLf(cp: u21) bool { return cp == 0xa; } pub fn isNewline(cp: u21) bool { if (cp < 0xb or cp > 0x2029) return false; return switch (cp) { 0xb...0xc => true, 0x85 => true, 0x2028 => true, 0x2029 => true, else => false, }; } pub fn isExtend(cp: u21) bool { if (cp < 0x300 or cp > 0xe01ef) return false; return switch (cp) { 0x300...0x36f => true, 0x483...0x487 => true, 0x488...0x489 => true, 0x591...0x5bd => true, 0x5bf => true, 0x5c1...0x5c2 => true, 0x5c4...0x5c5 => true, 0x5c7 => true, 0x610...0x61a => true, 0x64b...0x65f => true, 0x670 => true, 0x6d6...0x6dc => true, 0x6df...0x6e4 => true, 0x6e7...0x6e8 => true, 0x6ea...0x6ed => true, 0x711 => true, 0x730...0x74a => true, 0x7a6...0x7b0 => true, 0x7eb...0x7f3 => true, 0x7fd => true, 0x816...0x819 => true, 0x81b...0x823 => true, 0x825...0x827 => true, 0x829...0x82d => true, 0x859...0x85b => true, 0x898...0x89f => true, 0x8ca...0x8e1 => true, 0x8e3...0x902 => true, 0x903 => true, 0x93a => true, 0x93b => true, 0x93c => true, 0x93e...0x940 => true, 0x941...0x948 => true, 0x949...0x94c => true, 0x94d => true, 0x94e...0x94f => true, 0x951...0x957 => true, 0x962...0x963 => true, 0x981 => true, 0x982...0x983 => true, 0x9bc => true, 0x9be...0x9c0 => true, 0x9c1...0x9c4 => true, 0x9c7...0x9c8 => true, 0x9cb...0x9cc => true, 0x9cd => true, 0x9d7 => true, 0x9e2...0x9e3 => true, 0x9fe => true, 0xa01...0xa02 => true, 0xa03 => true, 0xa3c => true, 0xa3e...0xa40 => true, 0xa41...0xa42 => true, 0xa47...0xa48 => true, 0xa4b...0xa4d => true, 0xa51 => true, 0xa70...0xa71 => true, 0xa75 => true, 0xa81...0xa82 => true, 0xa83 => true, 0xabc => true, 0xabe...0xac0 => true, 0xac1...0xac5 => true, 0xac7...0xac8 => true, 0xac9 => true, 0xacb...0xacc => true, 0xacd => true, 0xae2...0xae3 => true, 0xafa...0xaff => true, 0xb01 => true, 0xb02...0xb03 => true, 0xb3c => true, 0xb3e => true, 0xb3f => true, 0xb40 => true, 0xb41...0xb44 => true, 0xb47...0xb48 => true, 0xb4b...0xb4c => true, 0xb4d => true, 0xb55...0xb56 => true, 0xb57 => true, 0xb62...0xb63 => true, 0xb82 => true, 0xbbe...0xbbf => true, 0xbc0 => true, 0xbc1...0xbc2 => true, 0xbc6...0xbc8 => true, 0xbca...0xbcc => true, 0xbcd => true, 0xbd7 => true, 0xc00 => true, 0xc01...0xc03 => true, 0xc04 => true, 0xc3c => true, 0xc3e...0xc40 => true, 0xc41...0xc44 => true, 0xc46...0xc48 => true, 0xc4a...0xc4d => true, 0xc55...0xc56 => true, 0xc62...0xc63 => true, 0xc81 => true, 0xc82...0xc83 => true, 0xcbc => true, 0xcbe => true, 0xcbf => true, 0xcc0...0xcc4 => true, 0xcc6 => true, 0xcc7...0xcc8 => true, 0xcca...0xccb => true, 0xccc...0xccd => true, 0xcd5...0xcd6 => true, 0xce2...0xce3 => true, 0xd00...0xd01 => true, 0xd02...0xd03 => true, 0xd3b...0xd3c => true, 0xd3e...0xd40 => true, 0xd41...0xd44 => true, 0xd46...0xd48 => true, 0xd4a...0xd4c => true, 0xd4d => true, 0xd57 => true, 0xd62...0xd63 => true, 0xd81 => true, 0xd82...0xd83 => true, 0xdca => true, 0xdcf...0xdd1 => true, 0xdd2...0xdd4 => true, 0xdd6 => true, 0xdd8...0xddf => true, 0xdf2...0xdf3 => true, 0xe31 => true, 0xe34...0xe3a => true, 0xe47...0xe4e => true, 0xeb1 => true, 0xeb4...0xebc => true, 0xec8...0xecd => true, 0xf18...0xf19 => true, 0xf35 => true, 0xf37 => true, 0xf39 => true, 0xf3e...0xf3f => true, 0xf71...0xf7e => true, 0xf7f => true, 0xf80...0xf84 => true, 0xf86...0xf87 => true, 0xf8d...0xf97 => true, 0xf99...0xfbc => true, 0xfc6 => true, 0x102b...0x102c => true, 0x102d...0x1030 => true, 0x1031 => true, 0x1032...0x1037 => true, 0x1038 => true, 0x1039...0x103a => true, 0x103b...0x103c => true, 0x103d...0x103e => true, 0x1056...0x1057 => true, 0x1058...0x1059 => true, 0x105e...0x1060 => true, 0x1062...0x1064 => true, 0x1067...0x106d => true, 0x1071...0x1074 => true, 0x1082 => true, 0x1083...0x1084 => true, 0x1085...0x1086 => true, 0x1087...0x108c => true, 0x108d => true, 0x108f => true, 0x109a...0x109c => true, 0x109d => true, 0x135d...0x135f => true, 0x1712...0x1714 => true, 0x1715 => true, 0x1732...0x1733 => true, 0x1734 => true, 0x1752...0x1753 => true, 0x1772...0x1773 => true, 0x17b4...0x17b5 => true, 0x17b6 => true, 0x17b7...0x17bd => true, 0x17be...0x17c5 => true, 0x17c6 => true, 0x17c7...0x17c8 => true, 0x17c9...0x17d3 => true, 0x17dd => true, 0x180b...0x180d => true, 0x180f => true, 0x1885...0x1886 => true, 0x18a9 => true, 0x1920...0x1922 => true, 0x1923...0x1926 => true, 0x1927...0x1928 => true, 0x1929...0x192b => true, 0x1930...0x1931 => true, 0x1932 => true, 0x1933...0x1938 => true, 0x1939...0x193b => true, 0x1a17...0x1a18 => true, 0x1a19...0x1a1a => true, 0x1a1b => true, 0x1a55 => true, 0x1a56 => true, 0x1a57 => true, 0x1a58...0x1a5e => true, 0x1a60 => true, 0x1a61 => true, 0x1a62 => true, 0x1a63...0x1a64 => true, 0x1a65...0x1a6c => true, 0x1a6d...0x1a72 => true, 0x1a73...0x1a7c => true, 0x1a7f => true, 0x1ab0...0x1abd => true, 0x1abe => true, 0x1abf...0x1ace => true, 0x1b00...0x1b03 => true, 0x1b04 => true, 0x1b34 => true, 0x1b35 => true, 0x1b36...0x1b3a => true, 0x1b3b => true, 0x1b3c => true, 0x1b3d...0x1b41 => true, 0x1b42 => true, 0x1b43...0x1b44 => true, 0x1b6b...0x1b73 => true, 0x1b80...0x1b81 => true, 0x1b82 => true, 0x1ba1 => true, 0x1ba2...0x1ba5 => true, 0x1ba6...0x1ba7 => true, 0x1ba8...0x1ba9 => true, 0x1baa => true, 0x1bab...0x1bad => true, 0x1be6 => true, 0x1be7 => true, 0x1be8...0x1be9 => true, 0x1bea...0x1bec => true, 0x1bed => true, 0x1bee => true, 0x1bef...0x1bf1 => true, 0x1bf2...0x1bf3 => true, 0x1c24...0x1c2b => true, 0x1c2c...0x1c33 => true, 0x1c34...0x1c35 => true, 0x1c36...0x1c37 => true, 0x1cd0...0x1cd2 => true, 0x1cd4...0x1ce0 => true, 0x1ce1 => true, 0x1ce2...0x1ce8 => true, 0x1ced => true, 0x1cf4 => true, 0x1cf7 => true, 0x1cf8...0x1cf9 => true, 0x1dc0...0x1dff => true, 0x200c => true, 0x20d0...0x20dc => true, 0x20dd...0x20e0 => true, 0x20e1 => true, 0x20e2...0x20e4 => true, 0x20e5...0x20f0 => true, 0x2cef...0x2cf1 => true, 0x2d7f => true, 0x2de0...0x2dff => true, 0x302a...0x302d => true, 0x302e...0x302f => true, 0x3099...0x309a => true, 0xa66f => true, 0xa670...0xa672 => true, 0xa674...0xa67d => true, 0xa69e...0xa69f => true, 0xa6f0...0xa6f1 => true, 0xa802 => true, 0xa806 => true, 0xa80b => true, 0xa823...0xa824 => true, 0xa825...0xa826 => true, 0xa827 => true, 0xa82c => true, 0xa880...0xa881 => true, 0xa8b4...0xa8c3 => true, 0xa8c4...0xa8c5 => true, 0xa8e0...0xa8f1 => true, 0xa8ff => true, 0xa926...0xa92d => true, 0xa947...0xa951 => true, 0xa952...0xa953 => true, 0xa980...0xa982 => true, 0xa983 => true, 0xa9b3 => true, 0xa9b4...0xa9b5 => true, 0xa9b6...0xa9b9 => true, 0xa9ba...0xa9bb => true, 0xa9bc...0xa9bd => true, 0xa9be...0xa9c0 => true, 0xa9e5 => true, 0xaa29...0xaa2e => true, 0xaa2f...0xaa30 => true, 0xaa31...0xaa32 => true, 0xaa33...0xaa34 => true, 0xaa35...0xaa36 => true, 0xaa43 => true, 0xaa4c => true, 0xaa4d => true, 0xaa7b => true, 0xaa7c => true, 0xaa7d => true, 0xaab0 => true, 0xaab2...0xaab4 => true, 0xaab7...0xaab8 => true, 0xaabe...0xaabf => true, 0xaac1 => true, 0xaaeb => true, 0xaaec...0xaaed => true, 0xaaee...0xaaef => true, 0xaaf5 => true, 0xaaf6 => true, 0xabe3...0xabe4 => true, 0xabe5 => true, 0xabe6...0xabe7 => true, 0xabe8 => true, 0xabe9...0xabea => true, 0xabec => true, 0xabed => true, 0xfb1e => true, 0xfe00...0xfe0f => true, 0xfe20...0xfe2f => true, 0xff9e...0xff9f => true, 0x101fd => true, 0x102e0 => true, 0x10376...0x1037a => true, 0x10a01...0x10a03 => true, 0x10a05...0x10a06 => true, 0x10a0c...0x10a0f => true, 0x10a38...0x10a3a => true, 0x10a3f => true, 0x10ae5...0x10ae6 => true, 0x10d24...0x10d27 => true, 0x10eab...0x10eac => true, 0x10f46...0x10f50 => true, 0x10f82...0x10f85 => true, 0x11000 => true, 0x11001 => true, 0x11002 => true, 0x11038...0x11046 => true, 0x11070 => true, 0x11073...0x11074 => true, 0x1107f...0x11081 => true, 0x11082 => true, 0x110b0...0x110b2 => true, 0x110b3...0x110b6 => true, 0x110b7...0x110b8 => true, 0x110b9...0x110ba => true, 0x110c2 => true, 0x11100...0x11102 => true, 0x11127...0x1112b => true, 0x1112c => true, 0x1112d...0x11134 => true, 0x11145...0x11146 => true, 0x11173 => true, 0x11180...0x11181 => true, 0x11182 => true, 0x111b3...0x111b5 => true, 0x111b6...0x111be => true, 0x111bf...0x111c0 => true, 0x111c9...0x111cc => true, 0x111ce => true, 0x111cf => true, 0x1122c...0x1122e => true, 0x1122f...0x11231 => true, 0x11232...0x11233 => true, 0x11234 => true, 0x11235 => true, 0x11236...0x11237 => true, 0x1123e => true, 0x112df => true, 0x112e0...0x112e2 => true, 0x112e3...0x112ea => true, 0x11300...0x11301 => true, 0x11302...0x11303 => true, 0x1133b...0x1133c => true, 0x1133e...0x1133f => true, 0x11340 => true, 0x11341...0x11344 => true, 0x11347...0x11348 => true, 0x1134b...0x1134d => true, 0x11357 => true, 0x11362...0x11363 => true, 0x11366...0x1136c => true, 0x11370...0x11374 => true, 0x11435...0x11437 => true, 0x11438...0x1143f => true, 0x11440...0x11441 => true, 0x11442...0x11444 => true, 0x11445 => true, 0x11446 => true, 0x1145e => true, 0x114b0...0x114b2 => true, 0x114b3...0x114b8 => true, 0x114b9 => true, 0x114ba => true, 0x114bb...0x114be => true, 0x114bf...0x114c0 => true, 0x114c1 => true, 0x114c2...0x114c3 => true, 0x115af...0x115b1 => true, 0x115b2...0x115b5 => true, 0x115b8...0x115bb => true, 0x115bc...0x115bd => true, 0x115be => true, 0x115bf...0x115c0 => true, 0x115dc...0x115dd => true, 0x11630...0x11632 => true, 0x11633...0x1163a => true, 0x1163b...0x1163c => true, 0x1163d => true, 0x1163e => true, 0x1163f...0x11640 => true, 0x116ab => true, 0x116ac => true, 0x116ad => true, 0x116ae...0x116af => true, 0x116b0...0x116b5 => true, 0x116b6 => true, 0x116b7 => true, 0x1171d...0x1171f => true, 0x11720...0x11721 => true, 0x11722...0x11725 => true, 0x11726 => true, 0x11727...0x1172b => true, 0x1182c...0x1182e => true, 0x1182f...0x11837 => true, 0x11838 => true, 0x11839...0x1183a => true, 0x11930...0x11935 => true, 0x11937...0x11938 => true, 0x1193b...0x1193c => true, 0x1193d => true, 0x1193e => true, 0x11940 => true, 0x11942 => true, 0x11943 => true, 0x119d1...0x119d3 => true, 0x119d4...0x119d7 => true, 0x119da...0x119db => true, 0x119dc...0x119df => true, 0x119e0 => true, 0x119e4 => true, 0x11a01...0x11a0a => true, 0x11a33...0x11a38 => true, 0x11a39 => true, 0x11a3b...0x11a3e => true, 0x11a47 => true, 0x11a51...0x11a56 => true, 0x11a57...0x11a58 => true, 0x11a59...0x11a5b => true, 0x11a8a...0x11a96 => true, 0x11a97 => true, 0x11a98...0x11a99 => true, 0x11c2f => true, 0x11c30...0x11c36 => true, 0x11c38...0x11c3d => true, 0x11c3e => true, 0x11c3f => true, 0x11c92...0x11ca7 => true, 0x11ca9 => true, 0x11caa...0x11cb0 => true, 0x11cb1 => true, 0x11cb2...0x11cb3 => true, 0x11cb4 => true, 0x11cb5...0x11cb6 => true, 0x11d31...0x11d36 => true, 0x11d3a => true, 0x11d3c...0x11d3d => true, 0x11d3f...0x11d45 => true, 0x11d47 => true, 0x11d8a...0x11d8e => true, 0x11d90...0x11d91 => true, 0x11d93...0x11d94 => true, 0x11d95 => true, 0x11d96 => true, 0x11d97 => true, 0x11ef3...0x11ef4 => true, 0x11ef5...0x11ef6 => true, 0x16af0...0x16af4 => true, 0x16b30...0x16b36 => true, 0x16f4f => true, 0x16f51...0x16f87 => true, 0x16f8f...0x16f92 => true, 0x16fe4 => true, 0x16ff0...0x16ff1 => true, 0x1bc9d...0x1bc9e => true, 0x1cf00...0x1cf2d => true, 0x1cf30...0x1cf46 => true, 0x1d165...0x1d166 => true, 0x1d167...0x1d169 => true, 0x1d16d...0x1d172 => true, 0x1d17b...0x1d182 => true, 0x1d185...0x1d18b => true, 0x1d1aa...0x1d1ad => true, 0x1d242...0x1d244 => true, 0x1da00...0x1da36 => true, 0x1da3b...0x1da6c => true, 0x1da75 => true, 0x1da84 => true, 0x1da9b...0x1da9f => true, 0x1daa1...0x1daaf => true, 0x1e000...0x1e006 => true, 0x1e008...0x1e018 => true, 0x1e01b...0x1e021 => true, 0x1e023...0x1e024 => true, 0x1e026...0x1e02a => true, 0x1e130...0x1e136 => true, 0x1e2ae => true, 0x1e2ec...0x1e2ef => true, 0x1e8d0...0x1e8d6 => true, 0x1e944...0x1e94a => true, 0x1f3fb...0x1f3ff => true, 0xe0020...0xe007f => true, 0xe0100...0xe01ef => true, else => false, }; } pub fn isRegionalIndicator(cp: u21) bool { if (cp < 0x1f1e6 or cp > 0x1f1ff) return false; return switch (cp) { 0x1f1e6...0x1f1ff => true, else => false, }; } pub fn isFormat(cp: u21) bool { if (cp < 0xad or cp > 0xe0001) return false; return switch (cp) { 0xad => true, 0x600...0x605 => true, 0x61c => true, 0x6dd => true, 0x70f => true, 0x890...0x891 => true, 0x8e2 => true, 0x180e => true, 0x200e...0x200f => true, 0x202a...0x202e => true, 0x2060...0x2064 => true, 0x2066...0x206f => true, 0xfeff => true, 0xfff9...0xfffb => true, 0x110bd => true, 0x110cd => true, 0x13430...0x13438 => true, 0x1bca0...0x1bca3 => true, 0x1d173...0x1d17a => true, 0xe0001 => true, else => false, }; } pub fn isKatakana(cp: u21) bool { if (cp < 0x3031 or cp > 0x1b167) return false; return switch (cp) { 0x3031...0x3035 => true, 0x309b...0x309c => true, 0x30a0 => true, 0x30a1...0x30fa => true, 0x30fc...0x30fe => true, 0x30ff => true, 0x31f0...0x31ff => true, 0x32d0...0x32fe => true, 0x3300...0x3357 => true, 0xff66...0xff6f => true, 0xff70 => true, 0xff71...0xff9d => true, 0x1aff0...0x1aff3 => true, 0x1aff5...0x1affb => true, 0x1affd...0x1affe => true, 0x1b000 => true, 0x1b120...0x1b122 => true, 0x1b164...0x1b167 => true, else => false, }; } pub fn isAletter(cp: u21) bool { if (cp < 0x41 or cp > 0x1f189) return false; return switch (cp) { 0x41...0x5a => true, 0x61...0x7a => true, 0xaa => true, 0xb5 => true, 0xba => true, 0xc0...0xd6 => true, 0xd8...0xf6 => true, 0xf8...0x1ba => true, 0x1bb => true, 0x1bc...0x1bf => true, 0x1c0...0x1c3 => true, 0x1c4...0x293 => true, 0x294 => true, 0x295...0x2af => true, 0x2b0...0x2c1 => true, 0x2c2...0x2c5 => true, 0x2c6...0x2d1 => true, 0x2d2...0x2d7 => true, 0x2de...0x2df => true, 0x2e0...0x2e4 => true, 0x2e5...0x2eb => true, 0x2ec => true, 0x2ed => true, 0x2ee => true, 0x2ef...0x2ff => true, 0x370...0x373 => true, 0x374 => true, 0x376...0x377 => true, 0x37a => true, 0x37b...0x37d => true, 0x37f => true, 0x386 => true, 0x388...0x38a => true, 0x38c => true, 0x38e...0x3a1 => true, 0x3a3...0x3f5 => true, 0x3f7...0x481 => true, 0x48a...0x52f => true, 0x531...0x556 => true, 0x559 => true, 0x55a...0x55c => true, 0x55e => true, 0x560...0x588 => true, 0x58a => true, 0x5f3 => true, 0x620...0x63f => true, 0x640 => true, 0x641...0x64a => true, 0x66e...0x66f => true, 0x671...0x6d3 => true, 0x6d5 => true, 0x6e5...0x6e6 => true, 0x6ee...0x6ef => true, 0x6fa...0x6fc => true, 0x6ff => true, 0x710 => true, 0x712...0x72f => true, 0x74d...0x7a5 => true, 0x7b1 => true, 0x7ca...0x7ea => true, 0x7f4...0x7f5 => true, 0x7fa => true, 0x800...0x815 => true, 0x81a => true, 0x824 => true, 0x828 => true, 0x840...0x858 => true, 0x860...0x86a => true, 0x870...0x887 => true, 0x889...0x88e => true, 0x8a0...0x8c8 => true, 0x8c9 => true, 0x904...0x939 => true, 0x93d => true, 0x950 => true, 0x958...0x961 => true, 0x971 => true, 0x972...0x980 => true, 0x985...0x98c => true, 0x98f...0x990 => true, 0x993...0x9a8 => true, 0x9aa...0x9b0 => true, 0x9b2 => true, 0x9b6...0x9b9 => true, 0x9bd => true, 0x9ce => true, 0x9dc...0x9dd => true, 0x9df...0x9e1 => true, 0x9f0...0x9f1 => true, 0x9fc => true, 0xa05...0xa0a => true, 0xa0f...0xa10 => true, 0xa13...0xa28 => true, 0xa2a...0xa30 => true, 0xa32...0xa33 => true, 0xa35...0xa36 => true, 0xa38...0xa39 => true, 0xa59...0xa5c => true, 0xa5e => true, 0xa72...0xa74 => true, 0xa85...0xa8d => true, 0xa8f...0xa91 => true, 0xa93...0xaa8 => true, 0xaaa...0xab0 => true, 0xab2...0xab3 => true, 0xab5...0xab9 => true, 0xabd => true, 0xad0 => true, 0xae0...0xae1 => true, 0xaf9 => true, 0xb05...0xb0c => true, 0xb0f...0xb10 => true, 0xb13...0xb28 => true, 0xb2a...0xb30 => true, 0xb32...0xb33 => true, 0xb35...0xb39 => true, 0xb3d => true, 0xb5c...0xb5d => true, 0xb5f...0xb61 => true, 0xb71 => true, 0xb83 => true, 0xb85...0xb8a => true, 0xb8e...0xb90 => true, 0xb92...0xb95 => true, 0xb99...0xb9a => true, 0xb9c => true, 0xb9e...0xb9f => true, 0xba3...0xba4 => true, 0xba8...0xbaa => true, 0xbae...0xbb9 => true, 0xbd0 => true, 0xc05...0xc0c => true, 0xc0e...0xc10 => true, 0xc12...0xc28 => true, 0xc2a...0xc39 => true, 0xc3d => true, 0xc58...0xc5a => true, 0xc5d => true, 0xc60...0xc61 => true, 0xc80 => true, 0xc85...0xc8c => true, 0xc8e...0xc90 => true, 0xc92...0xca8 => true, 0xcaa...0xcb3 => true, 0xcb5...0xcb9 => true, 0xcbd => true, 0xcdd...0xcde => true, 0xce0...0xce1 => true, 0xcf1...0xcf2 => true, 0xd04...0xd0c => true, 0xd0e...0xd10 => true, 0xd12...0xd3a => true, 0xd3d => true, 0xd4e => true, 0xd54...0xd56 => true, 0xd5f...0xd61 => true, 0xd7a...0xd7f => true, 0xd85...0xd96 => true, 0xd9a...0xdb1 => true, 0xdb3...0xdbb => true, 0xdbd => true, 0xdc0...0xdc6 => true, 0xf00 => true, 0xf40...0xf47 => true, 0xf49...0xf6c => true, 0xf88...0xf8c => true, 0x10a0...0x10c5 => true, 0x10c7 => true, 0x10cd => true, 0x10d0...0x10fa => true, 0x10fc => true, 0x10fd...0x10ff => true, 0x1100...0x1248 => true, 0x124a...0x124d => true, 0x1250...0x1256 => true, 0x1258 => true, 0x125a...0x125d => true, 0x1260...0x1288 => true, 0x128a...0x128d => true, 0x1290...0x12b0 => true, 0x12b2...0x12b5 => true, 0x12b8...0x12be => true, 0x12c0 => true, 0x12c2...0x12c5 => true, 0x12c8...0x12d6 => true, 0x12d8...0x1310 => true, 0x1312...0x1315 => true, 0x1318...0x135a => true, 0x1380...0x138f => true, 0x13a0...0x13f5 => true, 0x13f8...0x13fd => true, 0x1401...0x166c => true, 0x166f...0x167f => true, 0x1681...0x169a => true, 0x16a0...0x16ea => true, 0x16ee...0x16f0 => true, 0x16f1...0x16f8 => true, 0x1700...0x1711 => true, 0x171f...0x1731 => true, 0x1740...0x1751 => true, 0x1760...0x176c => true, 0x176e...0x1770 => true, 0x1820...0x1842 => true, 0x1843 => true, 0x1844...0x1878 => true, 0x1880...0x1884 => true, 0x1887...0x18a8 => true, 0x18aa => true, 0x18b0...0x18f5 => true, 0x1900...0x191e => true, 0x1a00...0x1a16 => true, 0x1b05...0x1b33 => true, 0x1b45...0x1b4c => true, 0x1b83...0x1ba0 => true, 0x1bae...0x1baf => true, 0x1bba...0x1be5 => true, 0x1c00...0x1c23 => true, 0x1c4d...0x1c4f => true, 0x1c5a...0x1c77 => true, 0x1c78...0x1c7d => true, 0x1c80...0x1c88 => true, 0x1c90...0x1cba => true, 0x1cbd...0x1cbf => true, 0x1ce9...0x1cec => true, 0x1cee...0x1cf3 => true, 0x1cf5...0x1cf6 => true, 0x1cfa => true, 0x1d00...0x1d2b => true, 0x1d2c...0x1d6a => true, 0x1d6b...0x1d77 => true, 0x1d78 => true, 0x1d79...0x1d9a => true, 0x1d9b...0x1dbf => true, 0x1e00...0x1f15 => true, 0x1f18...0x1f1d => true, 0x1f20...0x1f45 => true, 0x1f48...0x1f4d => true, 0x1f50...0x1f57 => true, 0x1f59 => true, 0x1f5b => true, 0x1f5d => true, 0x1f5f...0x1f7d => true, 0x1f80...0x1fb4 => true, 0x1fb6...0x1fbc => true, 0x1fbe => true, 0x1fc2...0x1fc4 => true, 0x1fc6...0x1fcc => true, 0x1fd0...0x1fd3 => true, 0x1fd6...0x1fdb => true, 0x1fe0...0x1fec => true, 0x1ff2...0x1ff4 => true, 0x1ff6...0x1ffc => true, 0x2071 => true, 0x207f => true, 0x2090...0x209c => true, 0x2102 => true, 0x2107 => true, 0x210a...0x2113 => true, 0x2115 => true, 0x2119...0x211d => true, 0x2124 => true, 0x2126 => true, 0x2128 => true, 0x212a...0x212d => true, 0x212f...0x2134 => true, 0x2135...0x2138 => true, 0x2139 => true, 0x213c...0x213f => true, 0x2145...0x2149 => true, 0x214e => true, 0x2160...0x2182 => true, 0x2183...0x2184 => true, 0x2185...0x2188 => true, 0x24b6...0x24e9 => true, 0x2c00...0x2c7b => true, 0x2c7c...0x2c7d => true, 0x2c7e...0x2ce4 => true, 0x2ceb...0x2cee => true, 0x2cf2...0x2cf3 => true, 0x2d00...0x2d25 => true, 0x2d27 => true, 0x2d2d => true, 0x2d30...0x2d67 => true, 0x2d6f => true, 0x2d80...0x2d96 => true, 0x2da0...0x2da6 => true, 0x2da8...0x2dae => true, 0x2db0...0x2db6 => true, 0x2db8...0x2dbe => true, 0x2dc0...0x2dc6 => true, 0x2dc8...0x2dce => true, 0x2dd0...0x2dd6 => true, 0x2dd8...0x2dde => true, 0x2e2f => true, 0x3005 => true, 0x303b => true, 0x303c => true, 0x3105...0x312f => true, 0x3131...0x318e => true, 0x31a0...0x31bf => true, 0xa000...0xa014 => true, 0xa015 => true, 0xa016...0xa48c => true, 0xa4d0...0xa4f7 => true, 0xa4f8...0xa4fd => true, 0xa500...0xa60b => true, 0xa60c => true, 0xa610...0xa61f => true, 0xa62a...0xa62b => true, 0xa640...0xa66d => true, 0xa66e => true, 0xa67f => true, 0xa680...0xa69b => true, 0xa69c...0xa69d => true, 0xa6a0...0xa6e5 => true, 0xa6e6...0xa6ef => true, 0xa708...0xa716 => true, 0xa717...0xa71f => true, 0xa720...0xa721 => true, 0xa722...0xa76f => true, 0xa770 => true, 0xa771...0xa787 => true, 0xa788 => true, 0xa789...0xa78a => true, 0xa78b...0xa78e => true, 0xa78f => true, 0xa790...0xa7ca => true, 0xa7d0...0xa7d1 => true, 0xa7d3 => true, 0xa7d5...0xa7d9 => true, 0xa7f2...0xa7f4 => true, 0xa7f5...0xa7f6 => true, 0xa7f7 => true, 0xa7f8...0xa7f9 => true, 0xa7fa => true, 0xa7fb...0xa801 => true, 0xa803...0xa805 => true, 0xa807...0xa80a => true, 0xa80c...0xa822 => true, 0xa840...0xa873 => true, 0xa882...0xa8b3 => true, 0xa8f2...0xa8f7 => true, 0xa8fb => true, 0xa8fd...0xa8fe => true, 0xa90a...0xa925 => true, 0xa930...0xa946 => true, 0xa960...0xa97c => true, 0xa984...0xa9b2 => true, 0xa9cf => true, 0xaa00...0xaa28 => true, 0xaa40...0xaa42 => true, 0xaa44...0xaa4b => true, 0xaae0...0xaaea => true, 0xaaf2 => true, 0xaaf3...0xaaf4 => true, 0xab01...0xab06 => true, 0xab09...0xab0e => true, 0xab11...0xab16 => true, 0xab20...0xab26 => true, 0xab28...0xab2e => true, 0xab30...0xab5a => true, 0xab5b => true, 0xab5c...0xab5f => true, 0xab60...0xab68 => true, 0xab69 => true, 0xab70...0xabbf => true, 0xabc0...0xabe2 => true, 0xac00...0xd7a3 => true, 0xd7b0...0xd7c6 => true, 0xd7cb...0xd7fb => true, 0xfb00...0xfb06 => true, 0xfb13...0xfb17 => true, 0xfb50...0xfbb1 => true, 0xfbd3...0xfd3d => true, 0xfd50...0xfd8f => true, 0xfd92...0xfdc7 => true, 0xfdf0...0xfdfb => true, 0xfe70...0xfe74 => true, 0xfe76...0xfefc => true, 0xff21...0xff3a => true, 0xff41...0xff5a => true, 0xffa0...0xffbe => true, 0xffc2...0xffc7 => true, 0xffca...0xffcf => true, 0xffd2...0xffd7 => true, 0xffda...0xffdc => true, 0x10000...0x1000b => true, 0x1000d...0x10026 => true, 0x10028...0x1003a => true, 0x1003c...0x1003d => true, 0x1003f...0x1004d => true, 0x10050...0x1005d => true, 0x10080...0x100fa => true, 0x10140...0x10174 => true, 0x10280...0x1029c => true, 0x102a0...0x102d0 => true, 0x10300...0x1031f => true, 0x1032d...0x10340 => true, 0x10341 => true, 0x10342...0x10349 => true, 0x1034a => true, 0x10350...0x10375 => true, 0x10380...0x1039d => true, 0x103a0...0x103c3 => true, 0x103c8...0x103cf => true, 0x103d1...0x103d5 => true, 0x10400...0x1044f => true, 0x10450...0x1049d => true, 0x104b0...0x104d3 => true, 0x104d8...0x104fb => true, 0x10500...0x10527 => true, 0x10530...0x10563 => true, 0x10570...0x1057a => true, 0x1057c...0x1058a => true, 0x1058c...0x10592 => true, 0x10594...0x10595 => true, 0x10597...0x105a1 => true, 0x105a3...0x105b1 => true, 0x105b3...0x105b9 => true, 0x105bb...0x105bc => true, 0x10600...0x10736 => true, 0x10740...0x10755 => true, 0x10760...0x10767 => true, 0x10780...0x10785 => true, 0x10787...0x107b0 => true, 0x107b2...0x107ba => true, 0x10800...0x10805 => true, 0x10808 => true, 0x1080a...0x10835 => true, 0x10837...0x10838 => true, 0x1083c => true, 0x1083f...0x10855 => true, 0x10860...0x10876 => true, 0x10880...0x1089e => true, 0x108e0...0x108f2 => true, 0x108f4...0x108f5 => true, 0x10900...0x10915 => true, 0x10920...0x10939 => true, 0x10980...0x109b7 => true, 0x109be...0x109bf => true, 0x10a00 => true, 0x10a10...0x10a13 => true, 0x10a15...0x10a17 => true, 0x10a19...0x10a35 => true, 0x10a60...0x10a7c => true, 0x10a80...0x10a9c => true, 0x10ac0...0x10ac7 => true, 0x10ac9...0x10ae4 => true, 0x10b00...0x10b35 => true, 0x10b40...0x10b55 => true, 0x10b60...0x10b72 => true, 0x10b80...0x10b91 => true, 0x10c00...0x10c48 => true, 0x10c80...0x10cb2 => true, 0x10cc0...0x10cf2 => true, 0x10d00...0x10d23 => true, 0x10e80...0x10ea9 => true, 0x10eb0...0x10eb1 => true, 0x10f00...0x10f1c => true, 0x10f27 => true, 0x10f30...0x10f45 => true, 0x10f70...0x10f81 => true, 0x10fb0...0x10fc4 => true, 0x10fe0...0x10ff6 => true, 0x11003...0x11037 => true, 0x11071...0x11072 => true, 0x11075 => true, 0x11083...0x110af => true, 0x110d0...0x110e8 => true, 0x11103...0x11126 => true, 0x11144 => true, 0x11147 => true, 0x11150...0x11172 => true, 0x11176 => true, 0x11183...0x111b2 => true, 0x111c1...0x111c4 => true, 0x111da => true, 0x111dc => true, 0x11200...0x11211 => true, 0x11213...0x1122b => true, 0x11280...0x11286 => true, 0x11288 => true, 0x1128a...0x1128d => true, 0x1128f...0x1129d => true, 0x1129f...0x112a8 => true, 0x112b0...0x112de => true, 0x11305...0x1130c => true, 0x1130f...0x11310 => true, 0x11313...0x11328 => true, 0x1132a...0x11330 => true, 0x11332...0x11333 => true, 0x11335...0x11339 => true, 0x1133d => true, 0x11350 => true, 0x1135d...0x11361 => true, 0x11400...0x11434 => true, 0x11447...0x1144a => true, 0x1145f...0x11461 => true, 0x11480...0x114af => true, 0x114c4...0x114c5 => true, 0x114c7 => true, 0x11580...0x115ae => true, 0x115d8...0x115db => true, 0x11600...0x1162f => true, 0x11644 => true, 0x11680...0x116aa => true, 0x116b8 => true, 0x11800...0x1182b => true, 0x118a0...0x118df => true, 0x118ff...0x11906 => true, 0x11909 => true, 0x1190c...0x11913 => true, 0x11915...0x11916 => true, 0x11918...0x1192f => true, 0x1193f => true, 0x11941 => true, 0x119a0...0x119a7 => true, 0x119aa...0x119d0 => true, 0x119e1 => true, 0x119e3 => true, 0x11a00 => true, 0x11a0b...0x11a32 => true, 0x11a3a => true, 0x11a50 => true, 0x11a5c...0x11a89 => true, 0x11a9d => true, 0x11ab0...0x11af8 => true, 0x11c00...0x11c08 => true, 0x11c0a...0x11c2e => true, 0x11c40 => true, 0x11c72...0x11c8f => true, 0x11d00...0x11d06 => true, 0x11d08...0x11d09 => true, 0x11d0b...0x11d30 => true, 0x11d46 => true, 0x11d60...0x11d65 => true, 0x11d67...0x11d68 => true, 0x11d6a...0x11d89 => true, 0x11d98 => true, 0x11ee0...0x11ef2 => true, 0x11fb0 => true, 0x12000...0x12399 => true, 0x12400...0x1246e => true, 0x12480...0x12543 => true, 0x12f90...0x12ff0 => true, 0x13000...0x1342e => true, 0x14400...0x14646 => true, 0x16800...0x16a38 => true, 0x16a40...0x16a5e => true, 0x16a70...0x16abe => true, 0x16ad0...0x16aed => true, 0x16b00...0x16b2f => true, 0x16b40...0x16b43 => true, 0x16b63...0x16b77 => true, 0x16b7d...0x16b8f => true, 0x16e40...0x16e7f => true, 0x16f00...0x16f4a => true, 0x16f50 => true, 0x16f93...0x16f9f => true, 0x16fe0...0x16fe1 => true, 0x16fe3 => true, 0x1bc00...0x1bc6a => true, 0x1bc70...0x1bc7c => true, 0x1bc80...0x1bc88 => true, 0x1bc90...0x1bc99 => true, 0x1d400...0x1d454 => true, 0x1d456...0x1d49c => true, 0x1d49e...0x1d49f => true, 0x1d4a2 => true, 0x1d4a5...0x1d4a6 => true, 0x1d4a9...0x1d4ac => true, 0x1d4ae...0x1d4b9 => true, 0x1d4bb => true, 0x1d4bd...0x1d4c3 => true, 0x1d4c5...0x1d505 => true, 0x1d507...0x1d50a => true, 0x1d50d...0x1d514 => true, 0x1d516...0x1d51c => true, 0x1d51e...0x1d539 => true, 0x1d53b...0x1d53e => true, 0x1d540...0x1d544 => true, 0x1d546 => true, 0x1d54a...0x1d550 => true, 0x1d552...0x1d6a5 => true, 0x1d6a8...0x1d6c0 => true, 0x1d6c2...0x1d6da => true, 0x1d6dc...0x1d6fa => true, 0x1d6fc...0x1d714 => true, 0x1d716...0x1d734 => true, 0x1d736...0x1d74e => true, 0x1d750...0x1d76e => true, 0x1d770...0x1d788 => true, 0x1d78a...0x1d7a8 => true, 0x1d7aa...0x1d7c2 => true, 0x1d7c4...0x1d7cb => true, 0x1df00...0x1df09 => true, 0x1df0a => true, 0x1df0b...0x1df1e => true, 0x1e100...0x1e12c => true, 0x1e137...0x1e13d => true, 0x1e14e => true, 0x1e290...0x1e2ad => true, 0x1e2c0...0x1e2eb => true, 0x1e7e0...0x1e7e6 => true, 0x1e7e8...0x1e7eb => true, 0x1e7ed...0x1e7ee => true, 0x1e7f0...0x1e7fe => true, 0x1e800...0x1e8c4 => true, 0x1e900...0x1e943 => true, 0x1e94b => true, 0x1ee00...0x1ee03 => true, 0x1ee05...0x1ee1f => true, 0x1ee21...0x1ee22 => true, 0x1ee24 => true, 0x1ee27 => true, 0x1ee29...0x1ee32 => true, 0x1ee34...0x1ee37 => true, 0x1ee39 => true, 0x1ee3b => true, 0x1ee42 => true, 0x1ee47 => true, 0x1ee49 => true, 0x1ee4b => true, 0x1ee4d...0x1ee4f => true, 0x1ee51...0x1ee52 => true, 0x1ee54 => true, 0x1ee57 => true, 0x1ee59 => true, 0x1ee5b => true, 0x1ee5d => true, 0x1ee5f => true, 0x1ee61...0x1ee62 => true, 0x1ee64 => true, 0x1ee67...0x1ee6a => true, 0x1ee6c...0x1ee72 => true, 0x1ee74...0x1ee77 => true, 0x1ee79...0x1ee7c => true, 0x1ee7e => true, 0x1ee80...0x1ee89 => true, 0x1ee8b...0x1ee9b => true, 0x1eea1...0x1eea3 => true, 0x1eea5...0x1eea9 => true, 0x1eeab...0x1eebb => true, 0x1f130...0x1f149 => true, 0x1f150...0x1f169 => true, 0x1f170...0x1f189 => true, else => false, }; } pub fn isMidletter(cp: u21) bool { if (cp < 0x3a or cp > 0xff1a) return false; return switch (cp) { 0x3a => true, 0xb7 => true, 0x387 => true, 0x55f => true, 0x5f4 => true, 0x2027 => true, 0xfe13 => true, 0xfe55 => true, 0xff1a => true, else => false, }; } pub fn isMidnum(cp: u21) bool { if (cp < 0x2c or cp > 0xff1b) return false; return switch (cp) { 0x2c => true, 0x3b => true, 0x37e => true, 0x589 => true, 0x60c...0x60d => true, 0x66c => true, 0x7f8 => true, 0x2044 => true, 0xfe10 => true, 0xfe14 => true, 0xfe50 => true, 0xfe54 => true, 0xff0c => true, 0xff1b => true, else => false, }; } pub fn isMidnumlet(cp: u21) bool { if (cp < 0x2e or cp > 0xff0e) return false; return switch (cp) { 0x2e => true, 0x2018 => true, 0x2019 => true, 0x2024 => true, 0xfe52 => true, 0xff07 => true, 0xff0e => true, else => false, }; } pub fn isNumeric(cp: u21) bool { if (cp < 0x30 or cp > 0x1fbf9) return false; return switch (cp) { 0x30...0x39 => true, 0x660...0x669 => true, 0x66b => true, 0x6f0...0x6f9 => true, 0x7c0...0x7c9 => true, 0x966...0x96f => true, 0x9e6...0x9ef => true, 0xa66...0xa6f => true, 0xae6...0xaef => true, 0xb66...0xb6f => true, 0xbe6...0xbef => true, 0xc66...0xc6f => true, 0xce6...0xcef => true, 0xd66...0xd6f => true, 0xde6...0xdef => true, 0xe50...0xe59 => true, 0xed0...0xed9 => true, 0xf20...0xf29 => true, 0x1040...0x1049 => true, 0x1090...0x1099 => true, 0x17e0...0x17e9 => true, 0x1810...0x1819 => true, 0x1946...0x194f => true, 0x19d0...0x19d9 => true, 0x1a80...0x1a89 => true, 0x1a90...0x1a99 => true, 0x1b50...0x1b59 => true, 0x1bb0...0x1bb9 => true, 0x1c40...0x1c49 => true, 0x1c50...0x1c59 => true, 0xa620...0xa629 => true, 0xa8d0...0xa8d9 => true, 0xa900...0xa909 => true, 0xa9d0...0xa9d9 => true, 0xa9f0...0xa9f9 => true, 0xaa50...0xaa59 => true, 0xabf0...0xabf9 => true, 0xff10...0xff19 => true, 0x104a0...0x104a9 => true, 0x10d30...0x10d39 => true, 0x11066...0x1106f => true, 0x110f0...0x110f9 => true, 0x11136...0x1113f => true, 0x111d0...0x111d9 => true, 0x112f0...0x112f9 => true, 0x11450...0x11459 => true, 0x114d0...0x114d9 => true, 0x11650...0x11659 => true, 0x116c0...0x116c9 => true, 0x11730...0x11739 => true, 0x118e0...0x118e9 => true, 0x11950...0x11959 => true, 0x11c50...0x11c59 => true, 0x11d50...0x11d59 => true, 0x11da0...0x11da9 => true, 0x16a60...0x16a69 => true, 0x16ac0...0x16ac9 => true, 0x16b50...0x16b59 => true, 0x1d7ce...0x1d7ff => true, 0x1e140...0x1e149 => true, 0x1e2f0...0x1e2f9 => true, 0x1e950...0x1e959 => true, 0x1fbf0...0x1fbf9 => true, else => false, }; } pub fn isExtendnumlet(cp: u21) bool { if (cp < 0x5f or cp > 0xff3f) return false; return switch (cp) { 0x5f => true, 0x202f => true, 0x203f...0x2040 => true, 0x2054 => true, 0xfe33...0xfe34 => true, 0xfe4d...0xfe4f => true, 0xff3f => true, else => false, }; } pub fn isZwj(cp: u21) bool { return cp == 0x200d; } pub fn isWsegspace(cp: u21) bool { if (cp < 0x20 or cp > 0x3000) return false; return switch (cp) { 0x20 => true, 0x1680 => true, 0x2000...0x2006 => true, 0x2008...0x200a => true, 0x205f => true, 0x3000 => true, else => false, }; }
.gyro/ziglyph-jecolon-github.com-c37d93b6/pkg/src/autogen/word_break_property.zig
const xlib = @import("Xlib.zig"); pub const khronos_ssize_t = c_longlong; pub const khronos_intptr_t = [*c]c_int; pub const khronos_uint16_t = [*c]c_short; pub const khronos_uint64_t = c_ulonglong; pub const khronos_int64_t = c_longlong; pub const khronos_int32_t = c_int; pub const GLenum = c_uint; pub const GLboolean = u8; pub const GLbitfield = c_uint; pub const GLvoid = anyopaque; pub const GLbyte = i8; pub const GLshort = c_short; pub const GLint = c_int; pub const GLubyte = u8; pub const GLushort = c_ushort; pub const GLuint = c_uint; pub const GLsizei = c_int; pub const GLfloat = f32; pub const GLclampf = f32; pub const GLdouble = f64; pub const GLclampd = f64; pub extern fn glClearIndex(c: GLfloat) void; pub extern fn glClearColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) void; pub extern fn glClear(mask: GLbitfield) void; pub extern fn glIndexMask(mask: GLuint) void; pub extern fn glColorMask(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean) void; pub extern fn glAlphaFunc(func: GLenum, ref: GLclampf) void; pub extern fn glBlendFunc(sfactor: GLenum, dfactor: GLenum) void; pub extern fn glLogicOp(opcode: GLenum) void; pub extern fn glCullFace(mode: GLenum) void; pub extern fn glFrontFace(mode: GLenum) void; pub extern fn glPointSize(size: GLfloat) void; pub extern fn glLineWidth(width: GLfloat) void; pub extern fn glLineStipple(factor: GLint, pattern: GLushort) void; pub extern fn glPolygonMode(face: GLenum, mode: GLenum) void; pub extern fn glPolygonOffset(factor: GLfloat, units: GLfloat) void; pub extern fn glPolygonStipple(mask: [*c]const GLubyte) void; pub extern fn glGetPolygonStipple(mask: [*c]GLubyte) void; pub extern fn glEdgeFlag(flag: GLboolean) void; pub extern fn glEdgeFlagv(flag: [*c]const GLboolean) void; pub extern fn glScissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei) void; pub extern fn glClipPlane(plane: GLenum, equation: [*c]const GLdouble) void; pub extern fn glGetClipPlane(plane: GLenum, equation: [*c]GLdouble) void; pub extern fn glDrawBuffer(mode: GLenum) void; pub extern fn glReadBuffer(mode: GLenum) void; pub extern fn glEnable(cap: GLenum) void; pub extern fn glDisable(cap: GLenum) void; pub extern fn glIsEnabled(cap: GLenum) GLboolean; pub extern fn glEnableClientState(cap: GLenum) void; pub extern fn glDisableClientState(cap: GLenum) void; pub extern fn glGetBooleanv(pname: GLenum, params: [*c]GLboolean) void; pub extern fn glGetDoublev(pname: GLenum, params: [*c]GLdouble) void; pub extern fn glGetFloatv(pname: GLenum, params: [*c]GLfloat) void; pub extern fn glGetIntegerv(pname: GLenum, params: [*c]GLint) void; pub extern fn glPushAttrib(mask: GLbitfield) void; pub extern fn glPopAttrib() void; pub extern fn glPushClientAttrib(mask: GLbitfield) void; pub extern fn glPopClientAttrib() void; pub extern fn glRenderMode(mode: GLenum) GLint; pub extern fn glGetError() GLenum; pub extern fn glGetString(name: GLenum) [*c]const GLubyte; pub extern fn glFinish() void; pub extern fn glFlush() void; pub extern fn glHint(target: GLenum, mode: GLenum) void; pub extern fn glClearDepth(depth: GLclampd) void; pub extern fn glDepthFunc(func: GLenum) void; pub extern fn glDepthMask(flag: GLboolean) void; pub extern fn glDepthRange(near_val: GLclampd, far_val: GLclampd) void; pub extern fn glClearAccum(red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat) void; pub extern fn glAccum(op: GLenum, value: GLfloat) void; pub extern fn glMatrixMode(mode: GLenum) void; pub extern fn glOrtho(left: GLdouble, right: GLdouble, bottom: GLdouble, top: GLdouble, near_val: GLdouble, far_val: GLdouble) void; pub extern fn glFrustum(left: GLdouble, right: GLdouble, bottom: GLdouble, top: GLdouble, near_val: GLdouble, far_val: GLdouble) void; pub extern fn glViewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei) void; pub extern fn glPushMatrix() void; pub extern fn glPopMatrix() void; pub extern fn glLoadIdentity() void; pub extern fn glLoadMatrixd(m: [*c]const GLdouble) void; pub extern fn glLoadMatrixf(m: [*c]const GLfloat) void; pub extern fn glMultMatrixd(m: [*c]const GLdouble) void; pub extern fn glMultMatrixf(m: [*c]const GLfloat) void; pub extern fn glRotated(angle: GLdouble, x: GLdouble, y: GLdouble, z: GLdouble) void; pub extern fn glRotatef(angle: GLfloat, x: GLfloat, y: GLfloat, z: GLfloat) void; pub extern fn glScaled(x: GLdouble, y: GLdouble, z: GLdouble) void; pub extern fn glScalef(x: GLfloat, y: GLfloat, z: GLfloat) void; pub extern fn glTranslated(x: GLdouble, y: GLdouble, z: GLdouble) void; pub extern fn glTranslatef(x: GLfloat, y: GLfloat, z: GLfloat) void; pub extern fn glIsList(list: GLuint) GLboolean; pub extern fn glDeleteLists(list: GLuint, range: GLsizei) void; pub extern fn glGenLists(range: GLsizei) GLuint; pub extern fn glNewList(list: GLuint, mode: GLenum) void; pub extern fn glEndList() void; pub extern fn glCallList(list: GLuint) void; pub extern fn glCallLists(n: GLsizei, @"type": GLenum, lists: ?*const GLvoid) void; pub extern fn glListBase(base: GLuint) void; pub extern fn glBegin(mode: GLenum) void; pub extern fn glEnd() void; pub extern fn glVertex2d(x: GLdouble, y: GLdouble) void; pub extern fn glVertex2f(x: GLfloat, y: GLfloat) void; pub extern fn glVertex2i(x: GLint, y: GLint) void; pub extern fn glVertex2s(x: GLshort, y: GLshort) void; pub extern fn glVertex3d(x: GLdouble, y: GLdouble, z: GLdouble) void; pub extern fn glVertex3f(x: GLfloat, y: GLfloat, z: GLfloat) void; pub extern fn glVertex3i(x: GLint, y: GLint, z: GLint) void; pub extern fn glVertex3s(x: GLshort, y: GLshort, z: GLshort) void; pub extern fn glVertex4d(x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble) void; pub extern fn glVertex4f(x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) void; pub extern fn glVertex4i(x: GLint, y: GLint, z: GLint, w: GLint) void; pub extern fn glVertex4s(x: GLshort, y: GLshort, z: GLshort, w: GLshort) void; pub extern fn glVertex2dv(v: [*c]const GLdouble) void; pub extern fn glVertex2fv(v: [*c]const GLfloat) void; pub extern fn glVertex2iv(v: [*c]const GLint) void; pub extern fn glVertex2sv(v: [*c]const GLshort) void; pub extern fn glVertex3dv(v: [*c]const GLdouble) void; pub extern fn glVertex3fv(v: [*c]const GLfloat) void; pub extern fn glVertex3iv(v: [*c]const GLint) void; pub extern fn glVertex3sv(v: [*c]const GLshort) void; pub extern fn glVertex4dv(v: [*c]const GLdouble) void; pub extern fn glVertex4fv(v: [*c]const GLfloat) void; pub extern fn glVertex4iv(v: [*c]const GLint) void; pub extern fn glVertex4sv(v: [*c]const GLshort) void; pub extern fn glNormal3b(nx: GLbyte, ny: GLbyte, nz: GLbyte) void; pub extern fn glNormal3d(nx: GLdouble, ny: GLdouble, nz: GLdouble) void; pub extern fn glNormal3f(nx: GLfloat, ny: GLfloat, nz: GLfloat) void; pub extern fn glNormal3i(nx: GLint, ny: GLint, nz: GLint) void; pub extern fn glNormal3s(nx: GLshort, ny: GLshort, nz: GLshort) void; pub extern fn glNormal3bv(v: [*c]const GLbyte) void; pub extern fn glNormal3dv(v: [*c]const GLdouble) void; pub extern fn glNormal3fv(v: [*c]const GLfloat) void; pub extern fn glNormal3iv(v: [*c]const GLint) void; pub extern fn glNormal3sv(v: [*c]const GLshort) void; pub extern fn glIndexd(c: GLdouble) void; pub extern fn glIndexf(c: GLfloat) void; pub extern fn glIndexi(c: GLint) void; pub extern fn glIndexs(c: GLshort) void; pub extern fn glIndexub(c: GLubyte) void; pub extern fn glIndexdv(c: [*c]const GLdouble) void; pub extern fn glIndexfv(c: [*c]const GLfloat) void; pub extern fn glIndexiv(c: [*c]const GLint) void; pub extern fn glIndexsv(c: [*c]const GLshort) void; pub extern fn glIndexubv(c: [*c]const GLubyte) void; pub extern fn glColor3b(red: GLbyte, green: GLbyte, blue: GLbyte) void; pub extern fn glColor3d(red: GLdouble, green: GLdouble, blue: GLdouble) void; pub extern fn glColor3f(red: GLfloat, green: GLfloat, blue: GLfloat) void; pub extern fn glColor3i(red: GLint, green: GLint, blue: GLint) void; pub extern fn glColor3s(red: GLshort, green: GLshort, blue: GLshort) void; pub extern fn glColor3ub(red: GLubyte, green: GLubyte, blue: GLubyte) void; pub extern fn glColor3ui(red: GLuint, green: GLuint, blue: GLuint) void; pub extern fn glColor3us(red: GLushort, green: GLushort, blue: GLushort) void; pub extern fn glColor4b(red: GLbyte, green: GLbyte, blue: GLbyte, alpha: GLbyte) void; pub extern fn glColor4d(red: GLdouble, green: GLdouble, blue: GLdouble, alpha: GLdouble) void; pub extern fn glColor4f(red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat) void; pub extern fn glColor4i(red: GLint, green: GLint, blue: GLint, alpha: GLint) void; pub extern fn glColor4s(red: GLshort, green: GLshort, blue: GLshort, alpha: GLshort) void; pub extern fn glColor4ub(red: GLubyte, green: GLubyte, blue: GLubyte, alpha: GLubyte) void; pub extern fn glColor4ui(red: GLuint, green: GLuint, blue: GLuint, alpha: GLuint) void; pub extern fn glColor4us(red: GLushort, green: GLushort, blue: GLushort, alpha: GLushort) void; pub extern fn glColor3bv(v: [*c]const GLbyte) void; pub extern fn glColor3dv(v: [*c]const GLdouble) void; pub extern fn glColor3fv(v: [*c]const GLfloat) void; pub extern fn glColor3iv(v: [*c]const GLint) void; pub extern fn glColor3sv(v: [*c]const GLshort) void; pub extern fn glColor3ubv(v: [*c]const GLubyte) void; pub extern fn glColor3uiv(v: [*c]const GLuint) void; pub extern fn glColor3usv(v: [*c]const GLushort) void; pub extern fn glColor4bv(v: [*c]const GLbyte) void; pub extern fn glColor4dv(v: [*c]const GLdouble) void; pub extern fn glColor4fv(v: [*c]const GLfloat) void; pub extern fn glColor4iv(v: [*c]const GLint) void; pub extern fn glColor4sv(v: [*c]const GLshort) void; pub extern fn glColor4ubv(v: [*c]const GLubyte) void; pub extern fn glColor4uiv(v: [*c]const GLuint) void; pub extern fn glColor4usv(v: [*c]const GLushort) void; pub extern fn glTexCoord1d(s: GLdouble) void; pub extern fn glTexCoord1f(s: GLfloat) void; pub extern fn glTexCoord1i(s: GLint) void; pub extern fn glTexCoord1s(s: GLshort) void; pub extern fn glTexCoord2d(s: GLdouble, t: GLdouble) void; pub extern fn glTexCoord2f(s: GLfloat, t: GLfloat) void; pub extern fn glTexCoord2i(s: GLint, t: GLint) void; pub extern fn glTexCoord2s(s: GLshort, t: GLshort) void; pub extern fn glTexCoord3d(s: GLdouble, t: GLdouble, r: GLdouble) void; pub extern fn glTexCoord3f(s: GLfloat, t: GLfloat, r: GLfloat) void; pub extern fn glTexCoord3i(s: GLint, t: GLint, r: GLint) void; pub extern fn glTexCoord3s(s: GLshort, t: GLshort, r: GLshort) void; pub extern fn glTexCoord4d(s: GLdouble, t: GLdouble, r: GLdouble, q: GLdouble) void; pub extern fn glTexCoord4f(s: GLfloat, t: GLfloat, r: GLfloat, q: GLfloat) void; pub extern fn glTexCoord4i(s: GLint, t: GLint, r: GLint, q: GLint) void; pub extern fn glTexCoord4s(s: GLshort, t: GLshort, r: GLshort, q: GLshort) void; pub extern fn glTexCoord1dv(v: [*c]const GLdouble) void; pub extern fn glTexCoord1fv(v: [*c]const GLfloat) void; pub extern fn glTexCoord1iv(v: [*c]const GLint) void; pub extern fn glTexCoord1sv(v: [*c]const GLshort) void; pub extern fn glTexCoord2dv(v: [*c]const GLdouble) void; pub extern fn glTexCoord2fv(v: [*c]const GLfloat) void; pub extern fn glTexCoord2iv(v: [*c]const GLint) void; pub extern fn glTexCoord2sv(v: [*c]const GLshort) void; pub extern fn glTexCoord3dv(v: [*c]const GLdouble) void; pub extern fn glTexCoord3fv(v: [*c]const GLfloat) void; pub extern fn glTexCoord3iv(v: [*c]const GLint) void; pub extern fn glTexCoord3sv(v: [*c]const GLshort) void; pub extern fn glTexCoord4dv(v: [*c]const GLdouble) void; pub extern fn glTexCoord4fv(v: [*c]const GLfloat) void; pub extern fn glTexCoord4iv(v: [*c]const GLint) void; pub extern fn glTexCoord4sv(v: [*c]const GLshort) void; pub extern fn glRasterPos2d(x: GLdouble, y: GLdouble) void; pub extern fn glRasterPos2f(x: GLfloat, y: GLfloat) void; pub extern fn glRasterPos2i(x: GLint, y: GLint) void; pub extern fn glRasterPos2s(x: GLshort, y: GLshort) void; pub extern fn glRasterPos3d(x: GLdouble, y: GLdouble, z: GLdouble) void; pub extern fn glRasterPos3f(x: GLfloat, y: GLfloat, z: GLfloat) void; pub extern fn glRasterPos3i(x: GLint, y: GLint, z: GLint) void; pub extern fn glRasterPos3s(x: GLshort, y: GLshort, z: GLshort) void; pub extern fn glRasterPos4d(x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble) void; pub extern fn glRasterPos4f(x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) void; pub extern fn glRasterPos4i(x: GLint, y: GLint, z: GLint, w: GLint) void; pub extern fn glRasterPos4s(x: GLshort, y: GLshort, z: GLshort, w: GLshort) void; pub extern fn glRasterPos2dv(v: [*c]const GLdouble) void; pub extern fn glRasterPos2fv(v: [*c]const GLfloat) void; pub extern fn glRasterPos2iv(v: [*c]const GLint) void; pub extern fn glRasterPos2sv(v: [*c]const GLshort) void; pub extern fn glRasterPos3dv(v: [*c]const GLdouble) void; pub extern fn glRasterPos3fv(v: [*c]const GLfloat) void; pub extern fn glRasterPos3iv(v: [*c]const GLint) void; pub extern fn glRasterPos3sv(v: [*c]const GLshort) void; pub extern fn glRasterPos4dv(v: [*c]const GLdouble) void; pub extern fn glRasterPos4fv(v: [*c]const GLfloat) void; pub extern fn glRasterPos4iv(v: [*c]const GLint) void; pub extern fn glRasterPos4sv(v: [*c]const GLshort) void; pub extern fn glRectd(x1: GLdouble, y1: GLdouble, x2: GLdouble, y2: GLdouble) void; pub extern fn glRectf(x1: GLfloat, y1: GLfloat, x2: GLfloat, y2: GLfloat) void; pub extern fn glRecti(x1: GLint, y1: GLint, x2: GLint, y2: GLint) void; pub extern fn glRects(x1: GLshort, y1: GLshort, x2: GLshort, y2: GLshort) void; pub extern fn glRectdv(v1: [*c]const GLdouble, v2: [*c]const GLdouble) void; pub extern fn glRectfv(v1: [*c]const GLfloat, v2: [*c]const GLfloat) void; pub extern fn glRectiv(v1: [*c]const GLint, v2: [*c]const GLint) void; pub extern fn glRectsv(v1: [*c]const GLshort, v2: [*c]const GLshort) void; pub extern fn glVertexPointer(size: GLint, @"type": GLenum, stride: GLsizei, ptr: ?*const GLvoid) void; pub extern fn glNormalPointer(@"type": GLenum, stride: GLsizei, ptr: ?*const GLvoid) void; pub extern fn glColorPointer(size: GLint, @"type": GLenum, stride: GLsizei, ptr: ?*const GLvoid) void; pub extern fn glIndexPointer(@"type": GLenum, stride: GLsizei, ptr: ?*const GLvoid) void; pub extern fn glTexCoordPointer(size: GLint, @"type": GLenum, stride: GLsizei, ptr: ?*const GLvoid) void; pub extern fn glEdgeFlagPointer(stride: GLsizei, ptr: ?*const GLvoid) void; pub extern fn glGetPointerv(pname: GLenum, params: [*c]?*GLvoid) void; pub extern fn glArrayElement(i: GLint) void; pub extern fn glDrawArrays(mode: GLenum, first: GLint, count: GLsizei) void; pub extern fn glDrawElements(mode: GLenum, count: GLsizei, @"type": GLenum, indices: ?*const GLvoid) void; pub extern fn glInterleavedArrays(format: GLenum, stride: GLsizei, pointer: ?*const GLvoid) void; pub extern fn glShadeModel(mode: GLenum) void; pub extern fn glLightf(light: GLenum, pname: GLenum, param: GLfloat) void; pub extern fn glLighti(light: GLenum, pname: GLenum, param: GLint) void; pub extern fn glLightfv(light: GLenum, pname: GLenum, params: [*c]const GLfloat) void; pub extern fn glLightiv(light: GLenum, pname: GLenum, params: [*c]const GLint) void; pub extern fn glGetLightfv(light: GLenum, pname: GLenum, params: [*c]GLfloat) void; pub extern fn glGetLightiv(light: GLenum, pname: GLenum, params: [*c]GLint) void; pub extern fn glLightModelf(pname: GLenum, param: GLfloat) void; pub extern fn glLightModeli(pname: GLenum, param: GLint) void; pub extern fn glLightModelfv(pname: GLenum, params: [*c]const GLfloat) void; pub extern fn glLightModeliv(pname: GLenum, params: [*c]const GLint) void; pub extern fn glMaterialf(face: GLenum, pname: GLenum, param: GLfloat) void; pub extern fn glMateriali(face: GLenum, pname: GLenum, param: GLint) void; pub extern fn glMaterialfv(face: GLenum, pname: GLenum, params: [*c]const GLfloat) void; pub extern fn glMaterialiv(face: GLenum, pname: GLenum, params: [*c]const GLint) void; pub extern fn glGetMaterialfv(face: GLenum, pname: GLenum, params: [*c]GLfloat) void; pub extern fn glGetMaterialiv(face: GLenum, pname: GLenum, params: [*c]GLint) void; pub extern fn glColorMaterial(face: GLenum, mode: GLenum) void; pub extern fn glPixelZoom(xfactor: GLfloat, yfactor: GLfloat) void; pub extern fn glPixelStoref(pname: GLenum, param: GLfloat) void; pub extern fn glPixelStorei(pname: GLenum, param: GLint) void; pub extern fn glPixelTransferf(pname: GLenum, param: GLfloat) void; pub extern fn glPixelTransferi(pname: GLenum, param: GLint) void; pub extern fn glPixelMapfv(map: GLenum, mapsize: GLsizei, values: [*c]const GLfloat) void; pub extern fn glPixelMapuiv(map: GLenum, mapsize: GLsizei, values: [*c]const GLuint) void; pub extern fn glPixelMapusv(map: GLenum, mapsize: GLsizei, values: [*c]const GLushort) void; pub extern fn glGetPixelMapfv(map: GLenum, values: [*c]GLfloat) void; pub extern fn glGetPixelMapuiv(map: GLenum, values: [*c]GLuint) void; pub extern fn glGetPixelMapusv(map: GLenum, values: [*c]GLushort) void; pub extern fn glBitmap(width: GLsizei, height: GLsizei, xorig: GLfloat, yorig: GLfloat, xmove: GLfloat, ymove: GLfloat, bitmap: [*c]const GLubyte) void; pub extern fn glReadPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, @"type": GLenum, pixels: ?*GLvoid) void; pub extern fn glDrawPixels(width: GLsizei, height: GLsizei, format: GLenum, @"type": GLenum, pixels: ?*const GLvoid) void; pub extern fn glCopyPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, @"type": GLenum) void; pub extern fn glStencilFunc(func: GLenum, ref: GLint, mask: GLuint) void; pub extern fn glStencilMask(mask: GLuint) void; pub extern fn glStencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum) void; pub extern fn glClearStencil(s: GLint) void; pub extern fn glTexGend(coord: GLenum, pname: GLenum, param: GLdouble) void; pub extern fn glTexGenf(coord: GLenum, pname: GLenum, param: GLfloat) void; pub extern fn glTexGeni(coord: GLenum, pname: GLenum, param: GLint) void; pub extern fn glTexGendv(coord: GLenum, pname: GLenum, params: [*c]const GLdouble) void; pub extern fn glTexGenfv(coord: GLenum, pname: GLenum, params: [*c]const GLfloat) void; pub extern fn glTexGeniv(coord: GLenum, pname: GLenum, params: [*c]const GLint) void; pub extern fn glGetTexGendv(coord: GLenum, pname: GLenum, params: [*c]GLdouble) void; pub extern fn glGetTexGenfv(coord: GLenum, pname: GLenum, params: [*c]GLfloat) void; pub extern fn glGetTexGeniv(coord: GLenum, pname: GLenum, params: [*c]GLint) void; pub extern fn glTexEnvf(target: GLenum, pname: GLenum, param: GLfloat) void; pub extern fn glTexEnvi(target: GLenum, pname: GLenum, param: GLint) void; pub extern fn glTexEnvfv(target: GLenum, pname: GLenum, params: [*c]const GLfloat) void; pub extern fn glTexEnviv(target: GLenum, pname: GLenum, params: [*c]const GLint) void; pub extern fn glGetTexEnvfv(target: GLenum, pname: GLenum, params: [*c]GLfloat) void; pub extern fn glGetTexEnviv(target: GLenum, pname: GLenum, params: [*c]GLint) void; pub extern fn glTexParameterf(target: GLenum, pname: GLenum, param: GLfloat) void; pub extern fn glTexParameteri(target: GLenum, pname: GLenum, param: GLint) void; pub extern fn glTexParameterfv(target: GLenum, pname: GLenum, params: [*c]const GLfloat) void; pub extern fn glTexParameteriv(target: GLenum, pname: GLenum, params: [*c]const GLint) void; pub extern fn glGetTexParameterfv(target: GLenum, pname: GLenum, params: [*c]GLfloat) void; pub extern fn glGetTexParameteriv(target: GLenum, pname: GLenum, params: [*c]GLint) void; pub extern fn glGetTexLevelParameterfv(target: GLenum, level: GLint, pname: GLenum, params: [*c]GLfloat) void; pub extern fn glGetTexLevelParameteriv(target: GLenum, level: GLint, pname: GLenum, params: [*c]GLint) void; pub extern fn glTexImage1D(target: GLenum, level: GLint, internalFormat: GLint, width: GLsizei, border: GLint, format: GLenum, @"type": GLenum, pixels: ?*const GLvoid) void; pub extern fn glTexImage2D(target: GLenum, level: GLint, internalFormat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, @"type": GLenum, pixels: ?*const GLvoid) void; pub extern fn glGetTexImage(target: GLenum, level: GLint, format: GLenum, @"type": GLenum, pixels: ?*GLvoid) void; pub extern fn glGenTextures(n: GLsizei, textures: [*c]GLuint) void; pub extern fn glDeleteTextures(n: GLsizei, textures: [*c]const GLuint) void; pub extern fn glBindTexture(target: GLenum, texture: GLuint) void; pub extern fn glPrioritizeTextures(n: GLsizei, textures: [*c]const GLuint, priorities: [*c]const GLclampf) void; pub extern fn glAreTexturesResident(n: GLsizei, textures: [*c]const GLuint, residences: [*c]GLboolean) GLboolean; pub extern fn glIsTexture(texture: GLuint) GLboolean; pub extern fn glTexSubImage1D(target: GLenum, level: GLint, xoffset: GLint, width: GLsizei, format: GLenum, @"type": GLenum, pixels: ?*const GLvoid) void; pub extern fn glTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, @"type": GLenum, pixels: ?*const GLvoid) void; pub extern fn glCopyTexImage1D(target: GLenum, level: GLint, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, border: GLint) void; pub extern fn glCopyTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, height: GLsizei, border: GLint) void; pub extern fn glCopyTexSubImage1D(target: GLenum, level: GLint, xoffset: GLint, x: GLint, y: GLint, width: GLsizei) void; pub extern fn glCopyTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) void; pub extern fn glMap1d(target: GLenum, @"u1": GLdouble, @"u2": GLdouble, stride: GLint, order: GLint, points: [*c]const GLdouble) void; pub extern fn glMap1f(target: GLenum, @"u1": GLfloat, @"u2": GLfloat, stride: GLint, order: GLint, points: [*c]const GLfloat) void; pub extern fn glMap2d(target: GLenum, @"u1": GLdouble, @"u2": GLdouble, ustride: GLint, uorder: GLint, v1: GLdouble, v2: GLdouble, vstride: GLint, vorder: GLint, points: [*c]const GLdouble) void; pub extern fn glMap2f(target: GLenum, @"u1": GLfloat, @"u2": GLfloat, ustride: GLint, uorder: GLint, v1: GLfloat, v2: GLfloat, vstride: GLint, vorder: GLint, points: [*c]const GLfloat) void; pub extern fn glGetMapdv(target: GLenum, query: GLenum, v: [*c]GLdouble) void; pub extern fn glGetMapfv(target: GLenum, query: GLenum, v: [*c]GLfloat) void; pub extern fn glGetMapiv(target: GLenum, query: GLenum, v: [*c]GLint) void; pub extern fn glEvalCoord1d(u: GLdouble) void; pub extern fn glEvalCoord1f(u: GLfloat) void; pub extern fn glEvalCoord1dv(u: [*c]const GLdouble) void; pub extern fn glEvalCoord1fv(u: [*c]const GLfloat) void; pub extern fn glEvalCoord2d(u: GLdouble, v: GLdouble) void; pub extern fn glEvalCoord2f(u: GLfloat, v: GLfloat) void; pub extern fn glEvalCoord2dv(u: [*c]const GLdouble) void; pub extern fn glEvalCoord2fv(u: [*c]const GLfloat) void; pub extern fn glMapGrid1d(un: GLint, @"u1": GLdouble, @"u2": GLdouble) void; pub extern fn glMapGrid1f(un: GLint, @"u1": GLfloat, @"u2": GLfloat) void; pub extern fn glMapGrid2d(un: GLint, @"u1": GLdouble, @"u2": GLdouble, vn: GLint, v1: GLdouble, v2: GLdouble) void; pub extern fn glMapGrid2f(un: GLint, @"u1": GLfloat, @"u2": GLfloat, vn: GLint, v1: GLfloat, v2: GLfloat) void; pub extern fn glEvalPoint1(i: GLint) void; pub extern fn glEvalPoint2(i: GLint, j: GLint) void; pub extern fn glEvalMesh1(mode: GLenum, @"i1": GLint, @"i2": GLint) void; pub extern fn glEvalMesh2(mode: GLenum, @"i1": GLint, @"i2": GLint, j1: GLint, j2: GLint) void; pub extern fn glFogf(pname: GLenum, param: GLfloat) void; pub extern fn glFogi(pname: GLenum, param: GLint) void; pub extern fn glFogfv(pname: GLenum, params: [*c]const GLfloat) void; pub extern fn glFogiv(pname: GLenum, params: [*c]const GLint) void; pub extern fn glFeedbackBuffer(size: GLsizei, @"type": GLenum, buffer: [*c]GLfloat) void; pub extern fn glPassThrough(token: GLfloat) void; pub extern fn glSelectBuffer(size: GLsizei, buffer: [*c]GLuint) void; pub extern fn glInitNames() void; pub extern fn glLoadName(name: GLuint) void; pub extern fn glPushName(name: GLuint) void; pub extern fn glPopName() void; pub extern fn glDrawRangeElements(mode: GLenum, start: GLuint, end: GLuint, count: GLsizei, @"type": GLenum, indices: ?*const GLvoid) void; pub extern fn glTexImage3D(target: GLenum, level: GLint, internalFormat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, @"type": GLenum, pixels: ?*const GLvoid) void; pub extern fn glTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, @"type": GLenum, pixels: ?*const GLvoid) void; pub extern fn glCopyTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) void; pub const PFNGLDRAWRANGEELEMENTSPROC = ?fn (GLenum, GLuint, GLuint, GLsizei, GLenum, ?*const GLvoid) callconv(.C) void; pub const PFNGLTEXIMAGE3DPROC = ?fn (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, ?*const GLvoid) callconv(.C) void; pub const PFNGLTEXSUBIMAGE3DPROC = ?fn (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, ?*const GLvoid) callconv(.C) void; pub const PFNGLCOPYTEXSUBIMAGE3DPROC = ?fn (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei) callconv(.C) void; pub extern fn glColorTable(target: GLenum, internalformat: GLenum, width: GLsizei, format: GLenum, @"type": GLenum, table: ?*const GLvoid) void; pub extern fn glColorSubTable(target: GLenum, start: GLsizei, count: GLsizei, format: GLenum, @"type": GLenum, data: ?*const GLvoid) void; pub extern fn glColorTableParameteriv(target: GLenum, pname: GLenum, params: [*c]const GLint) void; pub extern fn glColorTableParameterfv(target: GLenum, pname: GLenum, params: [*c]const GLfloat) void; pub extern fn glCopyColorSubTable(target: GLenum, start: GLsizei, x: GLint, y: GLint, width: GLsizei) void; pub extern fn glCopyColorTable(target: GLenum, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei) void; pub extern fn glGetColorTable(target: GLenum, format: GLenum, @"type": GLenum, table: ?*GLvoid) void; pub extern fn glGetColorTableParameterfv(target: GLenum, pname: GLenum, params: [*c]GLfloat) void; pub extern fn glGetColorTableParameteriv(target: GLenum, pname: GLenum, params: [*c]GLint) void; pub extern fn glBlendEquation(mode: GLenum) void; pub extern fn glBlendColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) void; pub extern fn glHistogram(target: GLenum, width: GLsizei, internalformat: GLenum, sink: GLboolean) void; pub extern fn glResetHistogram(target: GLenum) void; pub extern fn glGetHistogram(target: GLenum, reset: GLboolean, format: GLenum, @"type": GLenum, values: ?*GLvoid) void; pub extern fn glGetHistogramParameterfv(target: GLenum, pname: GLenum, params: [*c]GLfloat) void; pub extern fn glGetHistogramParameteriv(target: GLenum, pname: GLenum, params: [*c]GLint) void; pub extern fn glMinmax(target: GLenum, internalformat: GLenum, sink: GLboolean) void; pub extern fn glResetMinmax(target: GLenum) void; pub extern fn glGetMinmax(target: GLenum, reset: GLboolean, format: GLenum, types: GLenum, values: ?*GLvoid) void; pub extern fn glGetMinmaxParameterfv(target: GLenum, pname: GLenum, params: [*c]GLfloat) void; pub extern fn glGetMinmaxParameteriv(target: GLenum, pname: GLenum, params: [*c]GLint) void; pub extern fn glConvolutionFilter1D(target: GLenum, internalformat: GLenum, width: GLsizei, format: GLenum, @"type": GLenum, image: ?*const GLvoid) void; pub extern fn glConvolutionFilter2D(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei, format: GLenum, @"type": GLenum, image: ?*const GLvoid) void; pub extern fn glConvolutionParameterf(target: GLenum, pname: GLenum, params: GLfloat) void; pub extern fn glConvolutionParameterfv(target: GLenum, pname: GLenum, params: [*c]const GLfloat) void; pub extern fn glConvolutionParameteri(target: GLenum, pname: GLenum, params: GLint) void; pub extern fn glConvolutionParameteriv(target: GLenum, pname: GLenum, params: [*c]const GLint) void; pub extern fn glCopyConvolutionFilter1D(target: GLenum, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei) void; pub extern fn glCopyConvolutionFilter2D(target: GLenum, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, height: GLsizei) void; pub extern fn glGetConvolutionFilter(target: GLenum, format: GLenum, @"type": GLenum, image: ?*GLvoid) void; pub extern fn glGetConvolutionParameterfv(target: GLenum, pname: GLenum, params: [*c]GLfloat) void; pub extern fn glGetConvolutionParameteriv(target: GLenum, pname: GLenum, params: [*c]GLint) void; pub extern fn glSeparableFilter2D(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei, format: GLenum, @"type": GLenum, row: ?*const GLvoid, column: ?*const GLvoid) void; pub extern fn glGetSeparableFilter(target: GLenum, format: GLenum, @"type": GLenum, row: ?*GLvoid, column: ?*GLvoid, span: ?*GLvoid) void; pub extern fn glActiveTexture(texture: GLenum) void; pub extern fn glClientActiveTexture(texture: GLenum) void; pub extern fn glCompressedTexImage1D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, border: GLint, imageSize: GLsizei, data: ?*const GLvoid) void; pub extern fn glCompressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, imageSize: GLsizei, data: ?*const GLvoid) void; pub extern fn glCompressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, imageSize: GLsizei, data: ?*const GLvoid) void; pub extern fn glCompressedTexSubImage1D(target: GLenum, level: GLint, xoffset: GLint, width: GLsizei, format: GLenum, imageSize: GLsizei, data: ?*const GLvoid) void; pub extern fn glCompressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, imageSize: GLsizei, data: ?*const GLvoid) void; pub extern fn glCompressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, imageSize: GLsizei, data: ?*const GLvoid) void; pub extern fn glGetCompressedTexImage(target: GLenum, lod: GLint, img: ?*GLvoid) void; pub extern fn glMultiTexCoord1d(target: GLenum, s: GLdouble) void; pub extern fn glMultiTexCoord1dv(target: GLenum, v: [*c]const GLdouble) void; pub extern fn glMultiTexCoord1f(target: GLenum, s: GLfloat) void; pub extern fn glMultiTexCoord1fv(target: GLenum, v: [*c]const GLfloat) void; pub extern fn glMultiTexCoord1i(target: GLenum, s: GLint) void; pub extern fn glMultiTexCoord1iv(target: GLenum, v: [*c]const GLint) void; pub extern fn glMultiTexCoord1s(target: GLenum, s: GLshort) void; pub extern fn glMultiTexCoord1sv(target: GLenum, v: [*c]const GLshort) void; pub extern fn glMultiTexCoord2d(target: GLenum, s: GLdouble, t: GLdouble) void; pub extern fn glMultiTexCoord2dv(target: GLenum, v: [*c]const GLdouble) void; pub extern fn glMultiTexCoord2f(target: GLenum, s: GLfloat, t: GLfloat) void; pub extern fn glMultiTexCoord2fv(target: GLenum, v: [*c]const GLfloat) void; pub extern fn glMultiTexCoord2i(target: GLenum, s: GLint, t: GLint) void; pub extern fn glMultiTexCoord2iv(target: GLenum, v: [*c]const GLint) void; pub extern fn glMultiTexCoord2s(target: GLenum, s: GLshort, t: GLshort) void; pub extern fn glMultiTexCoord2sv(target: GLenum, v: [*c]const GLshort) void; pub extern fn glMultiTexCoord3d(target: GLenum, s: GLdouble, t: GLdouble, r: GLdouble) void; pub extern fn glMultiTexCoord3dv(target: GLenum, v: [*c]const GLdouble) void; pub extern fn glMultiTexCoord3f(target: GLenum, s: GLfloat, t: GLfloat, r: GLfloat) void; pub extern fn glMultiTexCoord3fv(target: GLenum, v: [*c]const GLfloat) void; pub extern fn glMultiTexCoord3i(target: GLenum, s: GLint, t: GLint, r: GLint) void; pub extern fn glMultiTexCoord3iv(target: GLenum, v: [*c]const GLint) void; pub extern fn glMultiTexCoord3s(target: GLenum, s: GLshort, t: GLshort, r: GLshort) void; pub extern fn glMultiTexCoord3sv(target: GLenum, v: [*c]const GLshort) void; pub extern fn glMultiTexCoord4d(target: GLenum, s: GLdouble, t: GLdouble, r: GLdouble, q: GLdouble) void; pub extern fn glMultiTexCoord4dv(target: GLenum, v: [*c]const GLdouble) void; pub extern fn glMultiTexCoord4f(target: GLenum, s: GLfloat, t: GLfloat, r: GLfloat, q: GLfloat) void; pub extern fn glMultiTexCoord4fv(target: GLenum, v: [*c]const GLfloat) void; pub extern fn glMultiTexCoord4i(target: GLenum, s: GLint, t: GLint, r: GLint, q: GLint) void; pub extern fn glMultiTexCoord4iv(target: GLenum, v: [*c]const GLint) void; pub extern fn glMultiTexCoord4s(target: GLenum, s: GLshort, t: GLshort, r: GLshort, q: GLshort) void; pub extern fn glMultiTexCoord4sv(target: GLenum, v: [*c]const GLshort) void; pub extern fn glLoadTransposeMatrixd(m: [*c]const GLdouble) void; pub extern fn glLoadTransposeMatrixf(m: [*c]const GLfloat) void; pub extern fn glMultTransposeMatrixd(m: [*c]const GLdouble) void; pub extern fn glMultTransposeMatrixf(m: [*c]const GLfloat) void; pub extern fn glSampleCoverage(value: GLclampf, invert: GLboolean) void; pub const PFNGLACTIVETEXTUREPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLSAMPLECOVERAGEPROC = ?fn (GLclampf, GLboolean) callconv(.C) void; pub const PFNGLCOMPRESSEDTEXIMAGE3DPROC = ?fn (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, ?*const GLvoid) callconv(.C) void; pub const PFNGLCOMPRESSEDTEXIMAGE2DPROC = ?fn (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, ?*const GLvoid) callconv(.C) void; pub const PFNGLCOMPRESSEDTEXIMAGE1DPROC = ?fn (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, ?*const GLvoid) callconv(.C) void; pub const PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC = ?fn (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, ?*const GLvoid) callconv(.C) void; pub const PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC = ?fn (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, ?*const GLvoid) callconv(.C) void; pub const PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC = ?fn (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, ?*const GLvoid) callconv(.C) void; pub const PFNGLGETCOMPRESSEDTEXIMAGEPROC = ?fn (GLenum, GLint, ?*GLvoid) callconv(.C) void; pub extern fn glActiveTextureARB(texture: GLenum) void; pub extern fn glClientActiveTextureARB(texture: GLenum) void; pub extern fn glMultiTexCoord1dARB(target: GLenum, s: GLdouble) void; pub extern fn glMultiTexCoord1dvARB(target: GLenum, v: [*c]const GLdouble) void; pub extern fn glMultiTexCoord1fARB(target: GLenum, s: GLfloat) void; pub extern fn glMultiTexCoord1fvARB(target: GLenum, v: [*c]const GLfloat) void; pub extern fn glMultiTexCoord1iARB(target: GLenum, s: GLint) void; pub extern fn glMultiTexCoord1ivARB(target: GLenum, v: [*c]const GLint) void; pub extern fn glMultiTexCoord1sARB(target: GLenum, s: GLshort) void; pub extern fn glMultiTexCoord1svARB(target: GLenum, v: [*c]const GLshort) void; pub extern fn glMultiTexCoord2dARB(target: GLenum, s: GLdouble, t: GLdouble) void; pub extern fn glMultiTexCoord2dvARB(target: GLenum, v: [*c]const GLdouble) void; pub extern fn glMultiTexCoord2fARB(target: GLenum, s: GLfloat, t: GLfloat) void; pub extern fn glMultiTexCoord2fvARB(target: GLenum, v: [*c]const GLfloat) void; pub extern fn glMultiTexCoord2iARB(target: GLenum, s: GLint, t: GLint) void; pub extern fn glMultiTexCoord2ivARB(target: GLenum, v: [*c]const GLint) void; pub extern fn glMultiTexCoord2sARB(target: GLenum, s: GLshort, t: GLshort) void; pub extern fn glMultiTexCoord2svARB(target: GLenum, v: [*c]const GLshort) void; pub extern fn glMultiTexCoord3dARB(target: GLenum, s: GLdouble, t: GLdouble, r: GLdouble) void; pub extern fn glMultiTexCoord3dvARB(target: GLenum, v: [*c]const GLdouble) void; pub extern fn glMultiTexCoord3fARB(target: GLenum, s: GLfloat, t: GLfloat, r: GLfloat) void; pub extern fn glMultiTexCoord3fvARB(target: GLenum, v: [*c]const GLfloat) void; pub extern fn glMultiTexCoord3iARB(target: GLenum, s: GLint, t: GLint, r: GLint) void; pub extern fn glMultiTexCoord3ivARB(target: GLenum, v: [*c]const GLint) void; pub extern fn glMultiTexCoord3sARB(target: GLenum, s: GLshort, t: GLshort, r: GLshort) void; pub extern fn glMultiTexCoord3svARB(target: GLenum, v: [*c]const GLshort) void; pub extern fn glMultiTexCoord4dARB(target: GLenum, s: GLdouble, t: GLdouble, r: GLdouble, q: GLdouble) void; pub extern fn glMultiTexCoord4dvARB(target: GLenum, v: [*c]const GLdouble) void; pub extern fn glMultiTexCoord4fARB(target: GLenum, s: GLfloat, t: GLfloat, r: GLfloat, q: GLfloat) void; pub extern fn glMultiTexCoord4fvARB(target: GLenum, v: [*c]const GLfloat) void; pub extern fn glMultiTexCoord4iARB(target: GLenum, s: GLint, t: GLint, r: GLint, q: GLint) void; pub extern fn glMultiTexCoord4ivARB(target: GLenum, v: [*c]const GLint) void; pub extern fn glMultiTexCoord4sARB(target: GLenum, s: GLshort, t: GLshort, r: GLshort, q: GLshort) void; pub extern fn glMultiTexCoord4svARB(target: GLenum, v: [*c]const GLshort) void; pub const PFNGLACTIVETEXTUREARBPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLCLIENTACTIVETEXTUREARBPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLMULTITEXCOORD1DARBPROC = ?fn (GLenum, GLdouble) callconv(.C) void; pub const PFNGLMULTITEXCOORD1DVARBPROC = ?fn (GLenum, [*c]const GLdouble) callconv(.C) void; pub const PFNGLMULTITEXCOORD1FARBPROC = ?fn (GLenum, GLfloat) callconv(.C) void; pub const PFNGLMULTITEXCOORD1FVARBPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLMULTITEXCOORD1IARBPROC = ?fn (GLenum, GLint) callconv(.C) void; pub const PFNGLMULTITEXCOORD1IVARBPROC = ?fn (GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLMULTITEXCOORD1SARBPROC = ?fn (GLenum, GLshort) callconv(.C) void; pub const PFNGLMULTITEXCOORD1SVARBPROC = ?fn (GLenum, [*c]const GLshort) callconv(.C) void; pub const PFNGLMULTITEXCOORD2DARBPROC = ?fn (GLenum, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLMULTITEXCOORD2DVARBPROC = ?fn (GLenum, [*c]const GLdouble) callconv(.C) void; pub const PFNGLMULTITEXCOORD2FARBPROC = ?fn (GLenum, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLMULTITEXCOORD2FVARBPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLMULTITEXCOORD2IARBPROC = ?fn (GLenum, GLint, GLint) callconv(.C) void; pub const PFNGLMULTITEXCOORD2IVARBPROC = ?fn (GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLMULTITEXCOORD2SARBPROC = ?fn (GLenum, GLshort, GLshort) callconv(.C) void; pub const PFNGLMULTITEXCOORD2SVARBPROC = ?fn (GLenum, [*c]const GLshort) callconv(.C) void; pub const PFNGLMULTITEXCOORD3DARBPROC = ?fn (GLenum, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLMULTITEXCOORD3DVARBPROC = ?fn (GLenum, [*c]const GLdouble) callconv(.C) void; pub const PFNGLMULTITEXCOORD3FARBPROC = ?fn (GLenum, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLMULTITEXCOORD3FVARBPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLMULTITEXCOORD3IARBPROC = ?fn (GLenum, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLMULTITEXCOORD3IVARBPROC = ?fn (GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLMULTITEXCOORD3SARBPROC = ?fn (GLenum, GLshort, GLshort, GLshort) callconv(.C) void; pub const PFNGLMULTITEXCOORD3SVARBPROC = ?fn (GLenum, [*c]const GLshort) callconv(.C) void; pub const PFNGLMULTITEXCOORD4DARBPROC = ?fn (GLenum, GLdouble, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLMULTITEXCOORD4DVARBPROC = ?fn (GLenum, [*c]const GLdouble) callconv(.C) void; pub const PFNGLMULTITEXCOORD4FARBPROC = ?fn (GLenum, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLMULTITEXCOORD4FVARBPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLMULTITEXCOORD4IARBPROC = ?fn (GLenum, GLint, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLMULTITEXCOORD4IVARBPROC = ?fn (GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLMULTITEXCOORD4SARBPROC = ?fn (GLenum, GLshort, GLshort, GLshort, GLshort) callconv(.C) void; pub const PFNGLMULTITEXCOORD4SVARBPROC = ?fn (GLenum, [*c]const GLshort) callconv(.C) void; pub const PFNGLBLENDFUNCSEPARATEPROC = ?fn (GLenum, GLenum, GLenum, GLenum) callconv(.C) void; pub const PFNGLMULTIDRAWARRAYSPROC = ?fn (GLenum, [*c]const GLint, [*c]const GLsizei, GLsizei) callconv(.C) void; pub const PFNGLMULTIDRAWELEMENTSPROC = ?fn (GLenum, [*c]const GLsizei, GLenum, [*c]const ?*const anyopaque, GLsizei) callconv(.C) void; pub const PFNGLPOINTPARAMETERFPROC = ?fn (GLenum, GLfloat) callconv(.C) void; pub const PFNGLPOINTPARAMETERFVPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPOINTPARAMETERIPROC = ?fn (GLenum, GLint) callconv(.C) void; pub const PFNGLPOINTPARAMETERIVPROC = ?fn (GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLFOGCOORDFPROC = ?fn (GLfloat) callconv(.C) void; pub const PFNGLFOGCOORDFVPROC = ?fn ([*c]const GLfloat) callconv(.C) void; pub const PFNGLFOGCOORDDPROC = ?fn (GLdouble) callconv(.C) void; pub const PFNGLFOGCOORDDVPROC = ?fn ([*c]const GLdouble) callconv(.C) void; pub const PFNGLFOGCOORDPOINTERPROC = ?fn (GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3BPROC = ?fn (GLbyte, GLbyte, GLbyte) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3BVPROC = ?fn ([*c]const GLbyte) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3DPROC = ?fn (GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3DVPROC = ?fn ([*c]const GLdouble) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3FPROC = ?fn (GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3FVPROC = ?fn ([*c]const GLfloat) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3IPROC = ?fn (GLint, GLint, GLint) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3IVPROC = ?fn ([*c]const GLint) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3SPROC = ?fn (GLshort, GLshort, GLshort) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3SVPROC = ?fn ([*c]const GLshort) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3UBPROC = ?fn (GLubyte, GLubyte, GLubyte) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3UBVPROC = ?fn ([*c]const GLubyte) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3UIPROC = ?fn (GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3UIVPROC = ?fn ([*c]const GLuint) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3USPROC = ?fn (GLushort, GLushort, GLushort) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3USVPROC = ?fn ([*c]const GLushort) callconv(.C) void; pub const PFNGLSECONDARYCOLORPOINTERPROC = ?fn (GLint, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLWINDOWPOS2DPROC = ?fn (GLdouble, GLdouble) callconv(.C) void; pub const PFNGLWINDOWPOS2DVPROC = ?fn ([*c]const GLdouble) callconv(.C) void; pub const PFNGLWINDOWPOS2FPROC = ?fn (GLfloat, GLfloat) callconv(.C) void; pub const PFNGLWINDOWPOS2FVPROC = ?fn ([*c]const GLfloat) callconv(.C) void; pub const PFNGLWINDOWPOS2IPROC = ?fn (GLint, GLint) callconv(.C) void; pub const PFNGLWINDOWPOS2IVPROC = ?fn ([*c]const GLint) callconv(.C) void; pub const PFNGLWINDOWPOS2SPROC = ?fn (GLshort, GLshort) callconv(.C) void; pub const PFNGLWINDOWPOS2SVPROC = ?fn ([*c]const GLshort) callconv(.C) void; pub const PFNGLWINDOWPOS3DPROC = ?fn (GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLWINDOWPOS3DVPROC = ?fn ([*c]const GLdouble) callconv(.C) void; pub const PFNGLWINDOWPOS3FPROC = ?fn (GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLWINDOWPOS3FVPROC = ?fn ([*c]const GLfloat) callconv(.C) void; pub const PFNGLWINDOWPOS3IPROC = ?fn (GLint, GLint, GLint) callconv(.C) void; pub const PFNGLWINDOWPOS3IVPROC = ?fn ([*c]const GLint) callconv(.C) void; pub const PFNGLWINDOWPOS3SPROC = ?fn (GLshort, GLshort, GLshort) callconv(.C) void; pub const PFNGLWINDOWPOS3SVPROC = ?fn ([*c]const GLshort) callconv(.C) void; pub const PFNGLBLENDCOLORPROC = ?fn (GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLBLENDEQUATIONPROC = ?fn (GLenum) callconv(.C) void; pub const GLsizeiptr = khronos_ssize_t; pub const GLintptr = khronos_intptr_t; pub const PFNGLGENQUERIESPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLDELETEQUERIESPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLISQUERYPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLBEGINQUERYPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLENDQUERYPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLGETQUERYIVPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETQUERYOBJECTIVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETQUERYOBJECTUIVPROC = ?fn (GLuint, GLenum, [*c]GLuint) callconv(.C) void; pub const PFNGLBINDBUFFERPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLDELETEBUFFERSPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLGENBUFFERSPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLISBUFFERPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLBUFFERDATAPROC = ?fn (GLenum, GLsizeiptr, ?*const anyopaque, GLenum) callconv(.C) void; pub const PFNGLBUFFERSUBDATAPROC = ?fn (GLenum, GLintptr, GLsizeiptr, ?*const anyopaque) callconv(.C) void; pub const PFNGLGETBUFFERSUBDATAPROC = ?fn (GLenum, GLintptr, GLsizeiptr, ?*anyopaque) callconv(.C) void; pub const PFNGLMAPBUFFERPROC = ?fn (GLenum, GLenum) callconv(.C) ?*anyopaque; pub const PFNGLUNMAPBUFFERPROC = ?fn (GLenum) callconv(.C) GLboolean; pub const PFNGLGETBUFFERPARAMETERIVPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETBUFFERPOINTERVPROC = ?fn (GLenum, GLenum, [*c]?*anyopaque) callconv(.C) void; pub const GLchar = u8; pub const PFNGLBLENDEQUATIONSEPARATEPROC = ?fn (GLenum, GLenum) callconv(.C) void; pub const PFNGLDRAWBUFFERSPROC = ?fn (GLsizei, [*c]const GLenum) callconv(.C) void; pub const PFNGLSTENCILOPSEPARATEPROC = ?fn (GLenum, GLenum, GLenum, GLenum) callconv(.C) void; pub const PFNGLSTENCILFUNCSEPARATEPROC = ?fn (GLenum, GLenum, GLint, GLuint) callconv(.C) void; pub const PFNGLSTENCILMASKSEPARATEPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLATTACHSHADERPROC = ?fn (GLuint, GLuint) callconv(.C) void; pub const PFNGLBINDATTRIBLOCATIONPROC = ?fn (GLuint, GLuint, [*c]const GLchar) callconv(.C) void; pub const PFNGLCOMPILESHADERPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLCREATEPROGRAMPROC = ?fn () callconv(.C) GLuint; pub const PFNGLCREATESHADERPROC = ?fn (GLenum) callconv(.C) GLuint; pub const PFNGLDELETEPROGRAMPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLDELETESHADERPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLDETACHSHADERPROC = ?fn (GLuint, GLuint) callconv(.C) void; pub const PFNGLDISABLEVERTEXATTRIBARRAYPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLENABLEVERTEXATTRIBARRAYPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLGETACTIVEATTRIBPROC = ?fn (GLuint, GLuint, GLsizei, [*c]GLsizei, [*c]GLint, [*c]GLenum, [*c]GLchar) callconv(.C) void; pub const PFNGLGETACTIVEUNIFORMPROC = ?fn (GLuint, GLuint, GLsizei, [*c]GLsizei, [*c]GLint, [*c]GLenum, [*c]GLchar) callconv(.C) void; pub const PFNGLGETATTACHEDSHADERSPROC = ?fn (GLuint, GLsizei, [*c]GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLGETATTRIBLOCATIONPROC = ?fn (GLuint, [*c]const GLchar) callconv(.C) GLint; pub const PFNGLGETPROGRAMIVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETPROGRAMINFOLOGPROC = ?fn (GLuint, GLsizei, [*c]GLsizei, [*c]GLchar) callconv(.C) void; pub const PFNGLGETSHADERIVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETSHADERINFOLOGPROC = ?fn (GLuint, GLsizei, [*c]GLsizei, [*c]GLchar) callconv(.C) void; pub const PFNGLGETSHADERSOURCEPROC = ?fn (GLuint, GLsizei, [*c]GLsizei, [*c]GLchar) callconv(.C) void; pub const PFNGLGETUNIFORMLOCATIONPROC = ?fn (GLuint, [*c]const GLchar) callconv(.C) GLint; pub const PFNGLGETUNIFORMFVPROC = ?fn (GLuint, GLint, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETUNIFORMIVPROC = ?fn (GLuint, GLint, [*c]GLint) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBDVPROC = ?fn (GLuint, GLenum, [*c]GLdouble) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBFVPROC = ?fn (GLuint, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBIVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBPOINTERVPROC = ?fn (GLuint, GLenum, [*c]?*anyopaque) callconv(.C) void; pub const PFNGLISPROGRAMPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLISSHADERPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLLINKPROGRAMPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLSHADERSOURCEPROC = ?fn (GLuint, GLsizei, [*c]const [*c]const GLchar, [*c]const GLint) callconv(.C) void; pub const PFNGLUSEPROGRAMPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLUNIFORM1FPROC = ?fn (GLint, GLfloat) callconv(.C) void; pub const PFNGLUNIFORM2FPROC = ?fn (GLint, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLUNIFORM3FPROC = ?fn (GLint, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLUNIFORM4FPROC = ?fn (GLint, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLUNIFORM1IPROC = ?fn (GLint, GLint) callconv(.C) void; pub const PFNGLUNIFORM2IPROC = ?fn (GLint, GLint, GLint) callconv(.C) void; pub const PFNGLUNIFORM3IPROC = ?fn (GLint, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLUNIFORM4IPROC = ?fn (GLint, GLint, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLUNIFORM1FVPROC = ?fn (GLint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLUNIFORM2FVPROC = ?fn (GLint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLUNIFORM3FVPROC = ?fn (GLint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLUNIFORM4FVPROC = ?fn (GLint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLUNIFORM1IVPROC = ?fn (GLint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLUNIFORM2IVPROC = ?fn (GLint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLUNIFORM3IVPROC = ?fn (GLint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLUNIFORM4IVPROC = ?fn (GLint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLUNIFORMMATRIX2FVPROC = ?fn (GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLUNIFORMMATRIX3FVPROC = ?fn (GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLUNIFORMMATRIX4FVPROC = ?fn (GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVALIDATEPROGRAMPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIB1DPROC = ?fn (GLuint, GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB1DVPROC = ?fn (GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB1FPROC = ?fn (GLuint, GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB1FVPROC = ?fn (GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB1SPROC = ?fn (GLuint, GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB1SVPROC = ?fn (GLuint, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB2DPROC = ?fn (GLuint, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB2DVPROC = ?fn (GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB2FPROC = ?fn (GLuint, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB2FVPROC = ?fn (GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB2SPROC = ?fn (GLuint, GLshort, GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB2SVPROC = ?fn (GLuint, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB3DPROC = ?fn (GLuint, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB3DVPROC = ?fn (GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB3FPROC = ?fn (GLuint, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB3FVPROC = ?fn (GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB3SPROC = ?fn (GLuint, GLshort, GLshort, GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB3SVPROC = ?fn (GLuint, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB4NBVPROC = ?fn (GLuint, [*c]const GLbyte) callconv(.C) void; pub const PFNGLVERTEXATTRIB4NIVPROC = ?fn (GLuint, [*c]const GLint) callconv(.C) void; pub const PFNGLVERTEXATTRIB4NSVPROC = ?fn (GLuint, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB4NUBPROC = ?fn (GLuint, GLubyte, GLubyte, GLubyte, GLubyte) callconv(.C) void; pub const PFNGLVERTEXATTRIB4NUBVPROC = ?fn (GLuint, [*c]const GLubyte) callconv(.C) void; pub const PFNGLVERTEXATTRIB4NUIVPROC = ?fn (GLuint, [*c]const GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIB4NUSVPROC = ?fn (GLuint, [*c]const GLushort) callconv(.C) void; pub const PFNGLVERTEXATTRIB4BVPROC = ?fn (GLuint, [*c]const GLbyte) callconv(.C) void; pub const PFNGLVERTEXATTRIB4DPROC = ?fn (GLuint, GLdouble, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB4DVPROC = ?fn (GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB4FPROC = ?fn (GLuint, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB4FVPROC = ?fn (GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB4IVPROC = ?fn (GLuint, [*c]const GLint) callconv(.C) void; pub const PFNGLVERTEXATTRIB4SPROC = ?fn (GLuint, GLshort, GLshort, GLshort, GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB4SVPROC = ?fn (GLuint, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB4UBVPROC = ?fn (GLuint, [*c]const GLubyte) callconv(.C) void; pub const PFNGLVERTEXATTRIB4UIVPROC = ?fn (GLuint, [*c]const GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIB4USVPROC = ?fn (GLuint, [*c]const GLushort) callconv(.C) void; pub const PFNGLVERTEXATTRIBPOINTERPROC = ?fn (GLuint, GLint, GLenum, GLboolean, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLUNIFORMMATRIX2X3FVPROC = ?fn (GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLUNIFORMMATRIX3X2FVPROC = ?fn (GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLUNIFORMMATRIX2X4FVPROC = ?fn (GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLUNIFORMMATRIX4X2FVPROC = ?fn (GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLUNIFORMMATRIX3X4FVPROC = ?fn (GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLUNIFORMMATRIX4X3FVPROC = ?fn (GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const GLhalf = khronos_uint16_t; pub const PFNGLCOLORMASKIPROC = ?fn (GLuint, GLboolean, GLboolean, GLboolean, GLboolean) callconv(.C) void; pub const PFNGLGETBOOLEANI_VPROC = ?fn (GLenum, GLuint, [*c]GLboolean) callconv(.C) void; pub const PFNGLGETINTEGERI_VPROC = ?fn (GLenum, GLuint, [*c]GLint) callconv(.C) void; pub const PFNGLENABLEIPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLDISABLEIPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLISENABLEDIPROC = ?fn (GLenum, GLuint) callconv(.C) GLboolean; pub const PFNGLBEGINTRANSFORMFEEDBACKPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLENDTRANSFORMFEEDBACKPROC = ?fn () callconv(.C) void; pub const PFNGLBINDBUFFERRANGEPROC = ?fn (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr) callconv(.C) void; pub const PFNGLBINDBUFFERBASEPROC = ?fn (GLenum, GLuint, GLuint) callconv(.C) void; pub const PFNGLTRANSFORMFEEDBACKVARYINGSPROC = ?fn (GLuint, GLsizei, [*c]const [*c]const GLchar, GLenum) callconv(.C) void; pub const PFNGLGETTRANSFORMFEEDBACKVARYINGPROC = ?fn (GLuint, GLuint, GLsizei, [*c]GLsizei, [*c]GLsizei, [*c]GLenum, [*c]GLchar) callconv(.C) void; pub const PFNGLCLAMPCOLORPROC = ?fn (GLenum, GLenum) callconv(.C) void; pub const PFNGLBEGINCONDITIONALRENDERPROC = ?fn (GLuint, GLenum) callconv(.C) void; pub const PFNGLENDCONDITIONALRENDERPROC = ?fn () callconv(.C) void; pub const PFNGLVERTEXATTRIBIPOINTERPROC = ?fn (GLuint, GLint, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBIIVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBIUIVPROC = ?fn (GLuint, GLenum, [*c]GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI1IPROC = ?fn (GLuint, GLint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI2IPROC = ?fn (GLuint, GLint, GLint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI3IPROC = ?fn (GLuint, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI4IPROC = ?fn (GLuint, GLint, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI1UIPROC = ?fn (GLuint, GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI2UIPROC = ?fn (GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI3UIPROC = ?fn (GLuint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI4UIPROC = ?fn (GLuint, GLuint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI1IVPROC = ?fn (GLuint, [*c]const GLint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI2IVPROC = ?fn (GLuint, [*c]const GLint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI3IVPROC = ?fn (GLuint, [*c]const GLint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI4IVPROC = ?fn (GLuint, [*c]const GLint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI1UIVPROC = ?fn (GLuint, [*c]const GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI2UIVPROC = ?fn (GLuint, [*c]const GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI3UIVPROC = ?fn (GLuint, [*c]const GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI4UIVPROC = ?fn (GLuint, [*c]const GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI4BVPROC = ?fn (GLuint, [*c]const GLbyte) callconv(.C) void; pub const PFNGLVERTEXATTRIBI4SVPROC = ?fn (GLuint, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIBI4UBVPROC = ?fn (GLuint, [*c]const GLubyte) callconv(.C) void; pub const PFNGLVERTEXATTRIBI4USVPROC = ?fn (GLuint, [*c]const GLushort) callconv(.C) void; pub const PFNGLGETUNIFORMUIVPROC = ?fn (GLuint, GLint, [*c]GLuint) callconv(.C) void; pub const PFNGLBINDFRAGDATALOCATIONPROC = ?fn (GLuint, GLuint, [*c]const GLchar) callconv(.C) void; pub const PFNGLGETFRAGDATALOCATIONPROC = ?fn (GLuint, [*c]const GLchar) callconv(.C) GLint; pub const PFNGLUNIFORM1UIPROC = ?fn (GLint, GLuint) callconv(.C) void; pub const PFNGLUNIFORM2UIPROC = ?fn (GLint, GLuint, GLuint) callconv(.C) void; pub const PFNGLUNIFORM3UIPROC = ?fn (GLint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLUNIFORM4UIPROC = ?fn (GLint, GLuint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLUNIFORM1UIVPROC = ?fn (GLint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLUNIFORM2UIVPROC = ?fn (GLint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLUNIFORM3UIVPROC = ?fn (GLint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLUNIFORM4UIVPROC = ?fn (GLint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLTEXPARAMETERIIVPROC = ?fn (GLenum, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLTEXPARAMETERIUIVPROC = ?fn (GLenum, GLenum, [*c]const GLuint) callconv(.C) void; pub const PFNGLGETTEXPARAMETERIIVPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETTEXPARAMETERIUIVPROC = ?fn (GLenum, GLenum, [*c]GLuint) callconv(.C) void; pub const PFNGLCLEARBUFFERIVPROC = ?fn (GLenum, GLint, [*c]const GLint) callconv(.C) void; pub const PFNGLCLEARBUFFERUIVPROC = ?fn (GLenum, GLint, [*c]const GLuint) callconv(.C) void; pub const PFNGLCLEARBUFFERFVPROC = ?fn (GLenum, GLint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLCLEARBUFFERFIPROC = ?fn (GLenum, GLint, GLfloat, GLint) callconv(.C) void; pub const PFNGLGETSTRINGIPROC = ?fn (GLenum, GLuint) callconv(.C) [*c]const GLubyte; pub const PFNGLISRENDERBUFFERPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLBINDRENDERBUFFERPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLDELETERENDERBUFFERSPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLGENRENDERBUFFERSPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLRENDERBUFFERSTORAGEPROC = ?fn (GLenum, GLenum, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLGETRENDERBUFFERPARAMETERIVPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLISFRAMEBUFFERPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLBINDFRAMEBUFFERPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLDELETEFRAMEBUFFERSPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLGENFRAMEBUFFERSPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLCHECKFRAMEBUFFERSTATUSPROC = ?fn (GLenum) callconv(.C) GLenum; pub const PFNGLFRAMEBUFFERTEXTURE1DPROC = ?fn (GLenum, GLenum, GLenum, GLuint, GLint) callconv(.C) void; pub const PFNGLFRAMEBUFFERTEXTURE2DPROC = ?fn (GLenum, GLenum, GLenum, GLuint, GLint) callconv(.C) void; pub const PFNGLFRAMEBUFFERTEXTURE3DPROC = ?fn (GLenum, GLenum, GLenum, GLuint, GLint, GLint) callconv(.C) void; pub const PFNGLFRAMEBUFFERRENDERBUFFERPROC = ?fn (GLenum, GLenum, GLenum, GLuint) callconv(.C) void; pub const PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC = ?fn (GLenum, GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGENERATEMIPMAPPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLBLITFRAMEBUFFERPROC = ?fn (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum) callconv(.C) void; pub const PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC = ?fn (GLenum, GLsizei, GLenum, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLFRAMEBUFFERTEXTURELAYERPROC = ?fn (GLenum, GLenum, GLuint, GLint, GLint) callconv(.C) void; pub const PFNGLMAPBUFFERRANGEPROC = ?fn (GLenum, GLintptr, GLsizeiptr, GLbitfield) callconv(.C) ?*anyopaque; pub const PFNGLFLUSHMAPPEDBUFFERRANGEPROC = ?fn (GLenum, GLintptr, GLsizeiptr) callconv(.C) void; pub const PFNGLBINDVERTEXARRAYPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLDELETEVERTEXARRAYSPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLGENVERTEXARRAYSPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLISVERTEXARRAYPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLDRAWARRAYSINSTANCEDPROC = ?fn (GLenum, GLint, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLDRAWELEMENTSINSTANCEDPROC = ?fn (GLenum, GLsizei, GLenum, ?*const anyopaque, GLsizei) callconv(.C) void; pub const PFNGLTEXBUFFERPROC = ?fn (GLenum, GLenum, GLuint) callconv(.C) void; pub const PFNGLPRIMITIVERESTARTINDEXPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLCOPYBUFFERSUBDATAPROC = ?fn (GLenum, GLenum, GLintptr, GLintptr, GLsizeiptr) callconv(.C) void; pub const PFNGLGETUNIFORMINDICESPROC = ?fn (GLuint, GLsizei, [*c]const [*c]const GLchar, [*c]GLuint) callconv(.C) void; pub const PFNGLGETACTIVEUNIFORMSIVPROC = ?fn (GLuint, GLsizei, [*c]const GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETACTIVEUNIFORMNAMEPROC = ?fn (GLuint, GLuint, GLsizei, [*c]GLsizei, [*c]GLchar) callconv(.C) void; pub const PFNGLGETUNIFORMBLOCKINDEXPROC = ?fn (GLuint, [*c]const GLchar) callconv(.C) GLuint; pub const PFNGLGETACTIVEUNIFORMBLOCKIVPROC = ?fn (GLuint, GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC = ?fn (GLuint, GLuint, GLsizei, [*c]GLsizei, [*c]GLchar) callconv(.C) void; pub const PFNGLUNIFORMBLOCKBINDINGPROC = ?fn (GLuint, GLuint, GLuint) callconv(.C) void; pub const struct___GLsync = opaque {}; pub const GLsync = ?*struct___GLsync; pub const GLuint64 = khronos_uint64_t; pub const GLint64 = khronos_int64_t; pub const PFNGLDRAWELEMENTSBASEVERTEXPROC = ?fn (GLenum, GLsizei, GLenum, ?*const anyopaque, GLint) callconv(.C) void; pub const PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC = ?fn (GLenum, GLuint, GLuint, GLsizei, GLenum, ?*const anyopaque, GLint) callconv(.C) void; pub const PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC = ?fn (GLenum, GLsizei, GLenum, ?*const anyopaque, GLsizei, GLint) callconv(.C) void; pub const PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC = ?fn (GLenum, [*c]const GLsizei, GLenum, [*c]const ?*const anyopaque, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLPROVOKINGVERTEXPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLFENCESYNCPROC = ?fn (GLenum, GLbitfield) callconv(.C) GLsync; pub const PFNGLISSYNCPROC = ?fn (GLsync) callconv(.C) GLboolean; pub const PFNGLDELETESYNCPROC = ?fn (GLsync) callconv(.C) void; pub const PFNGLCLIENTWAITSYNCPROC = ?fn (GLsync, GLbitfield, GLuint64) callconv(.C) GLenum; pub const PFNGLWAITSYNCPROC = ?fn (GLsync, GLbitfield, GLuint64) callconv(.C) void; pub const PFNGLGETINTEGER64VPROC = ?fn (GLenum, [*c]GLint64) callconv(.C) void; pub const PFNGLGETSYNCIVPROC = ?fn (GLsync, GLenum, GLsizei, [*c]GLsizei, [*c]GLint) callconv(.C) void; pub const PFNGLGETINTEGER64I_VPROC = ?fn (GLenum, GLuint, [*c]GLint64) callconv(.C) void; pub const PFNGLGETBUFFERPARAMETERI64VPROC = ?fn (GLenum, GLenum, [*c]GLint64) callconv(.C) void; pub const PFNGLFRAMEBUFFERTEXTUREPROC = ?fn (GLenum, GLenum, GLuint, GLint) callconv(.C) void; pub const PFNGLTEXIMAGE2DMULTISAMPLEPROC = ?fn (GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLboolean) callconv(.C) void; pub const PFNGLTEXIMAGE3DMULTISAMPLEPROC = ?fn (GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLsizei, GLboolean) callconv(.C) void; pub const PFNGLGETMULTISAMPLEFVPROC = ?fn (GLenum, GLuint, [*c]GLfloat) callconv(.C) void; pub const PFNGLSAMPLEMASKIPROC = ?fn (GLuint, GLbitfield) callconv(.C) void; pub const PFNGLBINDFRAGDATALOCATIONINDEXEDPROC = ?fn (GLuint, GLuint, GLuint, [*c]const GLchar) callconv(.C) void; pub const PFNGLGETFRAGDATAINDEXPROC = ?fn (GLuint, [*c]const GLchar) callconv(.C) GLint; pub const PFNGLGENSAMPLERSPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLDELETESAMPLERSPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLISSAMPLERPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLBINDSAMPLERPROC = ?fn (GLuint, GLuint) callconv(.C) void; pub const PFNGLSAMPLERPARAMETERIPROC = ?fn (GLuint, GLenum, GLint) callconv(.C) void; pub const PFNGLSAMPLERPARAMETERIVPROC = ?fn (GLuint, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLSAMPLERPARAMETERFPROC = ?fn (GLuint, GLenum, GLfloat) callconv(.C) void; pub const PFNGLSAMPLERPARAMETERFVPROC = ?fn (GLuint, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLSAMPLERPARAMETERIIVPROC = ?fn (GLuint, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLSAMPLERPARAMETERIUIVPROC = ?fn (GLuint, GLenum, [*c]const GLuint) callconv(.C) void; pub const PFNGLGETSAMPLERPARAMETERIVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETSAMPLERPARAMETERIIVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETSAMPLERPARAMETERFVPROC = ?fn (GLuint, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETSAMPLERPARAMETERIUIVPROC = ?fn (GLuint, GLenum, [*c]GLuint) callconv(.C) void; pub const PFNGLQUERYCOUNTERPROC = ?fn (GLuint, GLenum) callconv(.C) void; pub const PFNGLGETQUERYOBJECTI64VPROC = ?fn (GLuint, GLenum, [*c]GLint64) callconv(.C) void; pub const PFNGLGETQUERYOBJECTUI64VPROC = ?fn (GLuint, GLenum, [*c]GLuint64) callconv(.C) void; pub const PFNGLVERTEXATTRIBDIVISORPROC = ?fn (GLuint, GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBP1UIPROC = ?fn (GLuint, GLenum, GLboolean, GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBP1UIVPROC = ?fn (GLuint, GLenum, GLboolean, [*c]const GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBP2UIPROC = ?fn (GLuint, GLenum, GLboolean, GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBP2UIVPROC = ?fn (GLuint, GLenum, GLboolean, [*c]const GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBP3UIPROC = ?fn (GLuint, GLenum, GLboolean, GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBP3UIVPROC = ?fn (GLuint, GLenum, GLboolean, [*c]const GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBP4UIPROC = ?fn (GLuint, GLenum, GLboolean, GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBP4UIVPROC = ?fn (GLuint, GLenum, GLboolean, [*c]const GLuint) callconv(.C) void; pub const PFNGLVERTEXP2UIPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLVERTEXP2UIVPROC = ?fn (GLenum, [*c]const GLuint) callconv(.C) void; pub const PFNGLVERTEXP3UIPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLVERTEXP3UIVPROC = ?fn (GLenum, [*c]const GLuint) callconv(.C) void; pub const PFNGLVERTEXP4UIPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLVERTEXP4UIVPROC = ?fn (GLenum, [*c]const GLuint) callconv(.C) void; pub const PFNGLTEXCOORDP1UIPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLTEXCOORDP1UIVPROC = ?fn (GLenum, [*c]const GLuint) callconv(.C) void; pub const PFNGLTEXCOORDP2UIPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLTEXCOORDP2UIVPROC = ?fn (GLenum, [*c]const GLuint) callconv(.C) void; pub const PFNGLTEXCOORDP3UIPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLTEXCOORDP3UIVPROC = ?fn (GLenum, [*c]const GLuint) callconv(.C) void; pub const PFNGLTEXCOORDP4UIPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLTEXCOORDP4UIVPROC = ?fn (GLenum, [*c]const GLuint) callconv(.C) void; pub const PFNGLMULTITEXCOORDP1UIPROC = ?fn (GLenum, GLenum, GLuint) callconv(.C) void; pub const PFNGLMULTITEXCOORDP1UIVPROC = ?fn (GLenum, GLenum, [*c]const GLuint) callconv(.C) void; pub const PFNGLMULTITEXCOORDP2UIPROC = ?fn (GLenum, GLenum, GLuint) callconv(.C) void; pub const PFNGLMULTITEXCOORDP2UIVPROC = ?fn (GLenum, GLenum, [*c]const GLuint) callconv(.C) void; pub const PFNGLMULTITEXCOORDP3UIPROC = ?fn (GLenum, GLenum, GLuint) callconv(.C) void; pub const PFNGLMULTITEXCOORDP3UIVPROC = ?fn (GLenum, GLenum, [*c]const GLuint) callconv(.C) void; pub const PFNGLMULTITEXCOORDP4UIPROC = ?fn (GLenum, GLenum, GLuint) callconv(.C) void; pub const PFNGLMULTITEXCOORDP4UIVPROC = ?fn (GLenum, GLenum, [*c]const GLuint) callconv(.C) void; pub const PFNGLNORMALP3UIPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLNORMALP3UIVPROC = ?fn (GLenum, [*c]const GLuint) callconv(.C) void; pub const PFNGLCOLORP3UIPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLCOLORP3UIVPROC = ?fn (GLenum, [*c]const GLuint) callconv(.C) void; pub const PFNGLCOLORP4UIPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLCOLORP4UIVPROC = ?fn (GLenum, [*c]const GLuint) callconv(.C) void; pub const PFNGLSECONDARYCOLORP3UIPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLSECONDARYCOLORP3UIVPROC = ?fn (GLenum, [*c]const GLuint) callconv(.C) void; pub const PFNGLMINSAMPLESHADINGPROC = ?fn (GLfloat) callconv(.C) void; pub const PFNGLBLENDEQUATIONIPROC = ?fn (GLuint, GLenum) callconv(.C) void; pub const PFNGLBLENDEQUATIONSEPARATEIPROC = ?fn (GLuint, GLenum, GLenum) callconv(.C) void; pub const PFNGLBLENDFUNCIPROC = ?fn (GLuint, GLenum, GLenum) callconv(.C) void; pub const PFNGLBLENDFUNCSEPARATEIPROC = ?fn (GLuint, GLenum, GLenum, GLenum, GLenum) callconv(.C) void; pub const PFNGLDRAWARRAYSINDIRECTPROC = ?fn (GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLDRAWELEMENTSINDIRECTPROC = ?fn (GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLUNIFORM1DPROC = ?fn (GLint, GLdouble) callconv(.C) void; pub const PFNGLUNIFORM2DPROC = ?fn (GLint, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLUNIFORM3DPROC = ?fn (GLint, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLUNIFORM4DPROC = ?fn (GLint, GLdouble, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLUNIFORM1DVPROC = ?fn (GLint, GLsizei, [*c]const GLdouble) callconv(.C) void; pub const PFNGLUNIFORM2DVPROC = ?fn (GLint, GLsizei, [*c]const GLdouble) callconv(.C) void; pub const PFNGLUNIFORM3DVPROC = ?fn (GLint, GLsizei, [*c]const GLdouble) callconv(.C) void; pub const PFNGLUNIFORM4DVPROC = ?fn (GLint, GLsizei, [*c]const GLdouble) callconv(.C) void; pub const PFNGLUNIFORMMATRIX2DVPROC = ?fn (GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLUNIFORMMATRIX3DVPROC = ?fn (GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLUNIFORMMATRIX4DVPROC = ?fn (GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLUNIFORMMATRIX2X3DVPROC = ?fn (GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLUNIFORMMATRIX2X4DVPROC = ?fn (GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLUNIFORMMATRIX3X2DVPROC = ?fn (GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLUNIFORMMATRIX3X4DVPROC = ?fn (GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLUNIFORMMATRIX4X2DVPROC = ?fn (GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLUNIFORMMATRIX4X3DVPROC = ?fn (GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLGETUNIFORMDVPROC = ?fn (GLuint, GLint, [*c]GLdouble) callconv(.C) void; pub const PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC = ?fn (GLuint, GLenum, [*c]const GLchar) callconv(.C) GLint; pub const PFNGLGETSUBROUTINEINDEXPROC = ?fn (GLuint, GLenum, [*c]const GLchar) callconv(.C) GLuint; pub const PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC = ?fn (GLuint, GLenum, GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC = ?fn (GLuint, GLenum, GLuint, GLsizei, [*c]GLsizei, [*c]GLchar) callconv(.C) void; pub const PFNGLGETACTIVESUBROUTINENAMEPROC = ?fn (GLuint, GLenum, GLuint, GLsizei, [*c]GLsizei, [*c]GLchar) callconv(.C) void; pub const PFNGLUNIFORMSUBROUTINESUIVPROC = ?fn (GLenum, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLGETUNIFORMSUBROUTINEUIVPROC = ?fn (GLenum, GLint, [*c]GLuint) callconv(.C) void; pub const PFNGLGETPROGRAMSTAGEIVPROC = ?fn (GLuint, GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLPATCHPARAMETERIPROC = ?fn (GLenum, GLint) callconv(.C) void; pub const PFNGLPATCHPARAMETERFVPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLBINDTRANSFORMFEEDBACKPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLDELETETRANSFORMFEEDBACKSPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLGENTRANSFORMFEEDBACKSPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLISTRANSFORMFEEDBACKPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLPAUSETRANSFORMFEEDBACKPROC = ?fn () callconv(.C) void; pub const PFNGLRESUMETRANSFORMFEEDBACKPROC = ?fn () callconv(.C) void; pub const PFNGLDRAWTRANSFORMFEEDBACKPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC = ?fn (GLenum, GLuint, GLuint) callconv(.C) void; pub const PFNGLBEGINQUERYINDEXEDPROC = ?fn (GLenum, GLuint, GLuint) callconv(.C) void; pub const PFNGLENDQUERYINDEXEDPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLGETQUERYINDEXEDIVPROC = ?fn (GLenum, GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLRELEASESHADERCOMPILERPROC = ?fn () callconv(.C) void; pub const PFNGLSHADERBINARYPROC = ?fn (GLsizei, [*c]const GLuint, GLenum, ?*const anyopaque, GLsizei) callconv(.C) void; pub const PFNGLGETSHADERPRECISIONFORMATPROC = ?fn (GLenum, GLenum, [*c]GLint, [*c]GLint) callconv(.C) void; pub const PFNGLDEPTHRANGEFPROC = ?fn (GLfloat, GLfloat) callconv(.C) void; pub const PFNGLCLEARDEPTHFPROC = ?fn (GLfloat) callconv(.C) void; pub const PFNGLGETPROGRAMBINARYPROC = ?fn (GLuint, GLsizei, [*c]GLsizei, [*c]GLenum, ?*anyopaque) callconv(.C) void; pub const PFNGLPROGRAMBINARYPROC = ?fn (GLuint, GLenum, ?*const anyopaque, GLsizei) callconv(.C) void; pub const PFNGLPROGRAMPARAMETERIPROC = ?fn (GLuint, GLenum, GLint) callconv(.C) void; pub const PFNGLUSEPROGRAMSTAGESPROC = ?fn (GLuint, GLbitfield, GLuint) callconv(.C) void; pub const PFNGLACTIVESHADERPROGRAMPROC = ?fn (GLuint, GLuint) callconv(.C) void; pub const PFNGLCREATESHADERPROGRAMVPROC = ?fn (GLenum, GLsizei, [*c]const [*c]const GLchar) callconv(.C) GLuint; pub const PFNGLBINDPROGRAMPIPELINEPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLDELETEPROGRAMPIPELINESPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLGENPROGRAMPIPELINESPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLISPROGRAMPIPELINEPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLGETPROGRAMPIPELINEIVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1IPROC = ?fn (GLuint, GLint, GLint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1IVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1FPROC = ?fn (GLuint, GLint, GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1FVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1DPROC = ?fn (GLuint, GLint, GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1DVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1UIPROC = ?fn (GLuint, GLint, GLuint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1UIVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2IPROC = ?fn (GLuint, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2IVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2FPROC = ?fn (GLuint, GLint, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2FVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2DPROC = ?fn (GLuint, GLint, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2DVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2UIPROC = ?fn (GLuint, GLint, GLuint, GLuint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2UIVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3IPROC = ?fn (GLuint, GLint, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3IVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3FPROC = ?fn (GLuint, GLint, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3FVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3DPROC = ?fn (GLuint, GLint, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3DVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3UIPROC = ?fn (GLuint, GLint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3UIVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4IPROC = ?fn (GLuint, GLint, GLint, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4IVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4FPROC = ?fn (GLuint, GLint, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4FVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4DPROC = ?fn (GLuint, GLint, GLdouble, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4DVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4UIPROC = ?fn (GLuint, GLint, GLuint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4UIVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX2FVPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX3FVPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX4FVPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX2DVPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX3DVPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX4DVPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVALIDATEPROGRAMPIPELINEPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLGETPROGRAMPIPELINEINFOLOGPROC = ?fn (GLuint, GLsizei, [*c]GLsizei, [*c]GLchar) callconv(.C) void; pub const PFNGLVERTEXATTRIBL1DPROC = ?fn (GLuint, GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIBL2DPROC = ?fn (GLuint, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIBL3DPROC = ?fn (GLuint, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIBL4DPROC = ?fn (GLuint, GLdouble, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIBL1DVPROC = ?fn (GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIBL2DVPROC = ?fn (GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIBL3DVPROC = ?fn (GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIBL4DVPROC = ?fn (GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIBLPOINTERPROC = ?fn (GLuint, GLint, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBLDVPROC = ?fn (GLuint, GLenum, [*c]GLdouble) callconv(.C) void; pub const PFNGLVIEWPORTARRAYVPROC = ?fn (GLuint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVIEWPORTINDEXEDFPROC = ?fn (GLuint, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLVIEWPORTINDEXEDFVPROC = ?fn (GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLSCISSORARRAYVPROC = ?fn (GLuint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLSCISSORINDEXEDPROC = ?fn (GLuint, GLint, GLint, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLSCISSORINDEXEDVPROC = ?fn (GLuint, [*c]const GLint) callconv(.C) void; pub const PFNGLDEPTHRANGEARRAYVPROC = ?fn (GLuint, GLsizei, [*c]const GLdouble) callconv(.C) void; pub const PFNGLDEPTHRANGEINDEXEDPROC = ?fn (GLuint, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLGETFLOATI_VPROC = ?fn (GLenum, GLuint, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETDOUBLEI_VPROC = ?fn (GLenum, GLuint, [*c]GLdouble) callconv(.C) void; pub const PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC = ?fn (GLenum, GLint, GLsizei, GLsizei, GLuint) callconv(.C) void; pub const PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC = ?fn (GLenum, GLsizei, GLenum, ?*const anyopaque, GLsizei, GLuint) callconv(.C) void; pub const PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC = ?fn (GLenum, GLsizei, GLenum, ?*const anyopaque, GLsizei, GLint, GLuint) callconv(.C) void; pub const PFNGLGETINTERNALFORMATIVPROC = ?fn (GLenum, GLenum, GLenum, GLsizei, [*c]GLint) callconv(.C) void; pub const PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC = ?fn (GLuint, GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLBINDIMAGETEXTUREPROC = ?fn (GLuint, GLuint, GLint, GLboolean, GLint, GLenum, GLenum) callconv(.C) void; pub const PFNGLMEMORYBARRIERPROC = ?fn (GLbitfield) callconv(.C) void; pub const PFNGLTEXSTORAGE1DPROC = ?fn (GLenum, GLsizei, GLenum, GLsizei) callconv(.C) void; pub const PFNGLTEXSTORAGE2DPROC = ?fn (GLenum, GLsizei, GLenum, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLTEXSTORAGE3DPROC = ?fn (GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC = ?fn (GLenum, GLuint, GLsizei) callconv(.C) void; pub const PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC = ?fn (GLenum, GLuint, GLuint, GLsizei) callconv(.C) void; pub const GLDEBUGPROC = ?fn (GLenum, GLenum, GLuint, GLenum, GLsizei, [*c]const GLchar, ?*const anyopaque) callconv(.C) void; pub const PFNGLCLEARBUFFERDATAPROC = ?fn (GLenum, GLenum, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLCLEARBUFFERSUBDATAPROC = ?fn (GLenum, GLenum, GLintptr, GLsizeiptr, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLDISPATCHCOMPUTEPROC = ?fn (GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLDISPATCHCOMPUTEINDIRECTPROC = ?fn (GLintptr) callconv(.C) void; pub const PFNGLCOPYIMAGESUBDATAPROC = ?fn (GLuint, GLenum, GLint, GLint, GLint, GLint, GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLFRAMEBUFFERPARAMETERIPROC = ?fn (GLenum, GLenum, GLint) callconv(.C) void; pub const PFNGLGETFRAMEBUFFERPARAMETERIVPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETINTERNALFORMATI64VPROC = ?fn (GLenum, GLenum, GLenum, GLsizei, [*c]GLint64) callconv(.C) void; pub const PFNGLINVALIDATETEXSUBIMAGEPROC = ?fn (GLuint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLINVALIDATETEXIMAGEPROC = ?fn (GLuint, GLint) callconv(.C) void; pub const PFNGLINVALIDATEBUFFERSUBDATAPROC = ?fn (GLuint, GLintptr, GLsizeiptr) callconv(.C) void; pub const PFNGLINVALIDATEBUFFERDATAPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLINVALIDATEFRAMEBUFFERPROC = ?fn (GLenum, GLsizei, [*c]const GLenum) callconv(.C) void; pub const PFNGLINVALIDATESUBFRAMEBUFFERPROC = ?fn (GLenum, GLsizei, [*c]const GLenum, GLint, GLint, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLMULTIDRAWARRAYSINDIRECTPROC = ?fn (GLenum, ?*const anyopaque, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLMULTIDRAWELEMENTSINDIRECTPROC = ?fn (GLenum, GLenum, ?*const anyopaque, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLGETPROGRAMINTERFACEIVPROC = ?fn (GLuint, GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETPROGRAMRESOURCEINDEXPROC = ?fn (GLuint, GLenum, [*c]const GLchar) callconv(.C) GLuint; pub const PFNGLGETPROGRAMRESOURCENAMEPROC = ?fn (GLuint, GLenum, GLuint, GLsizei, [*c]GLsizei, [*c]GLchar) callconv(.C) void; pub const PFNGLGETPROGRAMRESOURCEIVPROC = ?fn (GLuint, GLenum, GLuint, GLsizei, [*c]const GLenum, GLsizei, [*c]GLsizei, [*c]GLint) callconv(.C) void; pub const PFNGLGETPROGRAMRESOURCELOCATIONPROC = ?fn (GLuint, GLenum, [*c]const GLchar) callconv(.C) GLint; pub const PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC = ?fn (GLuint, GLenum, [*c]const GLchar) callconv(.C) GLint; pub const PFNGLSHADERSTORAGEBLOCKBINDINGPROC = ?fn (GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLTEXBUFFERRANGEPROC = ?fn (GLenum, GLenum, GLuint, GLintptr, GLsizeiptr) callconv(.C) void; pub const PFNGLTEXSTORAGE2DMULTISAMPLEPROC = ?fn (GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLboolean) callconv(.C) void; pub const PFNGLTEXSTORAGE3DMULTISAMPLEPROC = ?fn (GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLsizei, GLboolean) callconv(.C) void; pub const PFNGLTEXTUREVIEWPROC = ?fn (GLuint, GLenum, GLuint, GLenum, GLuint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLBINDVERTEXBUFFERPROC = ?fn (GLuint, GLuint, GLintptr, GLsizei) callconv(.C) void; pub const PFNGLVERTEXATTRIBFORMATPROC = ?fn (GLuint, GLint, GLenum, GLboolean, GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBIFORMATPROC = ?fn (GLuint, GLint, GLenum, GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBLFORMATPROC = ?fn (GLuint, GLint, GLenum, GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBBINDINGPROC = ?fn (GLuint, GLuint) callconv(.C) void; pub const PFNGLVERTEXBINDINGDIVISORPROC = ?fn (GLuint, GLuint) callconv(.C) void; pub const PFNGLDEBUGMESSAGECONTROLPROC = ?fn (GLenum, GLenum, GLenum, GLsizei, [*c]const GLuint, GLboolean) callconv(.C) void; pub const PFNGLDEBUGMESSAGEINSERTPROC = ?fn (GLenum, GLenum, GLuint, GLenum, GLsizei, [*c]const GLchar) callconv(.C) void; pub const PFNGLDEBUGMESSAGECALLBACKPROC = ?fn (GLDEBUGPROC, ?*const anyopaque) callconv(.C) void; pub const PFNGLGETDEBUGMESSAGELOGPROC = ?fn (GLuint, GLsizei, [*c]GLenum, [*c]GLenum, [*c]GLuint, [*c]GLenum, [*c]GLsizei, [*c]GLchar) callconv(.C) GLuint; pub const PFNGLPUSHDEBUGGROUPPROC = ?fn (GLenum, GLuint, GLsizei, [*c]const GLchar) callconv(.C) void; pub const PFNGLPOPDEBUGGROUPPROC = ?fn () callconv(.C) void; pub const PFNGLOBJECTLABELPROC = ?fn (GLenum, GLuint, GLsizei, [*c]const GLchar) callconv(.C) void; pub const PFNGLGETOBJECTLABELPROC = ?fn (GLenum, GLuint, GLsizei, [*c]GLsizei, [*c]GLchar) callconv(.C) void; pub const PFNGLOBJECTPTRLABELPROC = ?fn (?*const anyopaque, GLsizei, [*c]const GLchar) callconv(.C) void; pub const PFNGLGETOBJECTPTRLABELPROC = ?fn (?*const anyopaque, GLsizei, [*c]GLsizei, [*c]GLchar) callconv(.C) void; pub const PFNGLBUFFERSTORAGEPROC = ?fn (GLenum, GLsizeiptr, ?*const anyopaque, GLbitfield) callconv(.C) void; pub const PFNGLCLEARTEXIMAGEPROC = ?fn (GLuint, GLint, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLCLEARTEXSUBIMAGEPROC = ?fn (GLuint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLBINDBUFFERSBASEPROC = ?fn (GLenum, GLuint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLBINDBUFFERSRANGEPROC = ?fn (GLenum, GLuint, GLsizei, [*c]const GLuint, [*c]const GLintptr, [*c]const GLsizeiptr) callconv(.C) void; pub const PFNGLBINDTEXTURESPROC = ?fn (GLuint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLBINDSAMPLERSPROC = ?fn (GLuint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLBINDIMAGETEXTURESPROC = ?fn (GLuint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLBINDVERTEXBUFFERSPROC = ?fn (GLuint, GLsizei, [*c]const GLuint, [*c]const GLintptr, [*c]const GLsizei) callconv(.C) void; pub const PFNGLCLIPCONTROLPROC = ?fn (GLenum, GLenum) callconv(.C) void; pub const PFNGLCREATETRANSFORMFEEDBACKSPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC = ?fn (GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC = ?fn (GLuint, GLuint, GLuint, GLintptr, GLsizeiptr) callconv(.C) void; pub const PFNGLGETTRANSFORMFEEDBACKIVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETTRANSFORMFEEDBACKI_VPROC = ?fn (GLuint, GLenum, GLuint, [*c]GLint) callconv(.C) void; pub const PFNGLGETTRANSFORMFEEDBACKI64_VPROC = ?fn (GLuint, GLenum, GLuint, [*c]GLint64) callconv(.C) void; pub const PFNGLCREATEBUFFERSPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLNAMEDBUFFERSTORAGEPROC = ?fn (GLuint, GLsizeiptr, ?*const anyopaque, GLbitfield) callconv(.C) void; pub const PFNGLNAMEDBUFFERDATAPROC = ?fn (GLuint, GLsizeiptr, ?*const anyopaque, GLenum) callconv(.C) void; pub const PFNGLNAMEDBUFFERSUBDATAPROC = ?fn (GLuint, GLintptr, GLsizeiptr, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOPYNAMEDBUFFERSUBDATAPROC = ?fn (GLuint, GLuint, GLintptr, GLintptr, GLsizeiptr) callconv(.C) void; pub const PFNGLCLEARNAMEDBUFFERDATAPROC = ?fn (GLuint, GLenum, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLCLEARNAMEDBUFFERSUBDATAPROC = ?fn (GLuint, GLenum, GLintptr, GLsizeiptr, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLMAPNAMEDBUFFERPROC = ?fn (GLuint, GLenum) callconv(.C) ?*anyopaque; pub const PFNGLMAPNAMEDBUFFERRANGEPROC = ?fn (GLuint, GLintptr, GLsizeiptr, GLbitfield) callconv(.C) ?*anyopaque; pub const PFNGLUNMAPNAMEDBUFFERPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC = ?fn (GLuint, GLintptr, GLsizeiptr) callconv(.C) void; pub const PFNGLGETNAMEDBUFFERPARAMETERIVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETNAMEDBUFFERPARAMETERI64VPROC = ?fn (GLuint, GLenum, [*c]GLint64) callconv(.C) void; pub const PFNGLGETNAMEDBUFFERPOINTERVPROC = ?fn (GLuint, GLenum, [*c]?*anyopaque) callconv(.C) void; pub const PFNGLGETNAMEDBUFFERSUBDATAPROC = ?fn (GLuint, GLintptr, GLsizeiptr, ?*anyopaque) callconv(.C) void; pub const PFNGLCREATEFRAMEBUFFERSPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC = ?fn (GLuint, GLenum, GLenum, GLuint) callconv(.C) void; pub const PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC = ?fn (GLuint, GLenum, GLint) callconv(.C) void; pub const PFNGLNAMEDFRAMEBUFFERTEXTUREPROC = ?fn (GLuint, GLenum, GLuint, GLint) callconv(.C) void; pub const PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC = ?fn (GLuint, GLenum, GLuint, GLint, GLint) callconv(.C) void; pub const PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC = ?fn (GLuint, GLenum) callconv(.C) void; pub const PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC = ?fn (GLuint, GLsizei, [*c]const GLenum) callconv(.C) void; pub const PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC = ?fn (GLuint, GLenum) callconv(.C) void; pub const PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC = ?fn (GLuint, GLsizei, [*c]const GLenum) callconv(.C) void; pub const PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC = ?fn (GLuint, GLsizei, [*c]const GLenum, GLint, GLint, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLCLEARNAMEDFRAMEBUFFERIVPROC = ?fn (GLuint, GLenum, GLint, [*c]const GLint) callconv(.C) void; pub const PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC = ?fn (GLuint, GLenum, GLint, [*c]const GLuint) callconv(.C) void; pub const PFNGLCLEARNAMEDFRAMEBUFFERFVPROC = ?fn (GLuint, GLenum, GLint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLCLEARNAMEDFRAMEBUFFERFIPROC = ?fn (GLuint, GLenum, GLint, GLfloat, GLint) callconv(.C) void; pub const PFNGLBLITNAMEDFRAMEBUFFERPROC = ?fn (GLuint, GLuint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum) callconv(.C) void; pub const PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC = ?fn (GLuint, GLenum) callconv(.C) GLenum; pub const PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC = ?fn (GLuint, GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLCREATERENDERBUFFERSPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLNAMEDRENDERBUFFERSTORAGEPROC = ?fn (GLuint, GLenum, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC = ?fn (GLuint, GLsizei, GLenum, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLCREATETEXTURESPROC = ?fn (GLenum, GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLTEXTUREBUFFERPROC = ?fn (GLuint, GLenum, GLuint) callconv(.C) void; pub const PFNGLTEXTUREBUFFERRANGEPROC = ?fn (GLuint, GLenum, GLuint, GLintptr, GLsizeiptr) callconv(.C) void; pub const PFNGLTEXTURESTORAGE1DPROC = ?fn (GLuint, GLsizei, GLenum, GLsizei) callconv(.C) void; pub const PFNGLTEXTURESTORAGE2DPROC = ?fn (GLuint, GLsizei, GLenum, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLTEXTURESTORAGE3DPROC = ?fn (GLuint, GLsizei, GLenum, GLsizei, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC = ?fn (GLuint, GLsizei, GLenum, GLsizei, GLsizei, GLboolean) callconv(.C) void; pub const PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC = ?fn (GLuint, GLsizei, GLenum, GLsizei, GLsizei, GLsizei, GLboolean) callconv(.C) void; pub const PFNGLTEXTURESUBIMAGE1DPROC = ?fn (GLuint, GLint, GLint, GLsizei, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLTEXTURESUBIMAGE2DPROC = ?fn (GLuint, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLTEXTURESUBIMAGE3DPROC = ?fn (GLuint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC = ?fn (GLuint, GLint, GLint, GLsizei, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC = ?fn (GLuint, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC = ?fn (GLuint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOPYTEXTURESUBIMAGE1DPROC = ?fn (GLuint, GLint, GLint, GLint, GLint, GLsizei) callconv(.C) void; pub const PFNGLCOPYTEXTURESUBIMAGE2DPROC = ?fn (GLuint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLCOPYTEXTURESUBIMAGE3DPROC = ?fn (GLuint, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLTEXTUREPARAMETERFPROC = ?fn (GLuint, GLenum, GLfloat) callconv(.C) void; pub const PFNGLTEXTUREPARAMETERFVPROC = ?fn (GLuint, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLTEXTUREPARAMETERIPROC = ?fn (GLuint, GLenum, GLint) callconv(.C) void; pub const PFNGLTEXTUREPARAMETERIIVPROC = ?fn (GLuint, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLTEXTUREPARAMETERIUIVPROC = ?fn (GLuint, GLenum, [*c]const GLuint) callconv(.C) void; pub const PFNGLTEXTUREPARAMETERIVPROC = ?fn (GLuint, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLGENERATETEXTUREMIPMAPPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLBINDTEXTUREUNITPROC = ?fn (GLuint, GLuint) callconv(.C) void; pub const PFNGLGETTEXTUREIMAGEPROC = ?fn (GLuint, GLint, GLenum, GLenum, GLsizei, ?*anyopaque) callconv(.C) void; pub const PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC = ?fn (GLuint, GLint, GLsizei, ?*anyopaque) callconv(.C) void; pub const PFNGLGETTEXTURELEVELPARAMETERFVPROC = ?fn (GLuint, GLint, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETTEXTURELEVELPARAMETERIVPROC = ?fn (GLuint, GLint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETTEXTUREPARAMETERFVPROC = ?fn (GLuint, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETTEXTUREPARAMETERIIVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETTEXTUREPARAMETERIUIVPROC = ?fn (GLuint, GLenum, [*c]GLuint) callconv(.C) void; pub const PFNGLGETTEXTUREPARAMETERIVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLCREATEVERTEXARRAYSPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLDISABLEVERTEXARRAYATTRIBPROC = ?fn (GLuint, GLuint) callconv(.C) void; pub const PFNGLENABLEVERTEXARRAYATTRIBPROC = ?fn (GLuint, GLuint) callconv(.C) void; pub const PFNGLVERTEXARRAYELEMENTBUFFERPROC = ?fn (GLuint, GLuint) callconv(.C) void; pub const PFNGLVERTEXARRAYVERTEXBUFFERPROC = ?fn (GLuint, GLuint, GLuint, GLintptr, GLsizei) callconv(.C) void; pub const PFNGLVERTEXARRAYVERTEXBUFFERSPROC = ?fn (GLuint, GLuint, GLsizei, [*c]const GLuint, [*c]const GLintptr, [*c]const GLsizei) callconv(.C) void; pub const PFNGLVERTEXARRAYATTRIBBINDINGPROC = ?fn (GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLVERTEXARRAYATTRIBFORMATPROC = ?fn (GLuint, GLuint, GLint, GLenum, GLboolean, GLuint) callconv(.C) void; pub const PFNGLVERTEXARRAYATTRIBIFORMATPROC = ?fn (GLuint, GLuint, GLint, GLenum, GLuint) callconv(.C) void; pub const PFNGLVERTEXARRAYATTRIBLFORMATPROC = ?fn (GLuint, GLuint, GLint, GLenum, GLuint) callconv(.C) void; pub const PFNGLVERTEXARRAYBINDINGDIVISORPROC = ?fn (GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLGETVERTEXARRAYIVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETVERTEXARRAYINDEXEDIVPROC = ?fn (GLuint, GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETVERTEXARRAYINDEXED64IVPROC = ?fn (GLuint, GLuint, GLenum, [*c]GLint64) callconv(.C) void; pub const PFNGLCREATESAMPLERSPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLCREATEPROGRAMPIPELINESPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLCREATEQUERIESPROC = ?fn (GLenum, GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLGETQUERYBUFFEROBJECTI64VPROC = ?fn (GLuint, GLuint, GLenum, GLintptr) callconv(.C) void; pub const PFNGLGETQUERYBUFFEROBJECTIVPROC = ?fn (GLuint, GLuint, GLenum, GLintptr) callconv(.C) void; pub const PFNGLGETQUERYBUFFEROBJECTUI64VPROC = ?fn (GLuint, GLuint, GLenum, GLintptr) callconv(.C) void; pub const PFNGLGETQUERYBUFFEROBJECTUIVPROC = ?fn (GLuint, GLuint, GLenum, GLintptr) callconv(.C) void; pub const PFNGLMEMORYBARRIERBYREGIONPROC = ?fn (GLbitfield) callconv(.C) void; pub const PFNGLGETTEXTURESUBIMAGEPROC = ?fn (GLuint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, GLsizei, ?*anyopaque) callconv(.C) void; pub const PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC = ?fn (GLuint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, ?*anyopaque) callconv(.C) void; pub const PFNGLGETGRAPHICSRESETSTATUSPROC = ?fn () callconv(.C) GLenum; pub const PFNGLGETNCOMPRESSEDTEXIMAGEPROC = ?fn (GLenum, GLint, GLsizei, ?*anyopaque) callconv(.C) void; pub const PFNGLGETNTEXIMAGEPROC = ?fn (GLenum, GLint, GLenum, GLenum, GLsizei, ?*anyopaque) callconv(.C) void; pub const PFNGLGETNUNIFORMDVPROC = ?fn (GLuint, GLint, GLsizei, [*c]GLdouble) callconv(.C) void; pub const PFNGLGETNUNIFORMFVPROC = ?fn (GLuint, GLint, GLsizei, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETNUNIFORMIVPROC = ?fn (GLuint, GLint, GLsizei, [*c]GLint) callconv(.C) void; pub const PFNGLGETNUNIFORMUIVPROC = ?fn (GLuint, GLint, GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLREADNPIXELSPROC = ?fn (GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLsizei, ?*anyopaque) callconv(.C) void; pub const PFNGLGETNMAPDVPROC = ?fn (GLenum, GLenum, GLsizei, [*c]GLdouble) callconv(.C) void; pub const PFNGLGETNMAPFVPROC = ?fn (GLenum, GLenum, GLsizei, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETNMAPIVPROC = ?fn (GLenum, GLenum, GLsizei, [*c]GLint) callconv(.C) void; pub const PFNGLGETNPIXELMAPFVPROC = ?fn (GLenum, GLsizei, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETNPIXELMAPUIVPROC = ?fn (GLenum, GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLGETNPIXELMAPUSVPROC = ?fn (GLenum, GLsizei, [*c]GLushort) callconv(.C) void; pub const PFNGLGETNPOLYGONSTIPPLEPROC = ?fn (GLsizei, [*c]GLubyte) callconv(.C) void; pub const PFNGLGETNCOLORTABLEPROC = ?fn (GLenum, GLenum, GLenum, GLsizei, ?*anyopaque) callconv(.C) void; pub const PFNGLGETNCONVOLUTIONFILTERPROC = ?fn (GLenum, GLenum, GLenum, GLsizei, ?*anyopaque) callconv(.C) void; pub const PFNGLGETNSEPARABLEFILTERPROC = ?fn (GLenum, GLenum, GLenum, GLsizei, ?*anyopaque, GLsizei, ?*anyopaque, ?*anyopaque) callconv(.C) void; pub const PFNGLGETNHISTOGRAMPROC = ?fn (GLenum, GLboolean, GLenum, GLenum, GLsizei, ?*anyopaque) callconv(.C) void; pub const PFNGLGETNMINMAXPROC = ?fn (GLenum, GLboolean, GLenum, GLenum, GLsizei, ?*anyopaque) callconv(.C) void; pub const PFNGLTEXTUREBARRIERPROC = ?fn () callconv(.C) void; pub const PFNGLSPECIALIZESHADERPROC = ?fn (GLuint, [*c]const GLchar, GLuint, [*c]const GLuint, [*c]const GLuint) callconv(.C) void; pub const PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC = ?fn (GLenum, ?*const anyopaque, GLintptr, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC = ?fn (GLenum, GLenum, ?*const anyopaque, GLintptr, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLPOLYGONOFFSETCLAMPPROC = ?fn (GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLPRIMITIVEBOUNDINGBOXARBPROC = ?fn (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const GLuint64EXT = khronos_uint64_t; pub const PFNGLGETTEXTUREHANDLEARBPROC = ?fn (GLuint) callconv(.C) GLuint64; pub const PFNGLGETTEXTURESAMPLERHANDLEARBPROC = ?fn (GLuint, GLuint) callconv(.C) GLuint64; pub const PFNGLMAKETEXTUREHANDLERESIDENTARBPROC = ?fn (GLuint64) callconv(.C) void; pub const PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC = ?fn (GLuint64) callconv(.C) void; pub const PFNGLGETIMAGEHANDLEARBPROC = ?fn (GLuint, GLint, GLboolean, GLint, GLenum) callconv(.C) GLuint64; pub const PFNGLMAKEIMAGEHANDLERESIDENTARBPROC = ?fn (GLuint64, GLenum) callconv(.C) void; pub const PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC = ?fn (GLuint64) callconv(.C) void; pub const PFNGLUNIFORMHANDLEUI64ARBPROC = ?fn (GLint, GLuint64) callconv(.C) void; pub const PFNGLUNIFORMHANDLEUI64VARBPROC = ?fn (GLint, GLsizei, [*c]const GLuint64) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC = ?fn (GLuint, GLint, GLuint64) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLuint64) callconv(.C) void; pub const PFNGLISTEXTUREHANDLERESIDENTARBPROC = ?fn (GLuint64) callconv(.C) GLboolean; pub const PFNGLISIMAGEHANDLERESIDENTARBPROC = ?fn (GLuint64) callconv(.C) GLboolean; pub const PFNGLVERTEXATTRIBL1UI64ARBPROC = ?fn (GLuint, GLuint64EXT) callconv(.C) void; pub const PFNGLVERTEXATTRIBL1UI64VARBPROC = ?fn (GLuint, [*c]const GLuint64EXT) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBLUI64VARBPROC = ?fn (GLuint, GLenum, [*c]GLuint64EXT) callconv(.C) void; pub const struct__cl_context = opaque {}; pub const struct__cl_event = opaque {}; pub const PFNGLCREATESYNCFROMCLEVENTARBPROC = ?fn (?*struct__cl_context, ?*struct__cl_event, GLbitfield) callconv(.C) GLsync; pub const PFNGLCLAMPCOLORARBPROC = ?fn (GLenum, GLenum) callconv(.C) void; pub const PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC = ?fn (GLuint, GLuint, GLuint, GLuint, GLuint, GLuint) callconv(.C) void; pub const GLDEBUGPROCARB = ?fn (GLenum, GLenum, GLuint, GLenum, GLsizei, [*c]const GLchar, ?*const anyopaque) callconv(.C) void; pub const PFNGLDEBUGMESSAGECONTROLARBPROC = ?fn (GLenum, GLenum, GLenum, GLsizei, [*c]const GLuint, GLboolean) callconv(.C) void; pub const PFNGLDEBUGMESSAGEINSERTARBPROC = ?fn (GLenum, GLenum, GLuint, GLenum, GLsizei, [*c]const GLchar) callconv(.C) void; pub const PFNGLDEBUGMESSAGECALLBACKARBPROC = ?fn (GLDEBUGPROCARB, ?*const anyopaque) callconv(.C) void; pub const PFNGLGETDEBUGMESSAGELOGARBPROC = ?fn (GLuint, GLsizei, [*c]GLenum, [*c]GLenum, [*c]GLuint, [*c]GLenum, [*c]GLsizei, [*c]GLchar) callconv(.C) GLuint; pub const PFNGLDRAWBUFFERSARBPROC = ?fn (GLsizei, [*c]const GLenum) callconv(.C) void; pub const PFNGLBLENDEQUATIONIARBPROC = ?fn (GLuint, GLenum) callconv(.C) void; pub const PFNGLBLENDEQUATIONSEPARATEIARBPROC = ?fn (GLuint, GLenum, GLenum) callconv(.C) void; pub const PFNGLBLENDFUNCIARBPROC = ?fn (GLuint, GLenum, GLenum) callconv(.C) void; pub const PFNGLBLENDFUNCSEPARATEIARBPROC = ?fn (GLuint, GLenum, GLenum, GLenum, GLenum) callconv(.C) void; pub const PFNGLDRAWARRAYSINSTANCEDARBPROC = ?fn (GLenum, GLint, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLDRAWELEMENTSINSTANCEDARBPROC = ?fn (GLenum, GLsizei, GLenum, ?*const anyopaque, GLsizei) callconv(.C) void; pub const PFNGLPROGRAMSTRINGARBPROC = ?fn (GLenum, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLBINDPROGRAMARBPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLDELETEPROGRAMSARBPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLGENPROGRAMSARBPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLPROGRAMENVPARAMETER4DARBPROC = ?fn (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLPROGRAMENVPARAMETER4DVARBPROC = ?fn (GLenum, GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMENVPARAMETER4FARBPROC = ?fn (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLPROGRAMENVPARAMETER4FVARBPROC = ?fn (GLenum, GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMLOCALPARAMETER4DARBPROC = ?fn (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLPROGRAMLOCALPARAMETER4DVARBPROC = ?fn (GLenum, GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMLOCALPARAMETER4FARBPROC = ?fn (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLPROGRAMLOCALPARAMETER4FVARBPROC = ?fn (GLenum, GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLGETPROGRAMENVPARAMETERDVARBPROC = ?fn (GLenum, GLuint, [*c]GLdouble) callconv(.C) void; pub const PFNGLGETPROGRAMENVPARAMETERFVARBPROC = ?fn (GLenum, GLuint, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC = ?fn (GLenum, GLuint, [*c]GLdouble) callconv(.C) void; pub const PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC = ?fn (GLenum, GLuint, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETPROGRAMIVARBPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETPROGRAMSTRINGARBPROC = ?fn (GLenum, GLenum, ?*anyopaque) callconv(.C) void; pub const PFNGLISPROGRAMARBPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLPROGRAMPARAMETERIARBPROC = ?fn (GLuint, GLenum, GLint) callconv(.C) void; pub const PFNGLFRAMEBUFFERTEXTUREARBPROC = ?fn (GLenum, GLenum, GLuint, GLint) callconv(.C) void; pub const PFNGLFRAMEBUFFERTEXTURELAYERARBPROC = ?fn (GLenum, GLenum, GLuint, GLint, GLint) callconv(.C) void; pub const PFNGLFRAMEBUFFERTEXTUREFACEARBPROC = ?fn (GLenum, GLenum, GLuint, GLint, GLenum) callconv(.C) void; pub const PFNGLSPECIALIZESHADERARBPROC = ?fn (GLuint, [*c]const GLchar, GLuint, [*c]const GLuint, [*c]const GLuint) callconv(.C) void; pub const PFNGLUNIFORM1I64ARBPROC = ?fn (GLint, GLint64) callconv(.C) void; pub const PFNGLUNIFORM2I64ARBPROC = ?fn (GLint, GLint64, GLint64) callconv(.C) void; pub const PFNGLUNIFORM3I64ARBPROC = ?fn (GLint, GLint64, GLint64, GLint64) callconv(.C) void; pub const PFNGLUNIFORM4I64ARBPROC = ?fn (GLint, GLint64, GLint64, GLint64, GLint64) callconv(.C) void; pub const PFNGLUNIFORM1I64VARBPROC = ?fn (GLint, GLsizei, [*c]const GLint64) callconv(.C) void; pub const PFNGLUNIFORM2I64VARBPROC = ?fn (GLint, GLsizei, [*c]const GLint64) callconv(.C) void; pub const PFNGLUNIFORM3I64VARBPROC = ?fn (GLint, GLsizei, [*c]const GLint64) callconv(.C) void; pub const PFNGLUNIFORM4I64VARBPROC = ?fn (GLint, GLsizei, [*c]const GLint64) callconv(.C) void; pub const PFNGLUNIFORM1UI64ARBPROC = ?fn (GLint, GLuint64) callconv(.C) void; pub const PFNGLUNIFORM2UI64ARBPROC = ?fn (GLint, GLuint64, GLuint64) callconv(.C) void; pub const PFNGLUNIFORM3UI64ARBPROC = ?fn (GLint, GLuint64, GLuint64, GLuint64) callconv(.C) void; pub const PFNGLUNIFORM4UI64ARBPROC = ?fn (GLint, GLuint64, GLuint64, GLuint64, GLuint64) callconv(.C) void; pub const PFNGLUNIFORM1UI64VARBPROC = ?fn (GLint, GLsizei, [*c]const GLuint64) callconv(.C) void; pub const PFNGLUNIFORM2UI64VARBPROC = ?fn (GLint, GLsizei, [*c]const GLuint64) callconv(.C) void; pub const PFNGLUNIFORM3UI64VARBPROC = ?fn (GLint, GLsizei, [*c]const GLuint64) callconv(.C) void; pub const PFNGLUNIFORM4UI64VARBPROC = ?fn (GLint, GLsizei, [*c]const GLuint64) callconv(.C) void; pub const PFNGLGETUNIFORMI64VARBPROC = ?fn (GLuint, GLint, [*c]GLint64) callconv(.C) void; pub const PFNGLGETUNIFORMUI64VARBPROC = ?fn (GLuint, GLint, [*c]GLuint64) callconv(.C) void; pub const PFNGLGETNUNIFORMI64VARBPROC = ?fn (GLuint, GLint, GLsizei, [*c]GLint64) callconv(.C) void; pub const PFNGLGETNUNIFORMUI64VARBPROC = ?fn (GLuint, GLint, GLsizei, [*c]GLuint64) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1I64ARBPROC = ?fn (GLuint, GLint, GLint64) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2I64ARBPROC = ?fn (GLuint, GLint, GLint64, GLint64) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3I64ARBPROC = ?fn (GLuint, GLint, GLint64, GLint64, GLint64) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4I64ARBPROC = ?fn (GLuint, GLint, GLint64, GLint64, GLint64, GLint64) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1I64VARBPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLint64) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2I64VARBPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLint64) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3I64VARBPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLint64) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4I64VARBPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLint64) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1UI64ARBPROC = ?fn (GLuint, GLint, GLuint64) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2UI64ARBPROC = ?fn (GLuint, GLint, GLuint64, GLuint64) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3UI64ARBPROC = ?fn (GLuint, GLint, GLuint64, GLuint64, GLuint64) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4UI64ARBPROC = ?fn (GLuint, GLint, GLuint64, GLuint64, GLuint64, GLuint64) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1UI64VARBPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLuint64) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2UI64VARBPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLuint64) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3UI64VARBPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLuint64) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4UI64VARBPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLuint64) callconv(.C) void; pub const GLhalfARB = khronos_uint16_t; pub const PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC = ?fn (GLenum, ?*const anyopaque, GLintptr, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC = ?fn (GLenum, GLenum, ?*const anyopaque, GLintptr, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLVERTEXATTRIBDIVISORARBPROC = ?fn (GLuint, GLuint) callconv(.C) void; pub const PFNGLCURRENTPALETTEMATRIXARBPROC = ?fn (GLint) callconv(.C) void; pub const PFNGLMATRIXINDEXUBVARBPROC = ?fn (GLint, [*c]const GLubyte) callconv(.C) void; pub const PFNGLMATRIXINDEXUSVARBPROC = ?fn (GLint, [*c]const GLushort) callconv(.C) void; pub const PFNGLMATRIXINDEXUIVARBPROC = ?fn (GLint, [*c]const GLuint) callconv(.C) void; pub const PFNGLMATRIXINDEXPOINTERARBPROC = ?fn (GLint, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLSAMPLECOVERAGEARBPROC = ?fn (GLfloat, GLboolean) callconv(.C) void; pub const PFNGLGENQUERIESARBPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLDELETEQUERIESARBPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLISQUERYARBPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLBEGINQUERYARBPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLENDQUERYARBPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLGETQUERYIVARBPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETQUERYOBJECTIVARBPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETQUERYOBJECTUIVARBPROC = ?fn (GLuint, GLenum, [*c]GLuint) callconv(.C) void; pub const PFNGLMAXSHADERCOMPILERTHREADSARBPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLPOINTPARAMETERFARBPROC = ?fn (GLenum, GLfloat) callconv(.C) void; pub const PFNGLPOINTPARAMETERFVARBPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLGETGRAPHICSRESETSTATUSARBPROC = ?fn () callconv(.C) GLenum; pub const PFNGLGETNTEXIMAGEARBPROC = ?fn (GLenum, GLint, GLenum, GLenum, GLsizei, ?*anyopaque) callconv(.C) void; pub const PFNGLREADNPIXELSARBPROC = ?fn (GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLsizei, ?*anyopaque) callconv(.C) void; pub const PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC = ?fn (GLenum, GLint, GLsizei, ?*anyopaque) callconv(.C) void; pub const PFNGLGETNUNIFORMFVARBPROC = ?fn (GLuint, GLint, GLsizei, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETNUNIFORMIVARBPROC = ?fn (GLuint, GLint, GLsizei, [*c]GLint) callconv(.C) void; pub const PFNGLGETNUNIFORMUIVARBPROC = ?fn (GLuint, GLint, GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLGETNUNIFORMDVARBPROC = ?fn (GLuint, GLint, GLsizei, [*c]GLdouble) callconv(.C) void; pub const PFNGLGETNMAPDVARBPROC = ?fn (GLenum, GLenum, GLsizei, [*c]GLdouble) callconv(.C) void; pub const PFNGLGETNMAPFVARBPROC = ?fn (GLenum, GLenum, GLsizei, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETNMAPIVARBPROC = ?fn (GLenum, GLenum, GLsizei, [*c]GLint) callconv(.C) void; pub const PFNGLGETNPIXELMAPFVARBPROC = ?fn (GLenum, GLsizei, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETNPIXELMAPUIVARBPROC = ?fn (GLenum, GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLGETNPIXELMAPUSVARBPROC = ?fn (GLenum, GLsizei, [*c]GLushort) callconv(.C) void; pub const PFNGLGETNPOLYGONSTIPPLEARBPROC = ?fn (GLsizei, [*c]GLubyte) callconv(.C) void; pub const PFNGLGETNCOLORTABLEARBPROC = ?fn (GLenum, GLenum, GLenum, GLsizei, ?*anyopaque) callconv(.C) void; pub const PFNGLGETNCONVOLUTIONFILTERARBPROC = ?fn (GLenum, GLenum, GLenum, GLsizei, ?*anyopaque) callconv(.C) void; pub const PFNGLGETNSEPARABLEFILTERARBPROC = ?fn (GLenum, GLenum, GLenum, GLsizei, ?*anyopaque, GLsizei, ?*anyopaque, ?*anyopaque) callconv(.C) void; pub const PFNGLGETNHISTOGRAMARBPROC = ?fn (GLenum, GLboolean, GLenum, GLenum, GLsizei, ?*anyopaque) callconv(.C) void; pub const PFNGLGETNMINMAXARBPROC = ?fn (GLenum, GLboolean, GLenum, GLenum, GLsizei, ?*anyopaque) callconv(.C) void; pub const PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC = ?fn (GLenum, GLuint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC = ?fn (GLuint, GLuint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLEVALUATEDEPTHVALUESARBPROC = ?fn () callconv(.C) void; pub const PFNGLMINSAMPLESHADINGARBPROC = ?fn (GLfloat) callconv(.C) void; pub const GLhandleARB = c_uint; pub const GLcharARB = u8; pub const PFNGLDELETEOBJECTARBPROC = ?fn (GLhandleARB) callconv(.C) void; pub const PFNGLGETHANDLEARBPROC = ?fn (GLenum) callconv(.C) GLhandleARB; pub const PFNGLDETACHOBJECTARBPROC = ?fn (GLhandleARB, GLhandleARB) callconv(.C) void; pub const PFNGLCREATESHADEROBJECTARBPROC = ?fn (GLenum) callconv(.C) GLhandleARB; pub const PFNGLSHADERSOURCEARBPROC = ?fn (GLhandleARB, GLsizei, [*c][*c]const GLcharARB, [*c]const GLint) callconv(.C) void; pub const PFNGLCOMPILESHADERARBPROC = ?fn (GLhandleARB) callconv(.C) void; pub const PFNGLCREATEPROGRAMOBJECTARBPROC = ?fn () callconv(.C) GLhandleARB; pub const PFNGLATTACHOBJECTARBPROC = ?fn (GLhandleARB, GLhandleARB) callconv(.C) void; pub const PFNGLLINKPROGRAMARBPROC = ?fn (GLhandleARB) callconv(.C) void; pub const PFNGLUSEPROGRAMOBJECTARBPROC = ?fn (GLhandleARB) callconv(.C) void; pub const PFNGLVALIDATEPROGRAMARBPROC = ?fn (GLhandleARB) callconv(.C) void; pub const PFNGLUNIFORM1FARBPROC = ?fn (GLint, GLfloat) callconv(.C) void; pub const PFNGLUNIFORM2FARBPROC = ?fn (GLint, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLUNIFORM3FARBPROC = ?fn (GLint, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLUNIFORM4FARBPROC = ?fn (GLint, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLUNIFORM1IARBPROC = ?fn (GLint, GLint) callconv(.C) void; pub const PFNGLUNIFORM2IARBPROC = ?fn (GLint, GLint, GLint) callconv(.C) void; pub const PFNGLUNIFORM3IARBPROC = ?fn (GLint, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLUNIFORM4IARBPROC = ?fn (GLint, GLint, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLUNIFORM1FVARBPROC = ?fn (GLint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLUNIFORM2FVARBPROC = ?fn (GLint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLUNIFORM3FVARBPROC = ?fn (GLint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLUNIFORM4FVARBPROC = ?fn (GLint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLUNIFORM1IVARBPROC = ?fn (GLint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLUNIFORM2IVARBPROC = ?fn (GLint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLUNIFORM3IVARBPROC = ?fn (GLint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLUNIFORM4IVARBPROC = ?fn (GLint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLUNIFORMMATRIX2FVARBPROC = ?fn (GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLUNIFORMMATRIX3FVARBPROC = ?fn (GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLUNIFORMMATRIX4FVARBPROC = ?fn (GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLGETOBJECTPARAMETERFVARBPROC = ?fn (GLhandleARB, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETOBJECTPARAMETERIVARBPROC = ?fn (GLhandleARB, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETINFOLOGARBPROC = ?fn (GLhandleARB, GLsizei, [*c]GLsizei, [*c]GLcharARB) callconv(.C) void; pub const PFNGLGETATTACHEDOBJECTSARBPROC = ?fn (GLhandleARB, GLsizei, [*c]GLsizei, [*c]GLhandleARB) callconv(.C) void; pub const PFNGLGETUNIFORMLOCATIONARBPROC = ?fn (GLhandleARB, [*c]const GLcharARB) callconv(.C) GLint; pub const PFNGLGETACTIVEUNIFORMARBPROC = ?fn (GLhandleARB, GLuint, GLsizei, [*c]GLsizei, [*c]GLint, [*c]GLenum, [*c]GLcharARB) callconv(.C) void; pub const PFNGLGETUNIFORMFVARBPROC = ?fn (GLhandleARB, GLint, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETUNIFORMIVARBPROC = ?fn (GLhandleARB, GLint, [*c]GLint) callconv(.C) void; pub const PFNGLGETSHADERSOURCEARBPROC = ?fn (GLhandleARB, GLsizei, [*c]GLsizei, [*c]GLcharARB) callconv(.C) void; pub const PFNGLNAMEDSTRINGARBPROC = ?fn (GLenum, GLint, [*c]const GLchar, GLint, [*c]const GLchar) callconv(.C) void; pub const PFNGLDELETENAMEDSTRINGARBPROC = ?fn (GLint, [*c]const GLchar) callconv(.C) void; pub const PFNGLCOMPILESHADERINCLUDEARBPROC = ?fn (GLuint, GLsizei, [*c]const [*c]const GLchar, [*c]const GLint) callconv(.C) void; pub const PFNGLISNAMEDSTRINGARBPROC = ?fn (GLint, [*c]const GLchar) callconv(.C) GLboolean; pub const PFNGLGETNAMEDSTRINGARBPROC = ?fn (GLint, [*c]const GLchar, GLsizei, [*c]GLint, [*c]GLchar) callconv(.C) void; pub const PFNGLGETNAMEDSTRINGIVARBPROC = ?fn (GLint, [*c]const GLchar, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLBUFFERPAGECOMMITMENTARBPROC = ?fn (GLenum, GLintptr, GLsizeiptr, GLboolean) callconv(.C) void; pub const PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC = ?fn (GLuint, GLintptr, GLsizeiptr, GLboolean) callconv(.C) void; pub const PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC = ?fn (GLuint, GLintptr, GLsizeiptr, GLboolean) callconv(.C) void; pub const PFNGLTEXPAGECOMMITMENTARBPROC = ?fn (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLboolean) callconv(.C) void; pub const PFNGLTEXBUFFERARBPROC = ?fn (GLenum, GLenum, GLuint) callconv(.C) void; pub const PFNGLCOMPRESSEDTEXIMAGE3DARBPROC = ?fn (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOMPRESSEDTEXIMAGE2DARBPROC = ?fn (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOMPRESSEDTEXIMAGE1DARBPROC = ?fn (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC = ?fn (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC = ?fn (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC = ?fn (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLGETCOMPRESSEDTEXIMAGEARBPROC = ?fn (GLenum, GLint, ?*anyopaque) callconv(.C) void; pub const PFNGLLOADTRANSPOSEMATRIXFARBPROC = ?fn ([*c]const GLfloat) callconv(.C) void; pub const PFNGLLOADTRANSPOSEMATRIXDARBPROC = ?fn ([*c]const GLdouble) callconv(.C) void; pub const PFNGLMULTTRANSPOSEMATRIXFARBPROC = ?fn ([*c]const GLfloat) callconv(.C) void; pub const PFNGLMULTTRANSPOSEMATRIXDARBPROC = ?fn ([*c]const GLdouble) callconv(.C) void; pub const PFNGLWEIGHTBVARBPROC = ?fn (GLint, [*c]const GLbyte) callconv(.C) void; pub const PFNGLWEIGHTSVARBPROC = ?fn (GLint, [*c]const GLshort) callconv(.C) void; pub const PFNGLWEIGHTIVARBPROC = ?fn (GLint, [*c]const GLint) callconv(.C) void; pub const PFNGLWEIGHTFVARBPROC = ?fn (GLint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLWEIGHTDVARBPROC = ?fn (GLint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLWEIGHTUBVARBPROC = ?fn (GLint, [*c]const GLubyte) callconv(.C) void; pub const PFNGLWEIGHTUSVARBPROC = ?fn (GLint, [*c]const GLushort) callconv(.C) void; pub const PFNGLWEIGHTUIVARBPROC = ?fn (GLint, [*c]const GLuint) callconv(.C) void; pub const PFNGLWEIGHTPOINTERARBPROC = ?fn (GLint, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLVERTEXBLENDARBPROC = ?fn (GLint) callconv(.C) void; pub const GLsizeiptrARB = khronos_ssize_t; pub const GLintptrARB = khronos_intptr_t; pub const PFNGLBINDBUFFERARBPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLDELETEBUFFERSARBPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLGENBUFFERSARBPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLISBUFFERARBPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLBUFFERDATAARBPROC = ?fn (GLenum, GLsizeiptrARB, ?*const anyopaque, GLenum) callconv(.C) void; pub const PFNGLBUFFERSUBDATAARBPROC = ?fn (GLenum, GLintptrARB, GLsizeiptrARB, ?*const anyopaque) callconv(.C) void; pub const PFNGLGETBUFFERSUBDATAARBPROC = ?fn (GLenum, GLintptrARB, GLsizeiptrARB, ?*anyopaque) callconv(.C) void; pub const PFNGLMAPBUFFERARBPROC = ?fn (GLenum, GLenum) callconv(.C) ?*anyopaque; pub const PFNGLUNMAPBUFFERARBPROC = ?fn (GLenum) callconv(.C) GLboolean; pub const PFNGLGETBUFFERPARAMETERIVARBPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETBUFFERPOINTERVARBPROC = ?fn (GLenum, GLenum, [*c]?*anyopaque) callconv(.C) void; pub const PFNGLVERTEXATTRIB1DARBPROC = ?fn (GLuint, GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB1DVARBPROC = ?fn (GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB1FARBPROC = ?fn (GLuint, GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB1FVARBPROC = ?fn (GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB1SARBPROC = ?fn (GLuint, GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB1SVARBPROC = ?fn (GLuint, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB2DARBPROC = ?fn (GLuint, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB2DVARBPROC = ?fn (GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB2FARBPROC = ?fn (GLuint, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB2FVARBPROC = ?fn (GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB2SARBPROC = ?fn (GLuint, GLshort, GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB2SVARBPROC = ?fn (GLuint, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB3DARBPROC = ?fn (GLuint, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB3DVARBPROC = ?fn (GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB3FARBPROC = ?fn (GLuint, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB3FVARBPROC = ?fn (GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB3SARBPROC = ?fn (GLuint, GLshort, GLshort, GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB3SVARBPROC = ?fn (GLuint, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB4NBVARBPROC = ?fn (GLuint, [*c]const GLbyte) callconv(.C) void; pub const PFNGLVERTEXATTRIB4NIVARBPROC = ?fn (GLuint, [*c]const GLint) callconv(.C) void; pub const PFNGLVERTEXATTRIB4NSVARBPROC = ?fn (GLuint, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB4NUBARBPROC = ?fn (GLuint, GLubyte, GLubyte, GLubyte, GLubyte) callconv(.C) void; pub const PFNGLVERTEXATTRIB4NUBVARBPROC = ?fn (GLuint, [*c]const GLubyte) callconv(.C) void; pub const PFNGLVERTEXATTRIB4NUIVARBPROC = ?fn (GLuint, [*c]const GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIB4NUSVARBPROC = ?fn (GLuint, [*c]const GLushort) callconv(.C) void; pub const PFNGLVERTEXATTRIB4BVARBPROC = ?fn (GLuint, [*c]const GLbyte) callconv(.C) void; pub const PFNGLVERTEXATTRIB4DARBPROC = ?fn (GLuint, GLdouble, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB4DVARBPROC = ?fn (GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB4FARBPROC = ?fn (GLuint, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB4FVARBPROC = ?fn (GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB4IVARBPROC = ?fn (GLuint, [*c]const GLint) callconv(.C) void; pub const PFNGLVERTEXATTRIB4SARBPROC = ?fn (GLuint, GLshort, GLshort, GLshort, GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB4SVARBPROC = ?fn (GLuint, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB4UBVARBPROC = ?fn (GLuint, [*c]const GLubyte) callconv(.C) void; pub const PFNGLVERTEXATTRIB4UIVARBPROC = ?fn (GLuint, [*c]const GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIB4USVARBPROC = ?fn (GLuint, [*c]const GLushort) callconv(.C) void; pub const PFNGLVERTEXATTRIBPOINTERARBPROC = ?fn (GLuint, GLint, GLenum, GLboolean, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLENABLEVERTEXATTRIBARRAYARBPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLDISABLEVERTEXATTRIBARRAYARBPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBDVARBPROC = ?fn (GLuint, GLenum, [*c]GLdouble) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBFVARBPROC = ?fn (GLuint, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBIVARBPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBPOINTERVARBPROC = ?fn (GLuint, GLenum, [*c]?*anyopaque) callconv(.C) void; pub const PFNGLBINDATTRIBLOCATIONARBPROC = ?fn (GLhandleARB, GLuint, [*c]const GLcharARB) callconv(.C) void; pub const PFNGLGETACTIVEATTRIBARBPROC = ?fn (GLhandleARB, GLuint, GLsizei, [*c]GLsizei, [*c]GLint, [*c]GLenum, [*c]GLcharARB) callconv(.C) void; pub const PFNGLGETATTRIBLOCATIONARBPROC = ?fn (GLhandleARB, [*c]const GLcharARB) callconv(.C) GLint; pub const PFNGLWINDOWPOS2DARBPROC = ?fn (GLdouble, GLdouble) callconv(.C) void; pub const PFNGLWINDOWPOS2DVARBPROC = ?fn ([*c]const GLdouble) callconv(.C) void; pub const PFNGLWINDOWPOS2FARBPROC = ?fn (GLfloat, GLfloat) callconv(.C) void; pub const PFNGLWINDOWPOS2FVARBPROC = ?fn ([*c]const GLfloat) callconv(.C) void; pub const PFNGLWINDOWPOS2IARBPROC = ?fn (GLint, GLint) callconv(.C) void; pub const PFNGLWINDOWPOS2IVARBPROC = ?fn ([*c]const GLint) callconv(.C) void; pub const PFNGLWINDOWPOS2SARBPROC = ?fn (GLshort, GLshort) callconv(.C) void; pub const PFNGLWINDOWPOS2SVARBPROC = ?fn ([*c]const GLshort) callconv(.C) void; pub const PFNGLWINDOWPOS3DARBPROC = ?fn (GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLWINDOWPOS3DVARBPROC = ?fn ([*c]const GLdouble) callconv(.C) void; pub const PFNGLWINDOWPOS3FARBPROC = ?fn (GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLWINDOWPOS3FVARBPROC = ?fn ([*c]const GLfloat) callconv(.C) void; pub const PFNGLWINDOWPOS3IARBPROC = ?fn (GLint, GLint, GLint) callconv(.C) void; pub const PFNGLWINDOWPOS3IVARBPROC = ?fn ([*c]const GLint) callconv(.C) void; pub const PFNGLWINDOWPOS3SARBPROC = ?fn (GLshort, GLshort, GLshort) callconv(.C) void; pub const PFNGLWINDOWPOS3SVARBPROC = ?fn ([*c]const GLshort) callconv(.C) void; pub const PFNGLBLENDBARRIERKHRPROC = ?fn () callconv(.C) void; pub const PFNGLMAXSHADERCOMPILERTHREADSKHRPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLMULTITEXCOORD1BOESPROC = ?fn (GLenum, GLbyte) callconv(.C) void; pub const PFNGLMULTITEXCOORD1BVOESPROC = ?fn (GLenum, [*c]const GLbyte) callconv(.C) void; pub const PFNGLMULTITEXCOORD2BOESPROC = ?fn (GLenum, GLbyte, GLbyte) callconv(.C) void; pub const PFNGLMULTITEXCOORD2BVOESPROC = ?fn (GLenum, [*c]const GLbyte) callconv(.C) void; pub const PFNGLMULTITEXCOORD3BOESPROC = ?fn (GLenum, GLbyte, GLbyte, GLbyte) callconv(.C) void; pub const PFNGLMULTITEXCOORD3BVOESPROC = ?fn (GLenum, [*c]const GLbyte) callconv(.C) void; pub const PFNGLMULTITEXCOORD4BOESPROC = ?fn (GLenum, GLbyte, GLbyte, GLbyte, GLbyte) callconv(.C) void; pub const PFNGLMULTITEXCOORD4BVOESPROC = ?fn (GLenum, [*c]const GLbyte) callconv(.C) void; pub const PFNGLTEXCOORD1BOESPROC = ?fn (GLbyte) callconv(.C) void; pub const PFNGLTEXCOORD1BVOESPROC = ?fn ([*c]const GLbyte) callconv(.C) void; pub const PFNGLTEXCOORD2BOESPROC = ?fn (GLbyte, GLbyte) callconv(.C) void; pub const PFNGLTEXCOORD2BVOESPROC = ?fn ([*c]const GLbyte) callconv(.C) void; pub const PFNGLTEXCOORD3BOESPROC = ?fn (GLbyte, GLbyte, GLbyte) callconv(.C) void; pub const PFNGLTEXCOORD3BVOESPROC = ?fn ([*c]const GLbyte) callconv(.C) void; pub const PFNGLTEXCOORD4BOESPROC = ?fn (GLbyte, GLbyte, GLbyte, GLbyte) callconv(.C) void; pub const PFNGLTEXCOORD4BVOESPROC = ?fn ([*c]const GLbyte) callconv(.C) void; pub const PFNGLVERTEX2BOESPROC = ?fn (GLbyte, GLbyte) callconv(.C) void; pub const PFNGLVERTEX2BVOESPROC = ?fn ([*c]const GLbyte) callconv(.C) void; pub const PFNGLVERTEX3BOESPROC = ?fn (GLbyte, GLbyte, GLbyte) callconv(.C) void; pub const PFNGLVERTEX3BVOESPROC = ?fn ([*c]const GLbyte) callconv(.C) void; pub const PFNGLVERTEX4BOESPROC = ?fn (GLbyte, GLbyte, GLbyte, GLbyte) callconv(.C) void; pub const PFNGLVERTEX4BVOESPROC = ?fn ([*c]const GLbyte) callconv(.C) void; pub const GLfixed = khronos_int32_t; pub const PFNGLALPHAFUNCXOESPROC = ?fn (GLenum, GLfixed) callconv(.C) void; pub const PFNGLCLEARCOLORXOESPROC = ?fn (GLfixed, GLfixed, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLCLEARDEPTHXOESPROC = ?fn (GLfixed) callconv(.C) void; pub const PFNGLCLIPPLANEXOESPROC = ?fn (GLenum, [*c]const GLfixed) callconv(.C) void; pub const PFNGLCOLOR4XOESPROC = ?fn (GLfixed, GLfixed, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLDEPTHRANGEXOESPROC = ?fn (GLfixed, GLfixed) callconv(.C) void; pub const PFNGLFOGXOESPROC = ?fn (GLenum, GLfixed) callconv(.C) void; pub const PFNGLFOGXVOESPROC = ?fn (GLenum, [*c]const GLfixed) callconv(.C) void; pub const PFNGLFRUSTUMXOESPROC = ?fn (GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLGETCLIPPLANEXOESPROC = ?fn (GLenum, [*c]GLfixed) callconv(.C) void; pub const PFNGLGETFIXEDVOESPROC = ?fn (GLenum, [*c]GLfixed) callconv(.C) void; pub const PFNGLGETTEXENVXVOESPROC = ?fn (GLenum, GLenum, [*c]GLfixed) callconv(.C) void; pub const PFNGLGETTEXPARAMETERXVOESPROC = ?fn (GLenum, GLenum, [*c]GLfixed) callconv(.C) void; pub const PFNGLLIGHTMODELXOESPROC = ?fn (GLenum, GLfixed) callconv(.C) void; pub const PFNGLLIGHTMODELXVOESPROC = ?fn (GLenum, [*c]const GLfixed) callconv(.C) void; pub const PFNGLLIGHTXOESPROC = ?fn (GLenum, GLenum, GLfixed) callconv(.C) void; pub const PFNGLLIGHTXVOESPROC = ?fn (GLenum, GLenum, [*c]const GLfixed) callconv(.C) void; pub const PFNGLLINEWIDTHXOESPROC = ?fn (GLfixed) callconv(.C) void; pub const PFNGLLOADMATRIXXOESPROC = ?fn ([*c]const GLfixed) callconv(.C) void; pub const PFNGLMATERIALXOESPROC = ?fn (GLenum, GLenum, GLfixed) callconv(.C) void; pub const PFNGLMATERIALXVOESPROC = ?fn (GLenum, GLenum, [*c]const GLfixed) callconv(.C) void; pub const PFNGLMULTMATRIXXOESPROC = ?fn ([*c]const GLfixed) callconv(.C) void; pub const PFNGLMULTITEXCOORD4XOESPROC = ?fn (GLenum, GLfixed, GLfixed, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLNORMAL3XOESPROC = ?fn (GLfixed, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLORTHOXOESPROC = ?fn (GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLPOINTPARAMETERXVOESPROC = ?fn (GLenum, [*c]const GLfixed) callconv(.C) void; pub const PFNGLPOINTSIZEXOESPROC = ?fn (GLfixed) callconv(.C) void; pub const PFNGLPOLYGONOFFSETXOESPROC = ?fn (GLfixed, GLfixed) callconv(.C) void; pub const PFNGLROTATEXOESPROC = ?fn (GLfixed, GLfixed, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLSCALEXOESPROC = ?fn (GLfixed, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLTEXENVXOESPROC = ?fn (GLenum, GLenum, GLfixed) callconv(.C) void; pub const PFNGLTEXENVXVOESPROC = ?fn (GLenum, GLenum, [*c]const GLfixed) callconv(.C) void; pub const PFNGLTEXPARAMETERXOESPROC = ?fn (GLenum, GLenum, GLfixed) callconv(.C) void; pub const PFNGLTEXPARAMETERXVOESPROC = ?fn (GLenum, GLenum, [*c]const GLfixed) callconv(.C) void; pub const PFNGLTRANSLATEXOESPROC = ?fn (GLfixed, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLACCUMXOESPROC = ?fn (GLenum, GLfixed) callconv(.C) void; pub const PFNGLBITMAPXOESPROC = ?fn (GLsizei, GLsizei, GLfixed, GLfixed, GLfixed, GLfixed, [*c]const GLubyte) callconv(.C) void; pub const PFNGLBLENDCOLORXOESPROC = ?fn (GLfixed, GLfixed, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLCLEARACCUMXOESPROC = ?fn (GLfixed, GLfixed, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLCOLOR3XOESPROC = ?fn (GLfixed, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLCOLOR3XVOESPROC = ?fn ([*c]const GLfixed) callconv(.C) void; pub const PFNGLCOLOR4XVOESPROC = ?fn ([*c]const GLfixed) callconv(.C) void; pub const PFNGLCONVOLUTIONPARAMETERXOESPROC = ?fn (GLenum, GLenum, GLfixed) callconv(.C) void; pub const PFNGLCONVOLUTIONPARAMETERXVOESPROC = ?fn (GLenum, GLenum, [*c]const GLfixed) callconv(.C) void; pub const PFNGLEVALCOORD1XOESPROC = ?fn (GLfixed) callconv(.C) void; pub const PFNGLEVALCOORD1XVOESPROC = ?fn ([*c]const GLfixed) callconv(.C) void; pub const PFNGLEVALCOORD2XOESPROC = ?fn (GLfixed, GLfixed) callconv(.C) void; pub const PFNGLEVALCOORD2XVOESPROC = ?fn ([*c]const GLfixed) callconv(.C) void; pub const PFNGLFEEDBACKBUFFERXOESPROC = ?fn (GLsizei, GLenum, [*c]const GLfixed) callconv(.C) void; pub const PFNGLGETCONVOLUTIONPARAMETERXVOESPROC = ?fn (GLenum, GLenum, [*c]GLfixed) callconv(.C) void; pub const PFNGLGETHISTOGRAMPARAMETERXVOESPROC = ?fn (GLenum, GLenum, [*c]GLfixed) callconv(.C) void; pub const PFNGLGETLIGHTXOESPROC = ?fn (GLenum, GLenum, [*c]GLfixed) callconv(.C) void; pub const PFNGLGETMAPXVOESPROC = ?fn (GLenum, GLenum, [*c]GLfixed) callconv(.C) void; pub const PFNGLGETMATERIALXOESPROC = ?fn (GLenum, GLenum, GLfixed) callconv(.C) void; pub const PFNGLGETPIXELMAPXVPROC = ?fn (GLenum, GLint, [*c]GLfixed) callconv(.C) void; pub const PFNGLGETTEXGENXVOESPROC = ?fn (GLenum, GLenum, [*c]GLfixed) callconv(.C) void; pub const PFNGLGETTEXLEVELPARAMETERXVOESPROC = ?fn (GLenum, GLint, GLenum, [*c]GLfixed) callconv(.C) void; pub const PFNGLINDEXXOESPROC = ?fn (GLfixed) callconv(.C) void; pub const PFNGLINDEXXVOESPROC = ?fn ([*c]const GLfixed) callconv(.C) void; pub const PFNGLLOADTRANSPOSEMATRIXXOESPROC = ?fn ([*c]const GLfixed) callconv(.C) void; pub const PFNGLMAP1XOESPROC = ?fn (GLenum, GLfixed, GLfixed, GLint, GLint, GLfixed) callconv(.C) void; pub const PFNGLMAP2XOESPROC = ?fn (GLenum, GLfixed, GLfixed, GLint, GLint, GLfixed, GLfixed, GLint, GLint, GLfixed) callconv(.C) void; pub const PFNGLMAPGRID1XOESPROC = ?fn (GLint, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLMAPGRID2XOESPROC = ?fn (GLint, GLfixed, GLfixed, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLMULTTRANSPOSEMATRIXXOESPROC = ?fn ([*c]const GLfixed) callconv(.C) void; pub const PFNGLMULTITEXCOORD1XOESPROC = ?fn (GLenum, GLfixed) callconv(.C) void; pub const PFNGLMULTITEXCOORD1XVOESPROC = ?fn (GLenum, [*c]const GLfixed) callconv(.C) void; pub const PFNGLMULTITEXCOORD2XOESPROC = ?fn (GLenum, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLMULTITEXCOORD2XVOESPROC = ?fn (GLenum, [*c]const GLfixed) callconv(.C) void; pub const PFNGLMULTITEXCOORD3XOESPROC = ?fn (GLenum, GLfixed, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLMULTITEXCOORD3XVOESPROC = ?fn (GLenum, [*c]const GLfixed) callconv(.C) void; pub const PFNGLMULTITEXCOORD4XVOESPROC = ?fn (GLenum, [*c]const GLfixed) callconv(.C) void; pub const PFNGLNORMAL3XVOESPROC = ?fn ([*c]const GLfixed) callconv(.C) void; pub const PFNGLPASSTHROUGHXOESPROC = ?fn (GLfixed) callconv(.C) void; pub const PFNGLPIXELMAPXPROC = ?fn (GLenum, GLint, [*c]const GLfixed) callconv(.C) void; pub const PFNGLPIXELSTOREXPROC = ?fn (GLenum, GLfixed) callconv(.C) void; pub const PFNGLPIXELTRANSFERXOESPROC = ?fn (GLenum, GLfixed) callconv(.C) void; pub const PFNGLPIXELZOOMXOESPROC = ?fn (GLfixed, GLfixed) callconv(.C) void; pub const PFNGLPRIORITIZETEXTURESXOESPROC = ?fn (GLsizei, [*c]const GLuint, [*c]const GLfixed) callconv(.C) void; pub const PFNGLRASTERPOS2XOESPROC = ?fn (GLfixed, GLfixed) callconv(.C) void; pub const PFNGLRASTERPOS2XVOESPROC = ?fn ([*c]const GLfixed) callconv(.C) void; pub const PFNGLRASTERPOS3XOESPROC = ?fn (GLfixed, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLRASTERPOS3XVOESPROC = ?fn ([*c]const GLfixed) callconv(.C) void; pub const PFNGLRASTERPOS4XOESPROC = ?fn (GLfixed, GLfixed, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLRASTERPOS4XVOESPROC = ?fn ([*c]const GLfixed) callconv(.C) void; pub const PFNGLRECTXOESPROC = ?fn (GLfixed, GLfixed, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLRECTXVOESPROC = ?fn ([*c]const GLfixed, [*c]const GLfixed) callconv(.C) void; pub const PFNGLTEXCOORD1XOESPROC = ?fn (GLfixed) callconv(.C) void; pub const PFNGLTEXCOORD1XVOESPROC = ?fn ([*c]const GLfixed) callconv(.C) void; pub const PFNGLTEXCOORD2XOESPROC = ?fn (GLfixed, GLfixed) callconv(.C) void; pub const PFNGLTEXCOORD2XVOESPROC = ?fn ([*c]const GLfixed) callconv(.C) void; pub const PFNGLTEXCOORD3XOESPROC = ?fn (GLfixed, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLTEXCOORD3XVOESPROC = ?fn ([*c]const GLfixed) callconv(.C) void; pub const PFNGLTEXCOORD4XOESPROC = ?fn (GLfixed, GLfixed, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLTEXCOORD4XVOESPROC = ?fn ([*c]const GLfixed) callconv(.C) void; pub const PFNGLTEXGENXOESPROC = ?fn (GLenum, GLenum, GLfixed) callconv(.C) void; pub const PFNGLTEXGENXVOESPROC = ?fn (GLenum, GLenum, [*c]const GLfixed) callconv(.C) void; pub const PFNGLVERTEX2XOESPROC = ?fn (GLfixed) callconv(.C) void; pub const PFNGLVERTEX2XVOESPROC = ?fn ([*c]const GLfixed) callconv(.C) void; pub const PFNGLVERTEX3XOESPROC = ?fn (GLfixed, GLfixed) callconv(.C) void; pub const PFNGLVERTEX3XVOESPROC = ?fn ([*c]const GLfixed) callconv(.C) void; pub const PFNGLVERTEX4XOESPROC = ?fn (GLfixed, GLfixed, GLfixed) callconv(.C) void; pub const PFNGLVERTEX4XVOESPROC = ?fn ([*c]const GLfixed) callconv(.C) void; pub const PFNGLQUERYMATRIXXOESPROC = ?fn ([*c]GLfixed, [*c]GLint) callconv(.C) GLbitfield; pub const PFNGLCLEARDEPTHFOESPROC = ?fn (GLclampf) callconv(.C) void; pub const PFNGLCLIPPLANEFOESPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLDEPTHRANGEFOESPROC = ?fn (GLclampf, GLclampf) callconv(.C) void; pub const PFNGLFRUSTUMFOESPROC = ?fn (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLGETCLIPPLANEFOESPROC = ?fn (GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLORTHOFOESPROC = ?fn (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLTBUFFERMASK3DFXPROC = ?fn (GLuint) callconv(.C) void; pub const GLDEBUGPROCAMD = ?fn (GLuint, GLenum, GLenum, GLsizei, [*c]const GLchar, ?*anyopaque) callconv(.C) void; pub const PFNGLDEBUGMESSAGEENABLEAMDPROC = ?fn (GLenum, GLenum, GLsizei, [*c]const GLuint, GLboolean) callconv(.C) void; pub const PFNGLDEBUGMESSAGEINSERTAMDPROC = ?fn (GLenum, GLenum, GLuint, GLsizei, [*c]const GLchar) callconv(.C) void; pub const PFNGLDEBUGMESSAGECALLBACKAMDPROC = ?fn (GLDEBUGPROCAMD, ?*anyopaque) callconv(.C) void; pub const PFNGLGETDEBUGMESSAGELOGAMDPROC = ?fn (GLuint, GLsizei, [*c]GLenum, [*c]GLuint, [*c]GLuint, [*c]GLsizei, [*c]GLchar) callconv(.C) GLuint; pub const PFNGLBLENDFUNCINDEXEDAMDPROC = ?fn (GLuint, GLenum, GLenum) callconv(.C) void; pub const PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC = ?fn (GLuint, GLenum, GLenum, GLenum, GLenum) callconv(.C) void; pub const PFNGLBLENDEQUATIONINDEXEDAMDPROC = ?fn (GLuint, GLenum) callconv(.C) void; pub const PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC = ?fn (GLuint, GLenum, GLenum) callconv(.C) void; pub const PFNGLRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC = ?fn (GLenum, GLsizei, GLsizei, GLenum, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC = ?fn (GLuint, GLsizei, GLsizei, GLenum, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC = ?fn (GLenum, GLuint, GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLNAMEDFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC = ?fn (GLuint, GLuint, GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLGETFRAMEBUFFERPARAMETERFVAMDPROC = ?fn (GLenum, GLenum, GLuint, GLuint, GLsizei, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETNAMEDFRAMEBUFFERPARAMETERFVAMDPROC = ?fn (GLuint, GLenum, GLuint, GLuint, GLsizei, [*c]GLfloat) callconv(.C) void; pub const GLint64EXT = khronos_int64_t; pub const PFNGLUNIFORM1I64NVPROC = ?fn (GLint, GLint64EXT) callconv(.C) void; pub const PFNGLUNIFORM2I64NVPROC = ?fn (GLint, GLint64EXT, GLint64EXT) callconv(.C) void; pub const PFNGLUNIFORM3I64NVPROC = ?fn (GLint, GLint64EXT, GLint64EXT, GLint64EXT) callconv(.C) void; pub const PFNGLUNIFORM4I64NVPROC = ?fn (GLint, GLint64EXT, GLint64EXT, GLint64EXT, GLint64EXT) callconv(.C) void; pub const PFNGLUNIFORM1I64VNVPROC = ?fn (GLint, GLsizei, [*c]const GLint64EXT) callconv(.C) void; pub const PFNGLUNIFORM2I64VNVPROC = ?fn (GLint, GLsizei, [*c]const GLint64EXT) callconv(.C) void; pub const PFNGLUNIFORM3I64VNVPROC = ?fn (GLint, GLsizei, [*c]const GLint64EXT) callconv(.C) void; pub const PFNGLUNIFORM4I64VNVPROC = ?fn (GLint, GLsizei, [*c]const GLint64EXT) callconv(.C) void; pub const PFNGLUNIFORM1UI64NVPROC = ?fn (GLint, GLuint64EXT) callconv(.C) void; pub const PFNGLUNIFORM2UI64NVPROC = ?fn (GLint, GLuint64EXT, GLuint64EXT) callconv(.C) void; pub const PFNGLUNIFORM3UI64NVPROC = ?fn (GLint, GLuint64EXT, GLuint64EXT, GLuint64EXT) callconv(.C) void; pub const PFNGLUNIFORM4UI64NVPROC = ?fn (GLint, GLuint64EXT, GLuint64EXT, GLuint64EXT, GLuint64EXT) callconv(.C) void; pub const PFNGLUNIFORM1UI64VNVPROC = ?fn (GLint, GLsizei, [*c]const GLuint64EXT) callconv(.C) void; pub const PFNGLUNIFORM2UI64VNVPROC = ?fn (GLint, GLsizei, [*c]const GLuint64EXT) callconv(.C) void; pub const PFNGLUNIFORM3UI64VNVPROC = ?fn (GLint, GLsizei, [*c]const GLuint64EXT) callconv(.C) void; pub const PFNGLUNIFORM4UI64VNVPROC = ?fn (GLint, GLsizei, [*c]const GLuint64EXT) callconv(.C) void; pub const PFNGLGETUNIFORMI64VNVPROC = ?fn (GLuint, GLint, [*c]GLint64EXT) callconv(.C) void; pub const PFNGLGETUNIFORMUI64VNVPROC = ?fn (GLuint, GLint, [*c]GLuint64EXT) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1I64NVPROC = ?fn (GLuint, GLint, GLint64EXT) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2I64NVPROC = ?fn (GLuint, GLint, GLint64EXT, GLint64EXT) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3I64NVPROC = ?fn (GLuint, GLint, GLint64EXT, GLint64EXT, GLint64EXT) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4I64NVPROC = ?fn (GLuint, GLint, GLint64EXT, GLint64EXT, GLint64EXT, GLint64EXT) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1I64VNVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLint64EXT) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2I64VNVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLint64EXT) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3I64VNVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLint64EXT) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4I64VNVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLint64EXT) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1UI64NVPROC = ?fn (GLuint, GLint, GLuint64EXT) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2UI64NVPROC = ?fn (GLuint, GLint, GLuint64EXT, GLuint64EXT) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3UI64NVPROC = ?fn (GLuint, GLint, GLuint64EXT, GLuint64EXT, GLuint64EXT) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4UI64NVPROC = ?fn (GLuint, GLint, GLuint64EXT, GLuint64EXT, GLuint64EXT, GLuint64EXT) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1UI64VNVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLuint64EXT) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2UI64VNVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLuint64EXT) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3UI64VNVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLuint64EXT) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4UI64VNVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLuint64EXT) callconv(.C) void; pub const PFNGLVERTEXATTRIBPARAMETERIAMDPROC = ?fn (GLuint, GLenum, GLint) callconv(.C) void; pub const PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC = ?fn (GLenum, ?*const anyopaque, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC = ?fn (GLenum, GLenum, ?*const anyopaque, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLGENNAMESAMDPROC = ?fn (GLenum, GLuint, [*c]GLuint) callconv(.C) void; pub const PFNGLDELETENAMESAMDPROC = ?fn (GLenum, GLuint, [*c]const GLuint) callconv(.C) void; pub const PFNGLISNAMEAMDPROC = ?fn (GLenum, GLuint) callconv(.C) GLboolean; pub const PFNGLQUERYOBJECTPARAMETERUIAMDPROC = ?fn (GLenum, GLuint, GLenum, GLuint) callconv(.C) void; pub const PFNGLGETPERFMONITORGROUPSAMDPROC = ?fn ([*c]GLint, GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLGETPERFMONITORCOUNTERSAMDPROC = ?fn (GLuint, [*c]GLint, [*c]GLint, GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLGETPERFMONITORGROUPSTRINGAMDPROC = ?fn (GLuint, GLsizei, [*c]GLsizei, [*c]GLchar) callconv(.C) void; pub const PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC = ?fn (GLuint, GLuint, GLsizei, [*c]GLsizei, [*c]GLchar) callconv(.C) void; pub const PFNGLGETPERFMONITORCOUNTERINFOAMDPROC = ?fn (GLuint, GLuint, GLenum, ?*anyopaque) callconv(.C) void; pub const PFNGLGENPERFMONITORSAMDPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLDELETEPERFMONITORSAMDPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLSELECTPERFMONITORCOUNTERSAMDPROC = ?fn (GLuint, GLboolean, GLuint, GLint, [*c]GLuint) callconv(.C) void; pub const PFNGLBEGINPERFMONITORAMDPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLENDPERFMONITORAMDPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLGETPERFMONITORCOUNTERDATAAMDPROC = ?fn (GLuint, GLenum, GLsizei, [*c]GLuint, [*c]GLint) callconv(.C) void; pub const PFNGLSETMULTISAMPLEFVAMDPROC = ?fn (GLenum, GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLTEXSTORAGESPARSEAMDPROC = ?fn (GLenum, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLbitfield) callconv(.C) void; pub const PFNGLTEXTURESTORAGESPARSEAMDPROC = ?fn (GLuint, GLenum, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLbitfield) callconv(.C) void; pub const PFNGLSTENCILOPVALUEAMDPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLTESSELLATIONFACTORAMDPROC = ?fn (GLfloat) callconv(.C) void; pub const PFNGLTESSELLATIONMODEAMDPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLELEMENTPOINTERAPPLEPROC = ?fn (GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLDRAWELEMENTARRAYAPPLEPROC = ?fn (GLenum, GLint, GLsizei) callconv(.C) void; pub const PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC = ?fn (GLenum, GLuint, GLuint, GLint, GLsizei) callconv(.C) void; pub const PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC = ?fn (GLenum, [*c]const GLint, [*c]const GLsizei, GLsizei) callconv(.C) void; pub const PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC = ?fn (GLenum, GLuint, GLuint, [*c]const GLint, [*c]const GLsizei, GLsizei) callconv(.C) void; pub const PFNGLGENFENCESAPPLEPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLDELETEFENCESAPPLEPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLSETFENCEAPPLEPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLISFENCEAPPLEPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLTESTFENCEAPPLEPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLFINISHFENCEAPPLEPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLTESTOBJECTAPPLEPROC = ?fn (GLenum, GLuint) callconv(.C) GLboolean; pub const PFNGLFINISHOBJECTAPPLEPROC = ?fn (GLenum, GLint) callconv(.C) void; pub const PFNGLBUFFERPARAMETERIAPPLEPROC = ?fn (GLenum, GLenum, GLint) callconv(.C) void; pub const PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC = ?fn (GLenum, GLintptr, GLsizeiptr) callconv(.C) void; pub const PFNGLOBJECTPURGEABLEAPPLEPROC = ?fn (GLenum, GLuint, GLenum) callconv(.C) GLenum; pub const PFNGLOBJECTUNPURGEABLEAPPLEPROC = ?fn (GLenum, GLuint, GLenum) callconv(.C) GLenum; pub const PFNGLGETOBJECTPARAMETERIVAPPLEPROC = ?fn (GLenum, GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLTEXTURERANGEAPPLEPROC = ?fn (GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC = ?fn (GLenum, GLenum, [*c]?*anyopaque) callconv(.C) void; pub const PFNGLBINDVERTEXARRAYAPPLEPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLDELETEVERTEXARRAYSAPPLEPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLGENVERTEXARRAYSAPPLEPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLISVERTEXARRAYAPPLEPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLVERTEXARRAYRANGEAPPLEPROC = ?fn (GLsizei, ?*anyopaque) callconv(.C) void; pub const PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC = ?fn (GLsizei, ?*anyopaque) callconv(.C) void; pub const PFNGLVERTEXARRAYPARAMETERIAPPLEPROC = ?fn (GLenum, GLint) callconv(.C) void; pub const PFNGLENABLEVERTEXATTRIBAPPLEPROC = ?fn (GLuint, GLenum) callconv(.C) void; pub const PFNGLDISABLEVERTEXATTRIBAPPLEPROC = ?fn (GLuint, GLenum) callconv(.C) void; pub const PFNGLISVERTEXATTRIBENABLEDAPPLEPROC = ?fn (GLuint, GLenum) callconv(.C) GLboolean; pub const PFNGLMAPVERTEXATTRIB1DAPPLEPROC = ?fn (GLuint, GLuint, GLdouble, GLdouble, GLint, GLint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLMAPVERTEXATTRIB1FAPPLEPROC = ?fn (GLuint, GLuint, GLfloat, GLfloat, GLint, GLint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLMAPVERTEXATTRIB2DAPPLEPROC = ?fn (GLuint, GLuint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLMAPVERTEXATTRIB2FAPPLEPROC = ?fn (GLuint, GLuint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLDRAWBUFFERSATIPROC = ?fn (GLsizei, [*c]const GLenum) callconv(.C) void; pub const PFNGLELEMENTPOINTERATIPROC = ?fn (GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLDRAWELEMENTARRAYATIPROC = ?fn (GLenum, GLsizei) callconv(.C) void; pub const PFNGLDRAWRANGEELEMENTARRAYATIPROC = ?fn (GLenum, GLuint, GLuint, GLsizei) callconv(.C) void; pub const PFNGLTEXBUMPPARAMETERIVATIPROC = ?fn (GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLTEXBUMPPARAMETERFVATIPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLGETTEXBUMPPARAMETERIVATIPROC = ?fn (GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETTEXBUMPPARAMETERFVATIPROC = ?fn (GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGENFRAGMENTSHADERSATIPROC = ?fn (GLuint) callconv(.C) GLuint; pub const PFNGLBINDFRAGMENTSHADERATIPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLDELETEFRAGMENTSHADERATIPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLBEGINFRAGMENTSHADERATIPROC = ?fn () callconv(.C) void; pub const PFNGLENDFRAGMENTSHADERATIPROC = ?fn () callconv(.C) void; pub const PFNGLPASSTEXCOORDATIPROC = ?fn (GLuint, GLuint, GLenum) callconv(.C) void; pub const PFNGLSAMPLEMAPATIPROC = ?fn (GLuint, GLuint, GLenum) callconv(.C) void; pub const PFNGLCOLORFRAGMENTOP1ATIPROC = ?fn (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLCOLORFRAGMENTOP2ATIPROC = ?fn (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLCOLORFRAGMENTOP3ATIPROC = ?fn (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLALPHAFRAGMENTOP1ATIPROC = ?fn (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLALPHAFRAGMENTOP2ATIPROC = ?fn (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLALPHAFRAGMENTOP3ATIPROC = ?fn (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLSETFRAGMENTSHADERCONSTANTATIPROC = ?fn (GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLMAPOBJECTBUFFERATIPROC = ?fn (GLuint) callconv(.C) ?*anyopaque; pub const PFNGLUNMAPOBJECTBUFFERATIPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLPNTRIANGLESIATIPROC = ?fn (GLenum, GLint) callconv(.C) void; pub const PFNGLPNTRIANGLESFATIPROC = ?fn (GLenum, GLfloat) callconv(.C) void; pub const PFNGLSTENCILOPSEPARATEATIPROC = ?fn (GLenum, GLenum, GLenum, GLenum) callconv(.C) void; pub const PFNGLSTENCILFUNCSEPARATEATIPROC = ?fn (GLenum, GLenum, GLint, GLuint) callconv(.C) void; pub const PFNGLNEWOBJECTBUFFERATIPROC = ?fn (GLsizei, ?*const anyopaque, GLenum) callconv(.C) GLuint; pub const PFNGLISOBJECTBUFFERATIPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLUPDATEOBJECTBUFFERATIPROC = ?fn (GLuint, GLuint, GLsizei, ?*const anyopaque, GLenum) callconv(.C) void; pub const PFNGLGETOBJECTBUFFERFVATIPROC = ?fn (GLuint, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETOBJECTBUFFERIVATIPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLFREEOBJECTBUFFERATIPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLARRAYOBJECTATIPROC = ?fn (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint) callconv(.C) void; pub const PFNGLGETARRAYOBJECTFVATIPROC = ?fn (GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETARRAYOBJECTIVATIPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLVARIANTARRAYOBJECTATIPROC = ?fn (GLuint, GLenum, GLsizei, GLuint, GLuint) callconv(.C) void; pub const PFNGLGETVARIANTARRAYOBJECTFVATIPROC = ?fn (GLuint, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETVARIANTARRAYOBJECTIVATIPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLVERTEXATTRIBARRAYOBJECTATIPROC = ?fn (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC = ?fn (GLuint, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLVERTEXSTREAM1SATIPROC = ?fn (GLenum, GLshort) callconv(.C) void; pub const PFNGLVERTEXSTREAM1SVATIPROC = ?fn (GLenum, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXSTREAM1IATIPROC = ?fn (GLenum, GLint) callconv(.C) void; pub const PFNGLVERTEXSTREAM1IVATIPROC = ?fn (GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLVERTEXSTREAM1FATIPROC = ?fn (GLenum, GLfloat) callconv(.C) void; pub const PFNGLVERTEXSTREAM1FVATIPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVERTEXSTREAM1DATIPROC = ?fn (GLenum, GLdouble) callconv(.C) void; pub const PFNGLVERTEXSTREAM1DVATIPROC = ?fn (GLenum, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXSTREAM2SATIPROC = ?fn (GLenum, GLshort, GLshort) callconv(.C) void; pub const PFNGLVERTEXSTREAM2SVATIPROC = ?fn (GLenum, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXSTREAM2IATIPROC = ?fn (GLenum, GLint, GLint) callconv(.C) void; pub const PFNGLVERTEXSTREAM2IVATIPROC = ?fn (GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLVERTEXSTREAM2FATIPROC = ?fn (GLenum, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLVERTEXSTREAM2FVATIPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVERTEXSTREAM2DATIPROC = ?fn (GLenum, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLVERTEXSTREAM2DVATIPROC = ?fn (GLenum, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXSTREAM3SATIPROC = ?fn (GLenum, GLshort, GLshort, GLshort) callconv(.C) void; pub const PFNGLVERTEXSTREAM3SVATIPROC = ?fn (GLenum, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXSTREAM3IATIPROC = ?fn (GLenum, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLVERTEXSTREAM3IVATIPROC = ?fn (GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLVERTEXSTREAM3FATIPROC = ?fn (GLenum, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLVERTEXSTREAM3FVATIPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVERTEXSTREAM3DATIPROC = ?fn (GLenum, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLVERTEXSTREAM3DVATIPROC = ?fn (GLenum, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXSTREAM4SATIPROC = ?fn (GLenum, GLshort, GLshort, GLshort, GLshort) callconv(.C) void; pub const PFNGLVERTEXSTREAM4SVATIPROC = ?fn (GLenum, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXSTREAM4IATIPROC = ?fn (GLenum, GLint, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLVERTEXSTREAM4IVATIPROC = ?fn (GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLVERTEXSTREAM4FATIPROC = ?fn (GLenum, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLVERTEXSTREAM4FVATIPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVERTEXSTREAM4DATIPROC = ?fn (GLenum, GLdouble, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLVERTEXSTREAM4DVATIPROC = ?fn (GLenum, [*c]const GLdouble) callconv(.C) void; pub const PFNGLNORMALSTREAM3BATIPROC = ?fn (GLenum, GLbyte, GLbyte, GLbyte) callconv(.C) void; pub const PFNGLNORMALSTREAM3BVATIPROC = ?fn (GLenum, [*c]const GLbyte) callconv(.C) void; pub const PFNGLNORMALSTREAM3SATIPROC = ?fn (GLenum, GLshort, GLshort, GLshort) callconv(.C) void; pub const PFNGLNORMALSTREAM3SVATIPROC = ?fn (GLenum, [*c]const GLshort) callconv(.C) void; pub const PFNGLNORMALSTREAM3IATIPROC = ?fn (GLenum, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLNORMALSTREAM3IVATIPROC = ?fn (GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLNORMALSTREAM3FATIPROC = ?fn (GLenum, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLNORMALSTREAM3FVATIPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLNORMALSTREAM3DATIPROC = ?fn (GLenum, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLNORMALSTREAM3DVATIPROC = ?fn (GLenum, [*c]const GLdouble) callconv(.C) void; pub const PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLVERTEXBLENDENVIATIPROC = ?fn (GLenum, GLint) callconv(.C) void; pub const PFNGLVERTEXBLENDENVFATIPROC = ?fn (GLenum, GLfloat) callconv(.C) void; pub const GLeglImageOES = ?*anyopaque; pub const PFNGLEGLIMAGETARGETTEXSTORAGEEXTPROC = ?fn (GLenum, GLeglImageOES, [*c]const GLint) callconv(.C) void; pub const PFNGLEGLIMAGETARGETTEXTURESTORAGEEXTPROC = ?fn (GLuint, GLeglImageOES, [*c]const GLint) callconv(.C) void; pub const PFNGLUNIFORMBUFFEREXTPROC = ?fn (GLuint, GLint, GLuint) callconv(.C) void; pub const PFNGLGETUNIFORMBUFFERSIZEEXTPROC = ?fn (GLuint, GLint) callconv(.C) GLint; pub const PFNGLGETUNIFORMOFFSETEXTPROC = ?fn (GLuint, GLint) callconv(.C) GLintptr; pub const PFNGLBLENDCOLOREXTPROC = ?fn (GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLBLENDEQUATIONSEPARATEEXTPROC = ?fn (GLenum, GLenum) callconv(.C) void; pub const PFNGLBLENDFUNCSEPARATEEXTPROC = ?fn (GLenum, GLenum, GLenum, GLenum) callconv(.C) void; pub const PFNGLBLENDEQUATIONEXTPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLCOLORSUBTABLEEXTPROC = ?fn (GLenum, GLsizei, GLsizei, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOPYCOLORSUBTABLEEXTPROC = ?fn (GLenum, GLsizei, GLint, GLint, GLsizei) callconv(.C) void; pub const PFNGLLOCKARRAYSEXTPROC = ?fn (GLint, GLsizei) callconv(.C) void; pub const PFNGLUNLOCKARRAYSEXTPROC = ?fn () callconv(.C) void; pub const PFNGLCONVOLUTIONFILTER1DEXTPROC = ?fn (GLenum, GLenum, GLsizei, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLCONVOLUTIONFILTER2DEXTPROC = ?fn (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLCONVOLUTIONPARAMETERFEXTPROC = ?fn (GLenum, GLenum, GLfloat) callconv(.C) void; pub const PFNGLCONVOLUTIONPARAMETERFVEXTPROC = ?fn (GLenum, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLCONVOLUTIONPARAMETERIEXTPROC = ?fn (GLenum, GLenum, GLint) callconv(.C) void; pub const PFNGLCONVOLUTIONPARAMETERIVEXTPROC = ?fn (GLenum, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC = ?fn (GLenum, GLenum, GLint, GLint, GLsizei) callconv(.C) void; pub const PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC = ?fn (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLGETCONVOLUTIONFILTEREXTPROC = ?fn (GLenum, GLenum, GLenum, ?*anyopaque) callconv(.C) void; pub const PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC = ?fn (GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETSEPARABLEFILTEREXTPROC = ?fn (GLenum, GLenum, GLenum, ?*anyopaque, ?*anyopaque, ?*anyopaque) callconv(.C) void; pub const PFNGLSEPARABLEFILTER2DEXTPROC = ?fn (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, ?*const anyopaque, ?*const anyopaque) callconv(.C) void; pub const PFNGLTANGENT3BEXTPROC = ?fn (GLbyte, GLbyte, GLbyte) callconv(.C) void; pub const PFNGLTANGENT3BVEXTPROC = ?fn ([*c]const GLbyte) callconv(.C) void; pub const PFNGLTANGENT3DEXTPROC = ?fn (GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLTANGENT3DVEXTPROC = ?fn ([*c]const GLdouble) callconv(.C) void; pub const PFNGLTANGENT3FEXTPROC = ?fn (GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLTANGENT3FVEXTPROC = ?fn ([*c]const GLfloat) callconv(.C) void; pub const PFNGLTANGENT3IEXTPROC = ?fn (GLint, GLint, GLint) callconv(.C) void; pub const PFNGLTANGENT3IVEXTPROC = ?fn ([*c]const GLint) callconv(.C) void; pub const PFNGLTANGENT3SEXTPROC = ?fn (GLshort, GLshort, GLshort) callconv(.C) void; pub const PFNGLTANGENT3SVEXTPROC = ?fn ([*c]const GLshort) callconv(.C) void; pub const PFNGLBINORMAL3BEXTPROC = ?fn (GLbyte, GLbyte, GLbyte) callconv(.C) void; pub const PFNGLBINORMAL3BVEXTPROC = ?fn ([*c]const GLbyte) callconv(.C) void; pub const PFNGLBINORMAL3DEXTPROC = ?fn (GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLBINORMAL3DVEXTPROC = ?fn ([*c]const GLdouble) callconv(.C) void; pub const PFNGLBINORMAL3FEXTPROC = ?fn (GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLBINORMAL3FVEXTPROC = ?fn ([*c]const GLfloat) callconv(.C) void; pub const PFNGLBINORMAL3IEXTPROC = ?fn (GLint, GLint, GLint) callconv(.C) void; pub const PFNGLBINORMAL3IVEXTPROC = ?fn ([*c]const GLint) callconv(.C) void; pub const PFNGLBINORMAL3SEXTPROC = ?fn (GLshort, GLshort, GLshort) callconv(.C) void; pub const PFNGLBINORMAL3SVEXTPROC = ?fn ([*c]const GLshort) callconv(.C) void; pub const PFNGLTANGENTPOINTEREXTPROC = ?fn (GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLBINORMALPOINTEREXTPROC = ?fn (GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOPYTEXIMAGE1DEXTPROC = ?fn (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint) callconv(.C) void; pub const PFNGLCOPYTEXIMAGE2DEXTPROC = ?fn (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint) callconv(.C) void; pub const PFNGLCOPYTEXSUBIMAGE1DEXTPROC = ?fn (GLenum, GLint, GLint, GLint, GLint, GLsizei) callconv(.C) void; pub const PFNGLCOPYTEXSUBIMAGE2DEXTPROC = ?fn (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLCOPYTEXSUBIMAGE3DEXTPROC = ?fn (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLCULLPARAMETERDVEXTPROC = ?fn (GLenum, [*c]GLdouble) callconv(.C) void; pub const PFNGLCULLPARAMETERFVEXTPROC = ?fn (GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLLABELOBJECTEXTPROC = ?fn (GLenum, GLuint, GLsizei, [*c]const GLchar) callconv(.C) void; pub const PFNGLGETOBJECTLABELEXTPROC = ?fn (GLenum, GLuint, GLsizei, [*c]GLsizei, [*c]GLchar) callconv(.C) void; pub const PFNGLINSERTEVENTMARKEREXTPROC = ?fn (GLsizei, [*c]const GLchar) callconv(.C) void; pub const PFNGLPUSHGROUPMARKEREXTPROC = ?fn (GLsizei, [*c]const GLchar) callconv(.C) void; pub const PFNGLPOPGROUPMARKEREXTPROC = ?fn () callconv(.C) void; pub const PFNGLDEPTHBOUNDSEXTPROC = ?fn (GLclampd, GLclampd) callconv(.C) void; pub const PFNGLMATRIXLOADFEXTPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLMATRIXLOADDEXTPROC = ?fn (GLenum, [*c]const GLdouble) callconv(.C) void; pub const PFNGLMATRIXMULTFEXTPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLMATRIXMULTDEXTPROC = ?fn (GLenum, [*c]const GLdouble) callconv(.C) void; pub const PFNGLMATRIXLOADIDENTITYEXTPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLMATRIXROTATEFEXTPROC = ?fn (GLenum, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLMATRIXROTATEDEXTPROC = ?fn (GLenum, GLdouble, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLMATRIXSCALEFEXTPROC = ?fn (GLenum, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLMATRIXSCALEDEXTPROC = ?fn (GLenum, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLMATRIXTRANSLATEFEXTPROC = ?fn (GLenum, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLMATRIXTRANSLATEDEXTPROC = ?fn (GLenum, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLMATRIXFRUSTUMEXTPROC = ?fn (GLenum, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLMATRIXORTHOEXTPROC = ?fn (GLenum, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLMATRIXPOPEXTPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLMATRIXPUSHEXTPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLCLIENTATTRIBDEFAULTEXTPROC = ?fn (GLbitfield) callconv(.C) void; pub const PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC = ?fn (GLbitfield) callconv(.C) void; pub const PFNGLTEXTUREPARAMETERFEXTPROC = ?fn (GLuint, GLenum, GLenum, GLfloat) callconv(.C) void; pub const PFNGLTEXTUREPARAMETERFVEXTPROC = ?fn (GLuint, GLenum, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLTEXTUREPARAMETERIEXTPROC = ?fn (GLuint, GLenum, GLenum, GLint) callconv(.C) void; pub const PFNGLTEXTUREPARAMETERIVEXTPROC = ?fn (GLuint, GLenum, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLTEXTUREIMAGE1DEXTPROC = ?fn (GLuint, GLenum, GLint, GLint, GLsizei, GLint, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLTEXTUREIMAGE2DEXTPROC = ?fn (GLuint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLTEXTURESUBIMAGE1DEXTPROC = ?fn (GLuint, GLenum, GLint, GLint, GLsizei, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLTEXTURESUBIMAGE2DEXTPROC = ?fn (GLuint, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOPYTEXTUREIMAGE1DEXTPROC = ?fn (GLuint, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint) callconv(.C) void; pub const PFNGLCOPYTEXTUREIMAGE2DEXTPROC = ?fn (GLuint, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint) callconv(.C) void; pub const PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC = ?fn (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei) callconv(.C) void; pub const PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC = ?fn (GLuint, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLGETTEXTUREIMAGEEXTPROC = ?fn (GLuint, GLenum, GLint, GLenum, GLenum, ?*anyopaque) callconv(.C) void; pub const PFNGLGETTEXTUREPARAMETERFVEXTPROC = ?fn (GLuint, GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETTEXTUREPARAMETERIVEXTPROC = ?fn (GLuint, GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC = ?fn (GLuint, GLenum, GLint, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC = ?fn (GLuint, GLenum, GLint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLTEXTUREIMAGE3DEXTPROC = ?fn (GLuint, GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLTEXTURESUBIMAGE3DEXTPROC = ?fn (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC = ?fn (GLuint, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLBINDMULTITEXTUREEXTPROC = ?fn (GLenum, GLenum, GLuint) callconv(.C) void; pub const PFNGLMULTITEXCOORDPOINTEREXTPROC = ?fn (GLenum, GLint, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLMULTITEXENVFEXTPROC = ?fn (GLenum, GLenum, GLenum, GLfloat) callconv(.C) void; pub const PFNGLMULTITEXENVFVEXTPROC = ?fn (GLenum, GLenum, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLMULTITEXENVIEXTPROC = ?fn (GLenum, GLenum, GLenum, GLint) callconv(.C) void; pub const PFNGLMULTITEXENVIVEXTPROC = ?fn (GLenum, GLenum, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLMULTITEXGENDEXTPROC = ?fn (GLenum, GLenum, GLenum, GLdouble) callconv(.C) void; pub const PFNGLMULTITEXGENDVEXTPROC = ?fn (GLenum, GLenum, GLenum, [*c]const GLdouble) callconv(.C) void; pub const PFNGLMULTITEXGENFEXTPROC = ?fn (GLenum, GLenum, GLenum, GLfloat) callconv(.C) void; pub const PFNGLMULTITEXGENFVEXTPROC = ?fn (GLenum, GLenum, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLMULTITEXGENIEXTPROC = ?fn (GLenum, GLenum, GLenum, GLint) callconv(.C) void; pub const PFNGLMULTITEXGENIVEXTPROC = ?fn (GLenum, GLenum, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLGETMULTITEXENVFVEXTPROC = ?fn (GLenum, GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETMULTITEXENVIVEXTPROC = ?fn (GLenum, GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETMULTITEXGENDVEXTPROC = ?fn (GLenum, GLenum, GLenum, [*c]GLdouble) callconv(.C) void; pub const PFNGLGETMULTITEXGENFVEXTPROC = ?fn (GLenum, GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETMULTITEXGENIVEXTPROC = ?fn (GLenum, GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLMULTITEXPARAMETERIEXTPROC = ?fn (GLenum, GLenum, GLenum, GLint) callconv(.C) void; pub const PFNGLMULTITEXPARAMETERIVEXTPROC = ?fn (GLenum, GLenum, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLMULTITEXPARAMETERFEXTPROC = ?fn (GLenum, GLenum, GLenum, GLfloat) callconv(.C) void; pub const PFNGLMULTITEXPARAMETERFVEXTPROC = ?fn (GLenum, GLenum, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLMULTITEXIMAGE1DEXTPROC = ?fn (GLenum, GLenum, GLint, GLint, GLsizei, GLint, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLMULTITEXIMAGE2DEXTPROC = ?fn (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLMULTITEXSUBIMAGE1DEXTPROC = ?fn (GLenum, GLenum, GLint, GLint, GLsizei, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLMULTITEXSUBIMAGE2DEXTPROC = ?fn (GLenum, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOPYMULTITEXIMAGE1DEXTPROC = ?fn (GLenum, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint) callconv(.C) void; pub const PFNGLCOPYMULTITEXIMAGE2DEXTPROC = ?fn (GLenum, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint) callconv(.C) void; pub const PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC = ?fn (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei) callconv(.C) void; pub const PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC = ?fn (GLenum, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLGETMULTITEXIMAGEEXTPROC = ?fn (GLenum, GLenum, GLint, GLenum, GLenum, ?*anyopaque) callconv(.C) void; pub const PFNGLGETMULTITEXPARAMETERFVEXTPROC = ?fn (GLenum, GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETMULTITEXPARAMETERIVEXTPROC = ?fn (GLenum, GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC = ?fn (GLenum, GLenum, GLint, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC = ?fn (GLenum, GLenum, GLint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLMULTITEXIMAGE3DEXTPROC = ?fn (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLMULTITEXSUBIMAGE3DEXTPROC = ?fn (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC = ?fn (GLenum, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLENABLECLIENTSTATEINDEXEDEXTPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLGETFLOATINDEXEDVEXTPROC = ?fn (GLenum, GLuint, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETDOUBLEINDEXEDVEXTPROC = ?fn (GLenum, GLuint, [*c]GLdouble) callconv(.C) void; pub const PFNGLGETPOINTERINDEXEDVEXTPROC = ?fn (GLenum, GLuint, [*c]?*anyopaque) callconv(.C) void; pub const PFNGLENABLEINDEXEDEXTPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLDISABLEINDEXEDEXTPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLISENABLEDINDEXEDEXTPROC = ?fn (GLenum, GLuint) callconv(.C) GLboolean; pub const PFNGLGETINTEGERINDEXEDVEXTPROC = ?fn (GLenum, GLuint, [*c]GLint) callconv(.C) void; pub const PFNGLGETBOOLEANINDEXEDVEXTPROC = ?fn (GLenum, GLuint, [*c]GLboolean) callconv(.C) void; pub const PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC = ?fn (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC = ?fn (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC = ?fn (GLuint, GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC = ?fn (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC = ?fn (GLuint, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC = ?fn (GLuint, GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC = ?fn (GLuint, GLenum, GLint, ?*anyopaque) callconv(.C) void; pub const PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC = ?fn (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC = ?fn (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC = ?fn (GLenum, GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC = ?fn (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC = ?fn (GLenum, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC = ?fn (GLenum, GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC = ?fn (GLenum, GLenum, GLint, ?*anyopaque) callconv(.C) void; pub const PFNGLMATRIXLOADTRANSPOSEFEXTPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLMATRIXLOADTRANSPOSEDEXTPROC = ?fn (GLenum, [*c]const GLdouble) callconv(.C) void; pub const PFNGLMATRIXMULTTRANSPOSEFEXTPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLMATRIXMULTTRANSPOSEDEXTPROC = ?fn (GLenum, [*c]const GLdouble) callconv(.C) void; pub const PFNGLNAMEDBUFFERDATAEXTPROC = ?fn (GLuint, GLsizeiptr, ?*const anyopaque, GLenum) callconv(.C) void; pub const PFNGLNAMEDBUFFERSUBDATAEXTPROC = ?fn (GLuint, GLintptr, GLsizeiptr, ?*const anyopaque) callconv(.C) void; pub const PFNGLMAPNAMEDBUFFEREXTPROC = ?fn (GLuint, GLenum) callconv(.C) ?*anyopaque; pub const PFNGLUNMAPNAMEDBUFFEREXTPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETNAMEDBUFFERPOINTERVEXTPROC = ?fn (GLuint, GLenum, [*c]?*anyopaque) callconv(.C) void; pub const PFNGLGETNAMEDBUFFERSUBDATAEXTPROC = ?fn (GLuint, GLintptr, GLsizeiptr, ?*anyopaque) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1FEXTPROC = ?fn (GLuint, GLint, GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2FEXTPROC = ?fn (GLuint, GLint, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3FEXTPROC = ?fn (GLuint, GLint, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4FEXTPROC = ?fn (GLuint, GLint, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1IEXTPROC = ?fn (GLuint, GLint, GLint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2IEXTPROC = ?fn (GLuint, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3IEXTPROC = ?fn (GLuint, GLint, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4IEXTPROC = ?fn (GLuint, GLint, GLint, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1FVEXTPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2FVEXTPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3FVEXTPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4FVEXTPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1IVEXTPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2IVEXTPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3IVEXTPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4IVEXTPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLfloat) callconv(.C) void; pub const PFNGLTEXTUREBUFFEREXTPROC = ?fn (GLuint, GLenum, GLenum, GLuint) callconv(.C) void; pub const PFNGLMULTITEXBUFFEREXTPROC = ?fn (GLenum, GLenum, GLenum, GLuint) callconv(.C) void; pub const PFNGLTEXTUREPARAMETERIIVEXTPROC = ?fn (GLuint, GLenum, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLTEXTUREPARAMETERIUIVEXTPROC = ?fn (GLuint, GLenum, GLenum, [*c]const GLuint) callconv(.C) void; pub const PFNGLGETTEXTUREPARAMETERIIVEXTPROC = ?fn (GLuint, GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETTEXTUREPARAMETERIUIVEXTPROC = ?fn (GLuint, GLenum, GLenum, [*c]GLuint) callconv(.C) void; pub const PFNGLMULTITEXPARAMETERIIVEXTPROC = ?fn (GLenum, GLenum, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLMULTITEXPARAMETERIUIVEXTPROC = ?fn (GLenum, GLenum, GLenum, [*c]const GLuint) callconv(.C) void; pub const PFNGLGETMULTITEXPARAMETERIIVEXTPROC = ?fn (GLenum, GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETMULTITEXPARAMETERIUIVEXTPROC = ?fn (GLenum, GLenum, GLenum, [*c]GLuint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1UIEXTPROC = ?fn (GLuint, GLint, GLuint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2UIEXTPROC = ?fn (GLuint, GLint, GLuint, GLuint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3UIEXTPROC = ?fn (GLuint, GLint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4UIEXTPROC = ?fn (GLuint, GLint, GLuint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1UIVEXTPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2UIVEXTPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3UIVEXTPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4UIVEXTPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC = ?fn (GLuint, GLenum, GLuint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC = ?fn (GLuint, GLenum, GLuint, GLint, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC = ?fn (GLuint, GLenum, GLuint, [*c]const GLint) callconv(.C) void; pub const PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC = ?fn (GLuint, GLenum, GLuint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC = ?fn (GLuint, GLenum, GLuint, GLuint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC = ?fn (GLuint, GLenum, GLuint, [*c]const GLuint) callconv(.C) void; pub const PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC = ?fn (GLuint, GLenum, GLuint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC = ?fn (GLuint, GLenum, GLuint, [*c]GLint) callconv(.C) void; pub const PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC = ?fn (GLuint, GLenum, GLuint, [*c]GLuint) callconv(.C) void; pub const PFNGLENABLECLIENTSTATEIEXTPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLDISABLECLIENTSTATEIEXTPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLGETFLOATI_VEXTPROC = ?fn (GLenum, GLuint, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETDOUBLEI_VEXTPROC = ?fn (GLenum, GLuint, [*c]GLdouble) callconv(.C) void; pub const PFNGLGETPOINTERI_VEXTPROC = ?fn (GLenum, GLuint, [*c]?*anyopaque) callconv(.C) void; pub const PFNGLNAMEDPROGRAMSTRINGEXTPROC = ?fn (GLuint, GLenum, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC = ?fn (GLuint, GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC = ?fn (GLuint, GLenum, GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC = ?fn (GLuint, GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC = ?fn (GLuint, GLenum, GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC = ?fn (GLuint, GLenum, GLuint, [*c]GLdouble) callconv(.C) void; pub const PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC = ?fn (GLuint, GLenum, GLuint, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETNAMEDPROGRAMIVEXTPROC = ?fn (GLuint, GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETNAMEDPROGRAMSTRINGEXTPROC = ?fn (GLuint, GLenum, GLenum, ?*anyopaque) callconv(.C) void; pub const PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC = ?fn (GLuint, GLenum, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC = ?fn (GLuint, GLsizei, GLenum, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC = ?fn (GLuint, GLsizei, GLsizei, GLenum, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC = ?fn (GLuint, GLenum) callconv(.C) GLenum; pub const PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC = ?fn (GLuint, GLenum, GLenum, GLuint, GLint) callconv(.C) void; pub const PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC = ?fn (GLuint, GLenum, GLenum, GLuint, GLint) callconv(.C) void; pub const PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC = ?fn (GLuint, GLenum, GLenum, GLuint, GLint, GLint) callconv(.C) void; pub const PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC = ?fn (GLuint, GLenum, GLenum, GLuint) callconv(.C) void; pub const PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC = ?fn (GLuint, GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGENERATETEXTUREMIPMAPEXTPROC = ?fn (GLuint, GLenum) callconv(.C) void; pub const PFNGLGENERATEMULTITEXMIPMAPEXTPROC = ?fn (GLenum, GLenum) callconv(.C) void; pub const PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC = ?fn (GLuint, GLenum) callconv(.C) void; pub const PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC = ?fn (GLuint, GLsizei, [*c]const GLenum) callconv(.C) void; pub const PFNGLFRAMEBUFFERREADBUFFEREXTPROC = ?fn (GLuint, GLenum) callconv(.C) void; pub const PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC = ?fn (GLuint, GLuint, GLintptr, GLintptr, GLsizeiptr) callconv(.C) void; pub const PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC = ?fn (GLuint, GLenum, GLuint, GLint) callconv(.C) void; pub const PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC = ?fn (GLuint, GLenum, GLuint, GLint, GLint) callconv(.C) void; pub const PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC = ?fn (GLuint, GLenum, GLuint, GLint, GLenum) callconv(.C) void; pub const PFNGLTEXTURERENDERBUFFEREXTPROC = ?fn (GLuint, GLenum, GLuint) callconv(.C) void; pub const PFNGLMULTITEXRENDERBUFFEREXTPROC = ?fn (GLenum, GLenum, GLuint) callconv(.C) void; pub const PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC = ?fn (GLuint, GLuint, GLint, GLenum, GLsizei, GLintptr) callconv(.C) void; pub const PFNGLVERTEXARRAYCOLOROFFSETEXTPROC = ?fn (GLuint, GLuint, GLint, GLenum, GLsizei, GLintptr) callconv(.C) void; pub const PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC = ?fn (GLuint, GLuint, GLsizei, GLintptr) callconv(.C) void; pub const PFNGLVERTEXARRAYINDEXOFFSETEXTPROC = ?fn (GLuint, GLuint, GLenum, GLsizei, GLintptr) callconv(.C) void; pub const PFNGLVERTEXARRAYNORMALOFFSETEXTPROC = ?fn (GLuint, GLuint, GLenum, GLsizei, GLintptr) callconv(.C) void; pub const PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC = ?fn (GLuint, GLuint, GLint, GLenum, GLsizei, GLintptr) callconv(.C) void; pub const PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC = ?fn (GLuint, GLuint, GLenum, GLint, GLenum, GLsizei, GLintptr) callconv(.C) void; pub const PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC = ?fn (GLuint, GLuint, GLenum, GLsizei, GLintptr) callconv(.C) void; pub const PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC = ?fn (GLuint, GLuint, GLint, GLenum, GLsizei, GLintptr) callconv(.C) void; pub const PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC = ?fn (GLuint, GLuint, GLuint, GLint, GLenum, GLboolean, GLsizei, GLintptr) callconv(.C) void; pub const PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC = ?fn (GLuint, GLuint, GLuint, GLint, GLenum, GLsizei, GLintptr) callconv(.C) void; pub const PFNGLENABLEVERTEXARRAYEXTPROC = ?fn (GLuint, GLenum) callconv(.C) void; pub const PFNGLDISABLEVERTEXARRAYEXTPROC = ?fn (GLuint, GLenum) callconv(.C) void; pub const PFNGLENABLEVERTEXARRAYATTRIBEXTPROC = ?fn (GLuint, GLuint) callconv(.C) void; pub const PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC = ?fn (GLuint, GLuint) callconv(.C) void; pub const PFNGLGETVERTEXARRAYINTEGERVEXTPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETVERTEXARRAYPOINTERVEXTPROC = ?fn (GLuint, GLenum, [*c]?*anyopaque) callconv(.C) void; pub const PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC = ?fn (GLuint, GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC = ?fn (GLuint, GLuint, GLenum, [*c]?*anyopaque) callconv(.C) void; pub const PFNGLMAPNAMEDBUFFERRANGEEXTPROC = ?fn (GLuint, GLintptr, GLsizeiptr, GLbitfield) callconv(.C) ?*anyopaque; pub const PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC = ?fn (GLuint, GLintptr, GLsizeiptr) callconv(.C) void; pub const PFNGLNAMEDBUFFERSTORAGEEXTPROC = ?fn (GLuint, GLsizeiptr, ?*const anyopaque, GLbitfield) callconv(.C) void; pub const PFNGLCLEARNAMEDBUFFERDATAEXTPROC = ?fn (GLuint, GLenum, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC = ?fn (GLuint, GLenum, GLsizeiptr, GLsizeiptr, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC = ?fn (GLuint, GLenum, GLint) callconv(.C) void; pub const PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1DEXTPROC = ?fn (GLuint, GLint, GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2DEXTPROC = ?fn (GLuint, GLint, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3DEXTPROC = ?fn (GLuint, GLint, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4DEXTPROC = ?fn (GLuint, GLint, GLdouble, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM1DVEXTPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM2DVEXTPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM3DVEXTPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORM4DVEXTPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC = ?fn (GLuint, GLint, GLsizei, GLboolean, [*c]const GLdouble) callconv(.C) void; pub const PFNGLTEXTUREBUFFERRANGEEXTPROC = ?fn (GLuint, GLenum, GLenum, GLuint, GLintptr, GLsizeiptr) callconv(.C) void; pub const PFNGLTEXTURESTORAGE1DEXTPROC = ?fn (GLuint, GLenum, GLsizei, GLenum, GLsizei) callconv(.C) void; pub const PFNGLTEXTURESTORAGE2DEXTPROC = ?fn (GLuint, GLenum, GLsizei, GLenum, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLTEXTURESTORAGE3DEXTPROC = ?fn (GLuint, GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC = ?fn (GLuint, GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLboolean) callconv(.C) void; pub const PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC = ?fn (GLuint, GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLsizei, GLboolean) callconv(.C) void; pub const PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC = ?fn (GLuint, GLuint, GLuint, GLintptr, GLsizei) callconv(.C) void; pub const PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC = ?fn (GLuint, GLuint, GLint, GLenum, GLboolean, GLuint) callconv(.C) void; pub const PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC = ?fn (GLuint, GLuint, GLint, GLenum, GLuint) callconv(.C) void; pub const PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC = ?fn (GLuint, GLuint, GLint, GLenum, GLuint) callconv(.C) void; pub const PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC = ?fn (GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC = ?fn (GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC = ?fn (GLuint, GLuint, GLuint, GLint, GLenum, GLsizei, GLintptr) callconv(.C) void; pub const PFNGLTEXTUREPAGECOMMITMENTEXTPROC = ?fn (GLuint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLboolean) callconv(.C) void; pub const PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC = ?fn (GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLCOLORMASKINDEXEDEXTPROC = ?fn (GLuint, GLboolean, GLboolean, GLboolean, GLboolean) callconv(.C) void; pub const PFNGLDRAWARRAYSINSTANCEDEXTPROC = ?fn (GLenum, GLint, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLDRAWELEMENTSINSTANCEDEXTPROC = ?fn (GLenum, GLsizei, GLenum, ?*const anyopaque, GLsizei) callconv(.C) void; pub const PFNGLDRAWRANGEELEMENTSEXTPROC = ?fn (GLenum, GLuint, GLuint, GLsizei, GLenum, ?*const anyopaque) callconv(.C) void; pub const GLeglClientBufferEXT = ?*anyopaque; pub const PFNGLBUFFERSTORAGEEXTERNALEXTPROC = ?fn (GLenum, GLintptr, GLsizeiptr, GLeglClientBufferEXT, GLbitfield) callconv(.C) void; pub const PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC = ?fn (GLuint, GLintptr, GLsizeiptr, GLeglClientBufferEXT, GLbitfield) callconv(.C) void; pub const PFNGLFOGCOORDFEXTPROC = ?fn (GLfloat) callconv(.C) void; pub const PFNGLFOGCOORDFVEXTPROC = ?fn ([*c]const GLfloat) callconv(.C) void; pub const PFNGLFOGCOORDDEXTPROC = ?fn (GLdouble) callconv(.C) void; pub const PFNGLFOGCOORDDVEXTPROC = ?fn ([*c]const GLdouble) callconv(.C) void; pub const PFNGLFOGCOORDPOINTEREXTPROC = ?fn (GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLBLITFRAMEBUFFEREXTPROC = ?fn (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum) callconv(.C) void; pub const PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC = ?fn (GLenum, GLsizei, GLenum, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLISRENDERBUFFEREXTPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLBINDRENDERBUFFEREXTPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLDELETERENDERBUFFERSEXTPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLGENRENDERBUFFERSEXTPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLRENDERBUFFERSTORAGEEXTPROC = ?fn (GLenum, GLenum, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLISFRAMEBUFFEREXTPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLBINDFRAMEBUFFEREXTPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLDELETEFRAMEBUFFERSEXTPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLGENFRAMEBUFFERSEXTPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC = ?fn (GLenum) callconv(.C) GLenum; pub const PFNGLFRAMEBUFFERTEXTURE1DEXTPROC = ?fn (GLenum, GLenum, GLenum, GLuint, GLint) callconv(.C) void; pub const PFNGLFRAMEBUFFERTEXTURE2DEXTPROC = ?fn (GLenum, GLenum, GLenum, GLuint, GLint) callconv(.C) void; pub const PFNGLFRAMEBUFFERTEXTURE3DEXTPROC = ?fn (GLenum, GLenum, GLenum, GLuint, GLint, GLint) callconv(.C) void; pub const PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC = ?fn (GLenum, GLenum, GLenum, GLuint) callconv(.C) void; pub const PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC = ?fn (GLenum, GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGENERATEMIPMAPEXTPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLPROGRAMPARAMETERIEXTPROC = ?fn (GLuint, GLenum, GLint) callconv(.C) void; pub const PFNGLPROGRAMENVPARAMETERS4FVEXTPROC = ?fn (GLenum, GLuint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC = ?fn (GLenum, GLuint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLGETUNIFORMUIVEXTPROC = ?fn (GLuint, GLint, [*c]GLuint) callconv(.C) void; pub const PFNGLBINDFRAGDATALOCATIONEXTPROC = ?fn (GLuint, GLuint, [*c]const GLchar) callconv(.C) void; pub const PFNGLGETFRAGDATALOCATIONEXTPROC = ?fn (GLuint, [*c]const GLchar) callconv(.C) GLint; pub const PFNGLUNIFORM1UIEXTPROC = ?fn (GLint, GLuint) callconv(.C) void; pub const PFNGLUNIFORM2UIEXTPROC = ?fn (GLint, GLuint, GLuint) callconv(.C) void; pub const PFNGLUNIFORM3UIEXTPROC = ?fn (GLint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLUNIFORM4UIEXTPROC = ?fn (GLint, GLuint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLUNIFORM1UIVEXTPROC = ?fn (GLint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLUNIFORM2UIVEXTPROC = ?fn (GLint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLUNIFORM3UIVEXTPROC = ?fn (GLint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLUNIFORM4UIVEXTPROC = ?fn (GLint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLGETHISTOGRAMEXTPROC = ?fn (GLenum, GLboolean, GLenum, GLenum, ?*anyopaque) callconv(.C) void; pub const PFNGLGETHISTOGRAMPARAMETERFVEXTPROC = ?fn (GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETHISTOGRAMPARAMETERIVEXTPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETMINMAXEXTPROC = ?fn (GLenum, GLboolean, GLenum, GLenum, ?*anyopaque) callconv(.C) void; pub const PFNGLGETMINMAXPARAMETERFVEXTPROC = ?fn (GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETMINMAXPARAMETERIVEXTPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLHISTOGRAMEXTPROC = ?fn (GLenum, GLsizei, GLenum, GLboolean) callconv(.C) void; pub const PFNGLMINMAXEXTPROC = ?fn (GLenum, GLenum, GLboolean) callconv(.C) void; pub const PFNGLRESETHISTOGRAMEXTPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLRESETMINMAXEXTPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLINDEXFUNCEXTPROC = ?fn (GLenum, GLclampf) callconv(.C) void; pub const PFNGLINDEXMATERIALEXTPROC = ?fn (GLenum, GLenum) callconv(.C) void; pub const PFNGLAPPLYTEXTUREEXTPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLTEXTURELIGHTEXTPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLTEXTUREMATERIALEXTPROC = ?fn (GLenum, GLenum) callconv(.C) void; pub const PFNGLGETUNSIGNEDBYTEVEXTPROC = ?fn (GLenum, [*c]GLubyte) callconv(.C) void; pub const PFNGLGETUNSIGNEDBYTEI_VEXTPROC = ?fn (GLenum, GLuint, [*c]GLubyte) callconv(.C) void; pub const PFNGLDELETEMEMORYOBJECTSEXTPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLISMEMORYOBJECTEXTPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLCREATEMEMORYOBJECTSEXTPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLMEMORYOBJECTPARAMETERIVEXTPROC = ?fn (GLuint, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLTEXSTORAGEMEM2DEXTPROC = ?fn (GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLuint, GLuint64) callconv(.C) void; pub const PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC = ?fn (GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLboolean, GLuint, GLuint64) callconv(.C) void; pub const PFNGLTEXSTORAGEMEM3DEXTPROC = ?fn (GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLsizei, GLuint, GLuint64) callconv(.C) void; pub const PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC = ?fn (GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLsizei, GLboolean, GLuint, GLuint64) callconv(.C) void; pub const PFNGLBUFFERSTORAGEMEMEXTPROC = ?fn (GLenum, GLsizeiptr, GLuint, GLuint64) callconv(.C) void; pub const PFNGLTEXTURESTORAGEMEM2DEXTPROC = ?fn (GLuint, GLsizei, GLenum, GLsizei, GLsizei, GLuint, GLuint64) callconv(.C) void; pub const PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC = ?fn (GLuint, GLsizei, GLenum, GLsizei, GLsizei, GLboolean, GLuint, GLuint64) callconv(.C) void; pub const PFNGLTEXTURESTORAGEMEM3DEXTPROC = ?fn (GLuint, GLsizei, GLenum, GLsizei, GLsizei, GLsizei, GLuint, GLuint64) callconv(.C) void; pub const PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC = ?fn (GLuint, GLsizei, GLenum, GLsizei, GLsizei, GLsizei, GLboolean, GLuint, GLuint64) callconv(.C) void; pub const PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC = ?fn (GLuint, GLsizeiptr, GLuint, GLuint64) callconv(.C) void; pub const PFNGLTEXSTORAGEMEM1DEXTPROC = ?fn (GLenum, GLsizei, GLenum, GLsizei, GLuint, GLuint64) callconv(.C) void; pub const PFNGLTEXTURESTORAGEMEM1DEXTPROC = ?fn (GLuint, GLsizei, GLenum, GLsizei, GLuint, GLuint64) callconv(.C) void; pub const PFNGLIMPORTMEMORYFDEXTPROC = ?fn (GLuint, GLuint64, GLenum, GLint) callconv(.C) void; pub const PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC = ?fn (GLuint, GLuint64, GLenum, ?*anyopaque) callconv(.C) void; pub const PFNGLIMPORTMEMORYWIN32NAMEEXTPROC = ?fn (GLuint, GLuint64, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLMULTIDRAWARRAYSEXTPROC = ?fn (GLenum, [*c]const GLint, [*c]const GLsizei, GLsizei) callconv(.C) void; pub const PFNGLMULTIDRAWELEMENTSEXTPROC = ?fn (GLenum, [*c]const GLsizei, GLenum, [*c]const ?*const anyopaque, GLsizei) callconv(.C) void; pub const PFNGLSAMPLEMASKEXTPROC = ?fn (GLclampf, GLboolean) callconv(.C) void; pub const PFNGLSAMPLEPATTERNEXTPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLCOLORTABLEEXTPROC = ?fn (GLenum, GLenum, GLsizei, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLGETCOLORTABLEEXTPROC = ?fn (GLenum, GLenum, GLenum, ?*anyopaque) callconv(.C) void; pub const PFNGLGETCOLORTABLEPARAMETERIVEXTPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETCOLORTABLEPARAMETERFVEXTPROC = ?fn (GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLPIXELTRANSFORMPARAMETERIEXTPROC = ?fn (GLenum, GLenum, GLint) callconv(.C) void; pub const PFNGLPIXELTRANSFORMPARAMETERFEXTPROC = ?fn (GLenum, GLenum, GLfloat) callconv(.C) void; pub const PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC = ?fn (GLenum, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC = ?fn (GLenum, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC = ?fn (GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLPOINTPARAMETERFEXTPROC = ?fn (GLenum, GLfloat) callconv(.C) void; pub const PFNGLPOINTPARAMETERFVEXTPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPOLYGONOFFSETEXTPROC = ?fn (GLfloat, GLfloat) callconv(.C) void; pub const PFNGLPOLYGONOFFSETCLAMPEXTPROC = ?fn (GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLPROVOKINGVERTEXEXTPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLRASTERSAMPLESEXTPROC = ?fn (GLuint, GLboolean) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3BEXTPROC = ?fn (GLbyte, GLbyte, GLbyte) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3BVEXTPROC = ?fn ([*c]const GLbyte) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3DEXTPROC = ?fn (GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3DVEXTPROC = ?fn ([*c]const GLdouble) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3FEXTPROC = ?fn (GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3FVEXTPROC = ?fn ([*c]const GLfloat) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3IEXTPROC = ?fn (GLint, GLint, GLint) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3IVEXTPROC = ?fn ([*c]const GLint) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3SEXTPROC = ?fn (GLshort, GLshort, GLshort) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3SVEXTPROC = ?fn ([*c]const GLshort) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3UBEXTPROC = ?fn (GLubyte, GLubyte, GLubyte) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3UBVEXTPROC = ?fn ([*c]const GLubyte) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3UIEXTPROC = ?fn (GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3UIVEXTPROC = ?fn ([*c]const GLuint) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3USEXTPROC = ?fn (GLushort, GLushort, GLushort) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3USVEXTPROC = ?fn ([*c]const GLushort) callconv(.C) void; pub const PFNGLSECONDARYCOLORPOINTEREXTPROC = ?fn (GLint, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLGENSEMAPHORESEXTPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLDELETESEMAPHORESEXTPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLISSEMAPHOREEXTPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLSEMAPHOREPARAMETERUI64VEXTPROC = ?fn (GLuint, GLenum, [*c]const GLuint64) callconv(.C) void; pub const PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC = ?fn (GLuint, GLenum, [*c]GLuint64) callconv(.C) void; pub const PFNGLWAITSEMAPHOREEXTPROC = ?fn (GLuint, GLuint, [*c]const GLuint, GLuint, [*c]const GLuint, [*c]const GLenum) callconv(.C) void; pub const PFNGLSIGNALSEMAPHOREEXTPROC = ?fn (GLuint, GLuint, [*c]const GLuint, GLuint, [*c]const GLuint, [*c]const GLenum) callconv(.C) void; pub const PFNGLIMPORTSEMAPHOREFDEXTPROC = ?fn (GLuint, GLenum, GLint) callconv(.C) void; pub const PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC = ?fn (GLuint, GLenum, ?*anyopaque) callconv(.C) void; pub const PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC = ?fn (GLuint, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLUSESHADERPROGRAMEXTPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLACTIVEPROGRAMEXTPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLCREATESHADERPROGRAMEXTPROC = ?fn (GLenum, [*c]const GLchar) callconv(.C) GLuint; pub const PFNGLFRAMEBUFFERFETCHBARRIEREXTPROC = ?fn () callconv(.C) void; pub const PFNGLBINDIMAGETEXTUREEXTPROC = ?fn (GLuint, GLuint, GLint, GLboolean, GLint, GLenum, GLint) callconv(.C) void; pub const PFNGLMEMORYBARRIEREXTPROC = ?fn (GLbitfield) callconv(.C) void; pub const PFNGLSTENCILCLEARTAGEXTPROC = ?fn (GLsizei, GLuint) callconv(.C) void; pub const PFNGLACTIVESTENCILFACEEXTPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLTEXSUBIMAGE1DEXTPROC = ?fn (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLTEXSUBIMAGE2DEXTPROC = ?fn (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLTEXIMAGE3DEXTPROC = ?fn (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLTEXSUBIMAGE3DEXTPROC = ?fn (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC = ?fn (GLenum, GLenum, GLuint, GLint, GLint) callconv(.C) void; pub const PFNGLTEXBUFFEREXTPROC = ?fn (GLenum, GLenum, GLuint) callconv(.C) void; pub const PFNGLTEXPARAMETERIIVEXTPROC = ?fn (GLenum, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLTEXPARAMETERIUIVEXTPROC = ?fn (GLenum, GLenum, [*c]const GLuint) callconv(.C) void; pub const PFNGLGETTEXPARAMETERIIVEXTPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETTEXPARAMETERIUIVEXTPROC = ?fn (GLenum, GLenum, [*c]GLuint) callconv(.C) void; pub const PFNGLCLEARCOLORIIEXTPROC = ?fn (GLint, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLCLEARCOLORIUIEXTPROC = ?fn (GLuint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLARETEXTURESRESIDENTEXTPROC = ?fn (GLsizei, [*c]const GLuint, [*c]GLboolean) callconv(.C) GLboolean; pub const PFNGLBINDTEXTUREEXTPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLDELETETEXTURESEXTPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLGENTEXTURESEXTPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLISTEXTUREEXTPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLPRIORITIZETEXTURESEXTPROC = ?fn (GLsizei, [*c]const GLuint, [*c]const GLclampf) callconv(.C) void; pub const PFNGLTEXTURENORMALEXTPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLGETQUERYOBJECTI64VEXTPROC = ?fn (GLuint, GLenum, [*c]GLint64) callconv(.C) void; pub const PFNGLGETQUERYOBJECTUI64VEXTPROC = ?fn (GLuint, GLenum, [*c]GLuint64) callconv(.C) void; pub const PFNGLBEGINTRANSFORMFEEDBACKEXTPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLENDTRANSFORMFEEDBACKEXTPROC = ?fn () callconv(.C) void; pub const PFNGLBINDBUFFERRANGEEXTPROC = ?fn (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr) callconv(.C) void; pub const PFNGLBINDBUFFEROFFSETEXTPROC = ?fn (GLenum, GLuint, GLuint, GLintptr) callconv(.C) void; pub const PFNGLBINDBUFFERBASEEXTPROC = ?fn (GLenum, GLuint, GLuint) callconv(.C) void; pub const PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC = ?fn (GLuint, GLsizei, [*c]const [*c]const GLchar, GLenum) callconv(.C) void; pub const PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC = ?fn (GLuint, GLuint, GLsizei, [*c]GLsizei, [*c]GLsizei, [*c]GLenum, [*c]GLchar) callconv(.C) void; pub const PFNGLARRAYELEMENTEXTPROC = ?fn (GLint) callconv(.C) void; pub const PFNGLCOLORPOINTEREXTPROC = ?fn (GLint, GLenum, GLsizei, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLDRAWARRAYSEXTPROC = ?fn (GLenum, GLint, GLsizei) callconv(.C) void; pub const PFNGLEDGEFLAGPOINTEREXTPROC = ?fn (GLsizei, GLsizei, [*c]const GLboolean) callconv(.C) void; pub const PFNGLGETPOINTERVEXTPROC = ?fn (GLenum, [*c]?*anyopaque) callconv(.C) void; pub const PFNGLINDEXPOINTEREXTPROC = ?fn (GLenum, GLsizei, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLNORMALPOINTEREXTPROC = ?fn (GLenum, GLsizei, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLTEXCOORDPOINTEREXTPROC = ?fn (GLint, GLenum, GLsizei, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLVERTEXPOINTEREXTPROC = ?fn (GLint, GLenum, GLsizei, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLVERTEXATTRIBL1DEXTPROC = ?fn (GLuint, GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIBL2DEXTPROC = ?fn (GLuint, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIBL3DEXTPROC = ?fn (GLuint, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIBL4DEXTPROC = ?fn (GLuint, GLdouble, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIBL1DVEXTPROC = ?fn (GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIBL2DVEXTPROC = ?fn (GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIBL3DVEXTPROC = ?fn (GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIBL4DVEXTPROC = ?fn (GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIBLPOINTEREXTPROC = ?fn (GLuint, GLint, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBLDVEXTPROC = ?fn (GLuint, GLenum, [*c]GLdouble) callconv(.C) void; pub const PFNGLBEGINVERTEXSHADEREXTPROC = ?fn () callconv(.C) void; pub const PFNGLENDVERTEXSHADEREXTPROC = ?fn () callconv(.C) void; pub const PFNGLBINDVERTEXSHADEREXTPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLGENVERTEXSHADERSEXTPROC = ?fn (GLuint) callconv(.C) GLuint; pub const PFNGLDELETEVERTEXSHADEREXTPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLSHADEROP1EXTPROC = ?fn (GLenum, GLuint, GLuint) callconv(.C) void; pub const PFNGLSHADEROP2EXTPROC = ?fn (GLenum, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLSHADEROP3EXTPROC = ?fn (GLenum, GLuint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLSWIZZLEEXTPROC = ?fn (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum) callconv(.C) void; pub const PFNGLWRITEMASKEXTPROC = ?fn (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum) callconv(.C) void; pub const PFNGLINSERTCOMPONENTEXTPROC = ?fn (GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLEXTRACTCOMPONENTEXTPROC = ?fn (GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLGENSYMBOLSEXTPROC = ?fn (GLenum, GLenum, GLenum, GLuint) callconv(.C) GLuint; pub const PFNGLSETINVARIANTEXTPROC = ?fn (GLuint, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLSETLOCALCONSTANTEXTPROC = ?fn (GLuint, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLVARIANTBVEXTPROC = ?fn (GLuint, [*c]const GLbyte) callconv(.C) void; pub const PFNGLVARIANTSVEXTPROC = ?fn (GLuint, [*c]const GLshort) callconv(.C) void; pub const PFNGLVARIANTIVEXTPROC = ?fn (GLuint, [*c]const GLint) callconv(.C) void; pub const PFNGLVARIANTFVEXTPROC = ?fn (GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVARIANTDVEXTPROC = ?fn (GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVARIANTUBVEXTPROC = ?fn (GLuint, [*c]const GLubyte) callconv(.C) void; pub const PFNGLVARIANTUSVEXTPROC = ?fn (GLuint, [*c]const GLushort) callconv(.C) void; pub const PFNGLVARIANTUIVEXTPROC = ?fn (GLuint, [*c]const GLuint) callconv(.C) void; pub const PFNGLVARIANTPOINTEREXTPROC = ?fn (GLuint, GLenum, GLuint, ?*const anyopaque) callconv(.C) void; pub const PFNGLENABLEVARIANTCLIENTSTATEEXTPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLBINDLIGHTPARAMETEREXTPROC = ?fn (GLenum, GLenum) callconv(.C) GLuint; pub const PFNGLBINDMATERIALPARAMETEREXTPROC = ?fn (GLenum, GLenum) callconv(.C) GLuint; pub const PFNGLBINDTEXGENPARAMETEREXTPROC = ?fn (GLenum, GLenum, GLenum) callconv(.C) GLuint; pub const PFNGLBINDTEXTUREUNITPARAMETEREXTPROC = ?fn (GLenum, GLenum) callconv(.C) GLuint; pub const PFNGLBINDPARAMETEREXTPROC = ?fn (GLenum) callconv(.C) GLuint; pub const PFNGLISVARIANTENABLEDEXTPROC = ?fn (GLuint, GLenum) callconv(.C) GLboolean; pub const PFNGLGETVARIANTBOOLEANVEXTPROC = ?fn (GLuint, GLenum, [*c]GLboolean) callconv(.C) void; pub const PFNGLGETVARIANTINTEGERVEXTPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETVARIANTFLOATVEXTPROC = ?fn (GLuint, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETVARIANTPOINTERVEXTPROC = ?fn (GLuint, GLenum, [*c]?*anyopaque) callconv(.C) void; pub const PFNGLGETINVARIANTBOOLEANVEXTPROC = ?fn (GLuint, GLenum, [*c]GLboolean) callconv(.C) void; pub const PFNGLGETINVARIANTINTEGERVEXTPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETINVARIANTFLOATVEXTPROC = ?fn (GLuint, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC = ?fn (GLuint, GLenum, [*c]GLboolean) callconv(.C) void; pub const PFNGLGETLOCALCONSTANTINTEGERVEXTPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETLOCALCONSTANTFLOATVEXTPROC = ?fn (GLuint, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLVERTEXWEIGHTFEXTPROC = ?fn (GLfloat) callconv(.C) void; pub const PFNGLVERTEXWEIGHTFVEXTPROC = ?fn ([*c]const GLfloat) callconv(.C) void; pub const PFNGLVERTEXWEIGHTPOINTEREXTPROC = ?fn (GLint, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC = ?fn (GLuint, GLuint64, GLuint) callconv(.C) GLboolean; pub const PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC = ?fn (GLuint, GLuint64) callconv(.C) GLboolean; pub const PFNGLWINDOWRECTANGLESEXTPROC = ?fn (GLenum, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLIMPORTSYNCEXTPROC = ?fn (GLenum, GLintptr, GLbitfield) callconv(.C) GLsync; pub const PFNGLFRAMETERMINATORGREMEDYPROC = ?fn () callconv(.C) void; pub const PFNGLSTRINGMARKERGREMEDYPROC = ?fn (GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLIMAGETRANSFORMPARAMETERIHPPROC = ?fn (GLenum, GLenum, GLint) callconv(.C) void; pub const PFNGLIMAGETRANSFORMPARAMETERFHPPROC = ?fn (GLenum, GLenum, GLfloat) callconv(.C) void; pub const PFNGLIMAGETRANSFORMPARAMETERIVHPPROC = ?fn (GLenum, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLIMAGETRANSFORMPARAMETERFVHPPROC = ?fn (GLenum, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC = ?fn (GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLMULTIMODEDRAWARRAYSIBMPROC = ?fn ([*c]const GLenum, [*c]const GLint, [*c]const GLsizei, GLsizei, GLint) callconv(.C) void; pub const PFNGLMULTIMODEDRAWELEMENTSIBMPROC = ?fn ([*c]const GLenum, [*c]const GLsizei, GLenum, [*c]const ?*const anyopaque, GLsizei, GLint) callconv(.C) void; pub const PFNGLFLUSHSTATICDATAIBMPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLCOLORPOINTERLISTIBMPROC = ?fn (GLint, GLenum, GLint, [*c]?*const anyopaque, GLint) callconv(.C) void; pub const PFNGLSECONDARYCOLORPOINTERLISTIBMPROC = ?fn (GLint, GLenum, GLint, [*c]?*const anyopaque, GLint) callconv(.C) void; pub const PFNGLEDGEFLAGPOINTERLISTIBMPROC = ?fn (GLint, [*c][*c]const GLboolean, GLint) callconv(.C) void; pub const PFNGLFOGCOORDPOINTERLISTIBMPROC = ?fn (GLenum, GLint, [*c]?*const anyopaque, GLint) callconv(.C) void; pub const PFNGLINDEXPOINTERLISTIBMPROC = ?fn (GLenum, GLint, [*c]?*const anyopaque, GLint) callconv(.C) void; pub const PFNGLNORMALPOINTERLISTIBMPROC = ?fn (GLenum, GLint, [*c]?*const anyopaque, GLint) callconv(.C) void; pub const PFNGLTEXCOORDPOINTERLISTIBMPROC = ?fn (GLint, GLenum, GLint, [*c]?*const anyopaque, GLint) callconv(.C) void; pub const PFNGLVERTEXPOINTERLISTIBMPROC = ?fn (GLint, GLenum, GLint, [*c]?*const anyopaque, GLint) callconv(.C) void; pub const PFNGLBLENDFUNCSEPARATEINGRPROC = ?fn (GLenum, GLenum, GLenum, GLenum) callconv(.C) void; pub const PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC = ?fn () callconv(.C) void; pub const PFNGLSYNCTEXTUREINTELPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLUNMAPTEXTURE2DINTELPROC = ?fn (GLuint, GLint) callconv(.C) void; pub const PFNGLMAPTEXTURE2DINTELPROC = ?fn (GLuint, GLint, GLbitfield, [*c]GLint, [*c]GLenum) callconv(.C) ?*anyopaque; pub const PFNGLVERTEXPOINTERVINTELPROC = ?fn (GLint, GLenum, [*c]?*const anyopaque) callconv(.C) void; pub const PFNGLNORMALPOINTERVINTELPROC = ?fn (GLenum, [*c]?*const anyopaque) callconv(.C) void; pub const PFNGLCOLORPOINTERVINTELPROC = ?fn (GLint, GLenum, [*c]?*const anyopaque) callconv(.C) void; pub const PFNGLTEXCOORDPOINTERVINTELPROC = ?fn (GLint, GLenum, [*c]?*const anyopaque) callconv(.C) void; pub const PFNGLBEGINPERFQUERYINTELPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLCREATEPERFQUERYINTELPROC = ?fn (GLuint, [*c]GLuint) callconv(.C) void; pub const PFNGLDELETEPERFQUERYINTELPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLENDPERFQUERYINTELPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLGETFIRSTPERFQUERYIDINTELPROC = ?fn ([*c]GLuint) callconv(.C) void; pub const PFNGLGETNEXTPERFQUERYIDINTELPROC = ?fn (GLuint, [*c]GLuint) callconv(.C) void; pub const PFNGLGETPERFCOUNTERINFOINTELPROC = ?fn (GLuint, GLuint, GLuint, [*c]GLchar, GLuint, [*c]GLchar, [*c]GLuint, [*c]GLuint, [*c]GLuint, [*c]GLuint, [*c]GLuint64) callconv(.C) void; pub const PFNGLGETPERFQUERYDATAINTELPROC = ?fn (GLuint, GLuint, GLsizei, ?*anyopaque, [*c]GLuint) callconv(.C) void; pub const PFNGLGETPERFQUERYIDBYNAMEINTELPROC = ?fn ([*c]GLchar, [*c]GLuint) callconv(.C) void; pub const PFNGLGETPERFQUERYINFOINTELPROC = ?fn (GLuint, GLuint, [*c]GLchar, [*c]GLuint, [*c]GLuint, [*c]GLuint, [*c]GLuint) callconv(.C) void; pub const PFNGLFRAMEBUFFERPARAMETERIMESAPROC = ?fn (GLenum, GLenum, GLint) callconv(.C) void; pub const PFNGLGETFRAMEBUFFERPARAMETERIVMESAPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLRESIZEBUFFERSMESAPROC = ?fn () callconv(.C) void; pub const PFNGLWINDOWPOS2DMESAPROC = ?fn (GLdouble, GLdouble) callconv(.C) void; pub const PFNGLWINDOWPOS2DVMESAPROC = ?fn ([*c]const GLdouble) callconv(.C) void; pub const PFNGLWINDOWPOS2FMESAPROC = ?fn (GLfloat, GLfloat) callconv(.C) void; pub const PFNGLWINDOWPOS2FVMESAPROC = ?fn ([*c]const GLfloat) callconv(.C) void; pub const PFNGLWINDOWPOS2IMESAPROC = ?fn (GLint, GLint) callconv(.C) void; pub const PFNGLWINDOWPOS2IVMESAPROC = ?fn ([*c]const GLint) callconv(.C) void; pub const PFNGLWINDOWPOS2SMESAPROC = ?fn (GLshort, GLshort) callconv(.C) void; pub const PFNGLWINDOWPOS2SVMESAPROC = ?fn ([*c]const GLshort) callconv(.C) void; pub const PFNGLWINDOWPOS3DMESAPROC = ?fn (GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLWINDOWPOS3DVMESAPROC = ?fn ([*c]const GLdouble) callconv(.C) void; pub const PFNGLWINDOWPOS3FMESAPROC = ?fn (GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLWINDOWPOS3FVMESAPROC = ?fn ([*c]const GLfloat) callconv(.C) void; pub const PFNGLWINDOWPOS3IMESAPROC = ?fn (GLint, GLint, GLint) callconv(.C) void; pub const PFNGLWINDOWPOS3IVMESAPROC = ?fn ([*c]const GLint) callconv(.C) void; pub const PFNGLWINDOWPOS3SMESAPROC = ?fn (GLshort, GLshort, GLshort) callconv(.C) void; pub const PFNGLWINDOWPOS3SVMESAPROC = ?fn ([*c]const GLshort) callconv(.C) void; pub const PFNGLWINDOWPOS4DMESAPROC = ?fn (GLdouble, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLWINDOWPOS4DVMESAPROC = ?fn ([*c]const GLdouble) callconv(.C) void; pub const PFNGLWINDOWPOS4FMESAPROC = ?fn (GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLWINDOWPOS4FVMESAPROC = ?fn ([*c]const GLfloat) callconv(.C) void; pub const PFNGLWINDOWPOS4IMESAPROC = ?fn (GLint, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLWINDOWPOS4IVMESAPROC = ?fn ([*c]const GLint) callconv(.C) void; pub const PFNGLWINDOWPOS4SMESAPROC = ?fn (GLshort, GLshort, GLshort, GLshort) callconv(.C) void; pub const PFNGLWINDOWPOS4SVMESAPROC = ?fn ([*c]const GLshort) callconv(.C) void; pub const PFNGLBEGINCONDITIONALRENDERNVXPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLENDCONDITIONALRENDERNVXPROC = ?fn () callconv(.C) void; pub const PFNGLUPLOADGPUMASKNVXPROC = ?fn (GLbitfield) callconv(.C) void; pub const PFNGLMULTICASTVIEWPORTARRAYVNVXPROC = ?fn (GLuint, GLuint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLMULTICASTVIEWPORTPOSITIONWSCALENVXPROC = ?fn (GLuint, GLuint, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLMULTICASTSCISSORARRAYVNVXPROC = ?fn (GLuint, GLuint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLASYNCCOPYBUFFERSUBDATANVXPROC = ?fn (GLsizei, [*c]const GLuint, [*c]const GLuint64, GLuint, GLbitfield, GLuint, GLuint, GLintptr, GLintptr, GLsizeiptr, GLsizei, [*c]const GLuint, [*c]const GLuint64) callconv(.C) GLuint; pub const PFNGLASYNCCOPYIMAGESUBDATANVXPROC = ?fn (GLsizei, [*c]const GLuint, [*c]const GLuint64, GLuint, GLbitfield, GLuint, GLenum, GLint, GLint, GLint, GLint, GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, [*c]const GLuint, [*c]const GLuint64) callconv(.C) GLuint; pub const PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC = ?fn (GLbitfield, GLuint, GLintptr, GLsizeiptr, ?*const anyopaque) callconv(.C) void; pub const PFNGLLGPUCOPYIMAGESUBDATANVXPROC = ?fn (GLuint, GLbitfield, GLuint, GLenum, GLint, GLint, GLint, GLint, GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLLGPUINTERLOCKNVXPROC = ?fn () callconv(.C) void; pub const PFNGLCREATEPROGRESSFENCENVXPROC = ?fn () callconv(.C) GLuint; pub const PFNGLSIGNALSEMAPHOREUI64NVXPROC = ?fn (GLuint, GLsizei, [*c]const GLuint, [*c]const GLuint64) callconv(.C) void; pub const PFNGLWAITSEMAPHOREUI64NVXPROC = ?fn (GLuint, GLsizei, [*c]const GLuint, [*c]const GLuint64) callconv(.C) void; pub const PFNGLCLIENTWAITSEMAPHOREUI64NVXPROC = ?fn (GLsizei, [*c]const GLuint, [*c]const GLuint64) callconv(.C) void; pub const PFNGLALPHATOCOVERAGEDITHERCONTROLNVPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC = ?fn (GLenum, ?*const anyopaque, GLsizei, GLsizei, GLint) callconv(.C) void; pub const PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC = ?fn (GLenum, GLenum, ?*const anyopaque, GLsizei, GLsizei, GLint) callconv(.C) void; pub const PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC = ?fn (GLenum, ?*const anyopaque, GLsizei, GLsizei, GLsizei, GLint) callconv(.C) void; pub const PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC = ?fn (GLenum, GLenum, ?*const anyopaque, GLsizei, GLsizei, GLsizei, GLint) callconv(.C) void; pub const PFNGLGETTEXTUREHANDLENVPROC = ?fn (GLuint) callconv(.C) GLuint64; pub const PFNGLGETTEXTURESAMPLERHANDLENVPROC = ?fn (GLuint, GLuint) callconv(.C) GLuint64; pub const PFNGLMAKETEXTUREHANDLERESIDENTNVPROC = ?fn (GLuint64) callconv(.C) void; pub const PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC = ?fn (GLuint64) callconv(.C) void; pub const PFNGLGETIMAGEHANDLENVPROC = ?fn (GLuint, GLint, GLboolean, GLint, GLenum) callconv(.C) GLuint64; pub const PFNGLMAKEIMAGEHANDLERESIDENTNVPROC = ?fn (GLuint64, GLenum) callconv(.C) void; pub const PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC = ?fn (GLuint64) callconv(.C) void; pub const PFNGLUNIFORMHANDLEUI64NVPROC = ?fn (GLint, GLuint64) callconv(.C) void; pub const PFNGLUNIFORMHANDLEUI64VNVPROC = ?fn (GLint, GLsizei, [*c]const GLuint64) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC = ?fn (GLuint, GLint, GLuint64) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLuint64) callconv(.C) void; pub const PFNGLISTEXTUREHANDLERESIDENTNVPROC = ?fn (GLuint64) callconv(.C) GLboolean; pub const PFNGLISIMAGEHANDLERESIDENTNVPROC = ?fn (GLuint64) callconv(.C) GLboolean; pub const PFNGLBLENDPARAMETERINVPROC = ?fn (GLenum, GLint) callconv(.C) void; pub const PFNGLBLENDBARRIERNVPROC = ?fn () callconv(.C) void; pub const PFNGLVIEWPORTPOSITIONWSCALENVPROC = ?fn (GLuint, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLCREATESTATESNVPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLDELETESTATESNVPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLISSTATENVPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLSTATECAPTURENVPROC = ?fn (GLuint, GLenum) callconv(.C) void; pub const PFNGLGETCOMMANDHEADERNVPROC = ?fn (GLenum, GLuint) callconv(.C) GLuint; pub const PFNGLGETSTAGEINDEXNVPROC = ?fn (GLenum) callconv(.C) GLushort; pub const PFNGLDRAWCOMMANDSNVPROC = ?fn (GLenum, GLuint, [*c]const GLintptr, [*c]const GLsizei, GLuint) callconv(.C) void; pub const PFNGLDRAWCOMMANDSADDRESSNVPROC = ?fn (GLenum, [*c]const GLuint64, [*c]const GLsizei, GLuint) callconv(.C) void; pub const PFNGLDRAWCOMMANDSSTATESNVPROC = ?fn (GLuint, [*c]const GLintptr, [*c]const GLsizei, [*c]const GLuint, [*c]const GLuint, GLuint) callconv(.C) void; pub const PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC = ?fn ([*c]const GLuint64, [*c]const GLsizei, [*c]const GLuint, [*c]const GLuint, GLuint) callconv(.C) void; pub const PFNGLCREATECOMMANDLISTSNVPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLDELETECOMMANDLISTSNVPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLISCOMMANDLISTNVPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC = ?fn (GLuint, GLuint, [*c]?*const anyopaque, [*c]const GLsizei, [*c]const GLuint, [*c]const GLuint, GLuint) callconv(.C) void; pub const PFNGLCOMMANDLISTSEGMENTSNVPROC = ?fn (GLuint, GLuint) callconv(.C) void; pub const PFNGLCOMPILECOMMANDLISTNVPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLCALLCOMMANDLISTNVPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLBEGINCONDITIONALRENDERNVPROC = ?fn (GLuint, GLenum) callconv(.C) void; pub const PFNGLENDCONDITIONALRENDERNVPROC = ?fn () callconv(.C) void; pub const PFNGLSUBPIXELPRECISIONBIASNVPROC = ?fn (GLuint, GLuint) callconv(.C) void; pub const PFNGLCONSERVATIVERASTERPARAMETERFNVPROC = ?fn (GLenum, GLfloat) callconv(.C) void; pub const PFNGLCONSERVATIVERASTERPARAMETERINVPROC = ?fn (GLenum, GLint) callconv(.C) void; pub const PFNGLCOPYIMAGESUBDATANVPROC = ?fn (GLuint, GLenum, GLint, GLint, GLint, GLint, GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLDEPTHRANGEDNVPROC = ?fn (GLdouble, GLdouble) callconv(.C) void; pub const PFNGLCLEARDEPTHDNVPROC = ?fn (GLdouble) callconv(.C) void; pub const PFNGLDEPTHBOUNDSDNVPROC = ?fn (GLdouble, GLdouble) callconv(.C) void; pub const PFNGLDRAWTEXTURENVPROC = ?fn (GLuint, GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const GLVULKANPROCNV = ?fn () callconv(.C) void; pub const PFNGLDRAWVKIMAGENVPROC = ?fn (GLuint64, GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLGETVKPROCADDRNVPROC = ?fn ([*c]const GLchar) callconv(.C) GLVULKANPROCNV; pub const PFNGLWAITVKSEMAPHORENVPROC = ?fn (GLuint64) callconv(.C) void; pub const PFNGLSIGNALVKSEMAPHORENVPROC = ?fn (GLuint64) callconv(.C) void; pub const PFNGLSIGNALVKFENCENVPROC = ?fn (GLuint64) callconv(.C) void; pub const PFNGLMAPCONTROLPOINTSNVPROC = ?fn (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, ?*const anyopaque) callconv(.C) void; pub const PFNGLMAPPARAMETERIVNVPROC = ?fn (GLenum, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLMAPPARAMETERFVNVPROC = ?fn (GLenum, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLGETMAPCONTROLPOINTSNVPROC = ?fn (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, ?*anyopaque) callconv(.C) void; pub const PFNGLGETMAPPARAMETERIVNVPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETMAPPARAMETERFVNVPROC = ?fn (GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETMAPATTRIBPARAMETERIVNVPROC = ?fn (GLenum, GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETMAPATTRIBPARAMETERFVNVPROC = ?fn (GLenum, GLuint, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLEVALMAPSNVPROC = ?fn (GLenum, GLenum) callconv(.C) void; pub const PFNGLGETMULTISAMPLEFVNVPROC = ?fn (GLenum, GLuint, [*c]GLfloat) callconv(.C) void; pub const PFNGLSAMPLEMASKINDEXEDNVPROC = ?fn (GLuint, GLbitfield) callconv(.C) void; pub const PFNGLTEXRENDERBUFFERNVPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLDELETEFENCESNVPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLGENFENCESNVPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLISFENCENVPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLTESTFENCENVPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLGETFENCEIVNVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLFINISHFENCENVPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLSETFENCENVPROC = ?fn (GLuint, GLenum) callconv(.C) void; pub const PFNGLFRAGMENTCOVERAGECOLORNVPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLPROGRAMNAMEDPARAMETER4FNVPROC = ?fn (GLuint, GLsizei, [*c]const GLubyte, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLubyte, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMNAMEDPARAMETER4DNVPROC = ?fn (GLuint, GLsizei, [*c]const GLubyte, GLdouble, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLubyte, [*c]const GLdouble) callconv(.C) void; pub const PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLubyte, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLubyte, [*c]GLdouble) callconv(.C) void; pub const PFNGLCOVERAGEMODULATIONTABLENVPROC = ?fn (GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLGETCOVERAGEMODULATIONTABLENVPROC = ?fn (GLsizei, [*c]GLfloat) callconv(.C) void; pub const PFNGLCOVERAGEMODULATIONNVPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC = ?fn (GLenum, GLsizei, GLsizei, GLenum, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLPROGRAMVERTEXLIMITNVPROC = ?fn (GLenum, GLint) callconv(.C) void; pub const PFNGLFRAMEBUFFERTEXTUREEXTPROC = ?fn (GLenum, GLenum, GLuint, GLint) callconv(.C) void; pub const PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC = ?fn (GLenum, GLenum, GLuint, GLint, GLenum) callconv(.C) void; pub const PFNGLRENDERGPUMASKNVPROC = ?fn (GLbitfield) callconv(.C) void; pub const PFNGLMULTICASTBUFFERSUBDATANVPROC = ?fn (GLbitfield, GLuint, GLintptr, GLsizeiptr, ?*const anyopaque) callconv(.C) void; pub const PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC = ?fn (GLuint, GLbitfield, GLuint, GLuint, GLintptr, GLintptr, GLsizeiptr) callconv(.C) void; pub const PFNGLMULTICASTCOPYIMAGESUBDATANVPROC = ?fn (GLuint, GLbitfield, GLuint, GLenum, GLint, GLint, GLint, GLint, GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLMULTICASTBLITFRAMEBUFFERNVPROC = ?fn (GLuint, GLuint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum) callconv(.C) void; pub const PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC = ?fn (GLuint, GLuint, GLuint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLMULTICASTBARRIERNVPROC = ?fn () callconv(.C) void; pub const PFNGLMULTICASTWAITSYNCNVPROC = ?fn (GLuint, GLbitfield) callconv(.C) void; pub const PFNGLMULTICASTGETQUERYOBJECTIVNVPROC = ?fn (GLuint, GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC = ?fn (GLuint, GLuint, GLenum, [*c]GLuint) callconv(.C) void; pub const PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC = ?fn (GLuint, GLuint, GLenum, [*c]GLint64) callconv(.C) void; pub const PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC = ?fn (GLuint, GLuint, GLenum, [*c]GLuint64) callconv(.C) void; pub const PFNGLPROGRAMLOCALPARAMETERI4INVPROC = ?fn (GLenum, GLuint, GLint, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC = ?fn (GLenum, GLuint, [*c]const GLint) callconv(.C) void; pub const PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC = ?fn (GLenum, GLuint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLPROGRAMLOCALPARAMETERI4UINVPROC = ?fn (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC = ?fn (GLenum, GLuint, [*c]const GLuint) callconv(.C) void; pub const PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC = ?fn (GLenum, GLuint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLPROGRAMENVPARAMETERI4INVPROC = ?fn (GLenum, GLuint, GLint, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLPROGRAMENVPARAMETERI4IVNVPROC = ?fn (GLenum, GLuint, [*c]const GLint) callconv(.C) void; pub const PFNGLPROGRAMENVPARAMETERSI4IVNVPROC = ?fn (GLenum, GLuint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLPROGRAMENVPARAMETERI4UINVPROC = ?fn (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLPROGRAMENVPARAMETERI4UIVNVPROC = ?fn (GLenum, GLuint, [*c]const GLuint) callconv(.C) void; pub const PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC = ?fn (GLenum, GLuint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC = ?fn (GLenum, GLuint, [*c]GLint) callconv(.C) void; pub const PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC = ?fn (GLenum, GLuint, [*c]GLuint) callconv(.C) void; pub const PFNGLGETPROGRAMENVPARAMETERIIVNVPROC = ?fn (GLenum, GLuint, [*c]GLint) callconv(.C) void; pub const PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC = ?fn (GLenum, GLuint, [*c]GLuint) callconv(.C) void; pub const PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC = ?fn (GLenum, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC = ?fn (GLenum, GLuint, [*c]GLuint) callconv(.C) void; pub const GLhalfNV = c_ushort; pub const PFNGLVERTEX2HNVPROC = ?fn (GLhalfNV, GLhalfNV) callconv(.C) void; pub const PFNGLVERTEX2HVNVPROC = ?fn ([*c]const GLhalfNV) callconv(.C) void; pub const PFNGLVERTEX3HNVPROC = ?fn (GLhalfNV, GLhalfNV, GLhalfNV) callconv(.C) void; pub const PFNGLVERTEX3HVNVPROC = ?fn ([*c]const GLhalfNV) callconv(.C) void; pub const PFNGLVERTEX4HNVPROC = ?fn (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV) callconv(.C) void; pub const PFNGLVERTEX4HVNVPROC = ?fn ([*c]const GLhalfNV) callconv(.C) void; pub const PFNGLNORMAL3HNVPROC = ?fn (GLhalfNV, GLhalfNV, GLhalfNV) callconv(.C) void; pub const PFNGLNORMAL3HVNVPROC = ?fn ([*c]const GLhalfNV) callconv(.C) void; pub const PFNGLCOLOR3HNVPROC = ?fn (GLhalfNV, GLhalfNV, GLhalfNV) callconv(.C) void; pub const PFNGLCOLOR3HVNVPROC = ?fn ([*c]const GLhalfNV) callconv(.C) void; pub const PFNGLCOLOR4HNVPROC = ?fn (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV) callconv(.C) void; pub const PFNGLCOLOR4HVNVPROC = ?fn ([*c]const GLhalfNV) callconv(.C) void; pub const PFNGLTEXCOORD1HNVPROC = ?fn (GLhalfNV) callconv(.C) void; pub const PFNGLTEXCOORD1HVNVPROC = ?fn ([*c]const GLhalfNV) callconv(.C) void; pub const PFNGLTEXCOORD2HNVPROC = ?fn (GLhalfNV, GLhalfNV) callconv(.C) void; pub const PFNGLTEXCOORD2HVNVPROC = ?fn ([*c]const GLhalfNV) callconv(.C) void; pub const PFNGLTEXCOORD3HNVPROC = ?fn (GLhalfNV, GLhalfNV, GLhalfNV) callconv(.C) void; pub const PFNGLTEXCOORD3HVNVPROC = ?fn ([*c]const GLhalfNV) callconv(.C) void; pub const PFNGLTEXCOORD4HNVPROC = ?fn (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV) callconv(.C) void; pub const PFNGLTEXCOORD4HVNVPROC = ?fn ([*c]const GLhalfNV) callconv(.C) void; pub const PFNGLMULTITEXCOORD1HNVPROC = ?fn (GLenum, GLhalfNV) callconv(.C) void; pub const PFNGLMULTITEXCOORD1HVNVPROC = ?fn (GLenum, [*c]const GLhalfNV) callconv(.C) void; pub const PFNGLMULTITEXCOORD2HNVPROC = ?fn (GLenum, GLhalfNV, GLhalfNV) callconv(.C) void; pub const PFNGLMULTITEXCOORD2HVNVPROC = ?fn (GLenum, [*c]const GLhalfNV) callconv(.C) void; pub const PFNGLMULTITEXCOORD3HNVPROC = ?fn (GLenum, GLhalfNV, GLhalfNV, GLhalfNV) callconv(.C) void; pub const PFNGLMULTITEXCOORD3HVNVPROC = ?fn (GLenum, [*c]const GLhalfNV) callconv(.C) void; pub const PFNGLMULTITEXCOORD4HNVPROC = ?fn (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV) callconv(.C) void; pub const PFNGLMULTITEXCOORD4HVNVPROC = ?fn (GLenum, [*c]const GLhalfNV) callconv(.C) void; pub const PFNGLFOGCOORDHNVPROC = ?fn (GLhalfNV) callconv(.C) void; pub const PFNGLFOGCOORDHVNVPROC = ?fn ([*c]const GLhalfNV) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3HNVPROC = ?fn (GLhalfNV, GLhalfNV, GLhalfNV) callconv(.C) void; pub const PFNGLSECONDARYCOLOR3HVNVPROC = ?fn ([*c]const GLhalfNV) callconv(.C) void; pub const PFNGLVERTEXWEIGHTHNVPROC = ?fn (GLhalfNV) callconv(.C) void; pub const PFNGLVERTEXWEIGHTHVNVPROC = ?fn ([*c]const GLhalfNV) callconv(.C) void; pub const PFNGLVERTEXATTRIB1HNVPROC = ?fn (GLuint, GLhalfNV) callconv(.C) void; pub const PFNGLVERTEXATTRIB1HVNVPROC = ?fn (GLuint, [*c]const GLhalfNV) callconv(.C) void; pub const PFNGLVERTEXATTRIB2HNVPROC = ?fn (GLuint, GLhalfNV, GLhalfNV) callconv(.C) void; pub const PFNGLVERTEXATTRIB2HVNVPROC = ?fn (GLuint, [*c]const GLhalfNV) callconv(.C) void; pub const PFNGLVERTEXATTRIB3HNVPROC = ?fn (GLuint, GLhalfNV, GLhalfNV, GLhalfNV) callconv(.C) void; pub const PFNGLVERTEXATTRIB3HVNVPROC = ?fn (GLuint, [*c]const GLhalfNV) callconv(.C) void; pub const PFNGLVERTEXATTRIB4HNVPROC = ?fn (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV) callconv(.C) void; pub const PFNGLVERTEXATTRIB4HVNVPROC = ?fn (GLuint, [*c]const GLhalfNV) callconv(.C) void; pub const PFNGLVERTEXATTRIBS1HVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLhalfNV) callconv(.C) void; pub const PFNGLVERTEXATTRIBS2HVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLhalfNV) callconv(.C) void; pub const PFNGLVERTEXATTRIBS3HVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLhalfNV) callconv(.C) void; pub const PFNGLVERTEXATTRIBS4HVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLhalfNV) callconv(.C) void; pub const PFNGLGETINTERNALFORMATSAMPLEIVNVPROC = ?fn (GLenum, GLenum, GLsizei, GLenum, GLsizei, [*c]GLint) callconv(.C) void; pub const PFNGLGETMEMORYOBJECTDETACHEDRESOURCESUIVNVPROC = ?fn (GLuint, GLenum, GLint, GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLRESETMEMORYOBJECTPARAMETERNVPROC = ?fn (GLuint, GLenum) callconv(.C) void; pub const PFNGLTEXATTACHMEMORYNVPROC = ?fn (GLenum, GLuint, GLuint64) callconv(.C) void; pub const PFNGLBUFFERATTACHMEMORYNVPROC = ?fn (GLenum, GLuint, GLuint64) callconv(.C) void; pub const PFNGLTEXTUREATTACHMEMORYNVPROC = ?fn (GLuint, GLuint, GLuint64) callconv(.C) void; pub const PFNGLNAMEDBUFFERATTACHMEMORYNVPROC = ?fn (GLuint, GLuint, GLuint64) callconv(.C) void; pub const PFNGLDRAWMESHTASKSNVPROC = ?fn (GLuint, GLuint) callconv(.C) void; pub const PFNGLDRAWMESHTASKSINDIRECTNVPROC = ?fn (GLintptr) callconv(.C) void; pub const PFNGLMULTIDRAWMESHTASKSINDIRECTNVPROC = ?fn (GLintptr, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLMULTIDRAWMESHTASKSINDIRECTCOUNTNVPROC = ?fn (GLintptr, GLintptr, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLGENOCCLUSIONQUERIESNVPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLDELETEOCCLUSIONQUERIESNVPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLISOCCLUSIONQUERYNVPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLBEGINOCCLUSIONQUERYNVPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLENDOCCLUSIONQUERYNVPROC = ?fn () callconv(.C) void; pub const PFNGLGETOCCLUSIONQUERYIVNVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETOCCLUSIONQUERYUIVNVPROC = ?fn (GLuint, GLenum, [*c]GLuint) callconv(.C) void; pub const PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC = ?fn (GLenum, GLuint, GLuint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC = ?fn (GLenum, GLuint, GLuint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC = ?fn (GLenum, GLuint, GLuint, GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLGENPATHSNVPROC = ?fn (GLsizei) callconv(.C) GLuint; pub const PFNGLDELETEPATHSNVPROC = ?fn (GLuint, GLsizei) callconv(.C) void; pub const PFNGLISPATHNVPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLPATHCOMMANDSNVPROC = ?fn (GLuint, GLsizei, [*c]const GLubyte, GLsizei, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLPATHCOORDSNVPROC = ?fn (GLuint, GLsizei, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLPATHSUBCOMMANDSNVPROC = ?fn (GLuint, GLsizei, GLsizei, GLsizei, [*c]const GLubyte, GLsizei, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLPATHSUBCOORDSNVPROC = ?fn (GLuint, GLsizei, GLsizei, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLPATHSTRINGNVPROC = ?fn (GLuint, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLPATHGLYPHSNVPROC = ?fn (GLuint, GLenum, ?*const anyopaque, GLbitfield, GLsizei, GLenum, ?*const anyopaque, GLenum, GLuint, GLfloat) callconv(.C) void; pub const PFNGLPATHGLYPHRANGENVPROC = ?fn (GLuint, GLenum, ?*const anyopaque, GLbitfield, GLuint, GLsizei, GLenum, GLuint, GLfloat) callconv(.C) void; pub const PFNGLWEIGHTPATHSNVPROC = ?fn (GLuint, GLsizei, [*c]const GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLCOPYPATHNVPROC = ?fn (GLuint, GLuint) callconv(.C) void; pub const PFNGLINTERPOLATEPATHSNVPROC = ?fn (GLuint, GLuint, GLuint, GLfloat) callconv(.C) void; pub const PFNGLTRANSFORMPATHNVPROC = ?fn (GLuint, GLuint, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPATHPARAMETERIVNVPROC = ?fn (GLuint, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLPATHPARAMETERINVPROC = ?fn (GLuint, GLenum, GLint) callconv(.C) void; pub const PFNGLPATHPARAMETERFVNVPROC = ?fn (GLuint, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPATHPARAMETERFNVPROC = ?fn (GLuint, GLenum, GLfloat) callconv(.C) void; pub const PFNGLPATHDASHARRAYNVPROC = ?fn (GLuint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPATHSTENCILFUNCNVPROC = ?fn (GLenum, GLint, GLuint) callconv(.C) void; pub const PFNGLPATHSTENCILDEPTHOFFSETNVPROC = ?fn (GLfloat, GLfloat) callconv(.C) void; pub const PFNGLSTENCILFILLPATHNVPROC = ?fn (GLuint, GLenum, GLuint) callconv(.C) void; pub const PFNGLSTENCILSTROKEPATHNVPROC = ?fn (GLuint, GLint, GLuint) callconv(.C) void; pub const PFNGLSTENCILFILLPATHINSTANCEDNVPROC = ?fn (GLsizei, GLenum, ?*const anyopaque, GLuint, GLenum, GLuint, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC = ?fn (GLsizei, GLenum, ?*const anyopaque, GLuint, GLint, GLuint, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPATHCOVERDEPTHFUNCNVPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLCOVERFILLPATHNVPROC = ?fn (GLuint, GLenum) callconv(.C) void; pub const PFNGLCOVERSTROKEPATHNVPROC = ?fn (GLuint, GLenum) callconv(.C) void; pub const PFNGLCOVERFILLPATHINSTANCEDNVPROC = ?fn (GLsizei, GLenum, ?*const anyopaque, GLuint, GLenum, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLCOVERSTROKEPATHINSTANCEDNVPROC = ?fn (GLsizei, GLenum, ?*const anyopaque, GLuint, GLenum, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLGETPATHPARAMETERIVNVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETPATHPARAMETERFVNVPROC = ?fn (GLuint, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETPATHCOMMANDSNVPROC = ?fn (GLuint, [*c]GLubyte) callconv(.C) void; pub const PFNGLGETPATHCOORDSNVPROC = ?fn (GLuint, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETPATHDASHARRAYNVPROC = ?fn (GLuint, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETPATHMETRICSNVPROC = ?fn (GLbitfield, GLsizei, GLenum, ?*const anyopaque, GLuint, GLsizei, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETPATHMETRICRANGENVPROC = ?fn (GLbitfield, GLuint, GLsizei, GLsizei, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETPATHSPACINGNVPROC = ?fn (GLenum, GLsizei, GLenum, ?*const anyopaque, GLuint, GLfloat, GLfloat, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLISPOINTINFILLPATHNVPROC = ?fn (GLuint, GLuint, GLfloat, GLfloat) callconv(.C) GLboolean; pub const PFNGLISPOINTINSTROKEPATHNVPROC = ?fn (GLuint, GLfloat, GLfloat) callconv(.C) GLboolean; pub const PFNGLGETPATHLENGTHNVPROC = ?fn (GLuint, GLsizei, GLsizei) callconv(.C) GLfloat; pub const PFNGLPOINTALONGPATHNVPROC = ?fn (GLuint, GLsizei, GLsizei, GLfloat, [*c]GLfloat, [*c]GLfloat, [*c]GLfloat, [*c]GLfloat) callconv(.C) GLboolean; pub const PFNGLMATRIXLOAD3X2FNVPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLMATRIXLOAD3X3FNVPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLMATRIXMULT3X2FNVPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLMATRIXMULT3X3FNVPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLSTENCILTHENCOVERFILLPATHNVPROC = ?fn (GLuint, GLenum, GLuint, GLenum) callconv(.C) void; pub const PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC = ?fn (GLuint, GLint, GLuint, GLenum) callconv(.C) void; pub const PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC = ?fn (GLsizei, GLenum, ?*const anyopaque, GLuint, GLenum, GLuint, GLenum, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC = ?fn (GLsizei, GLenum, ?*const anyopaque, GLuint, GLint, GLuint, GLenum, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPATHGLYPHINDEXRANGENVPROC = ?fn (GLenum, ?*const anyopaque, GLbitfield, GLuint, GLfloat, [*c]GLuint) callconv(.C) GLenum; pub const PFNGLPATHGLYPHINDEXARRAYNVPROC = ?fn (GLuint, GLenum, ?*const anyopaque, GLbitfield, GLuint, GLsizei, GLuint, GLfloat) callconv(.C) GLenum; pub const PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC = ?fn (GLuint, GLenum, GLsizeiptr, ?*const anyopaque, GLsizei, GLuint, GLsizei, GLuint, GLfloat) callconv(.C) GLenum; pub const PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC = ?fn (GLuint, GLint, GLenum, GLint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLGETPROGRAMRESOURCEFVNVPROC = ?fn (GLuint, GLenum, GLuint, GLsizei, [*c]const GLenum, GLsizei, [*c]GLsizei, [*c]GLfloat) callconv(.C) void; pub const PFNGLPATHCOLORGENNVPROC = ?fn (GLenum, GLenum, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPATHTEXGENNVPROC = ?fn (GLenum, GLenum, GLint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPATHFOGGENNVPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLGETPATHCOLORGENIVNVPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETPATHCOLORGENFVNVPROC = ?fn (GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETPATHTEXGENIVNVPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETPATHTEXGENFVNVPROC = ?fn (GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLPIXELDATARANGENVPROC = ?fn (GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLFLUSHPIXELDATARANGENVPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLPOINTPARAMETERINVPROC = ?fn (GLenum, GLint) callconv(.C) void; pub const PFNGLPOINTPARAMETERIVNVPROC = ?fn (GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLPRESENTFRAMEKEYEDNVPROC = ?fn (GLuint, GLuint64EXT, GLuint, GLuint, GLenum, GLenum, GLuint, GLuint, GLenum, GLuint, GLuint) callconv(.C) void; pub const PFNGLPRESENTFRAMEDUALFILLNVPROC = ?fn (GLuint, GLuint64EXT, GLuint, GLuint, GLenum, GLenum, GLuint, GLenum, GLuint, GLenum, GLuint, GLenum, GLuint) callconv(.C) void; pub const PFNGLGETVIDEOIVNVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETVIDEOUIVNVPROC = ?fn (GLuint, GLenum, [*c]GLuint) callconv(.C) void; pub const PFNGLGETVIDEOI64VNVPROC = ?fn (GLuint, GLenum, [*c]GLint64EXT) callconv(.C) void; pub const PFNGLGETVIDEOUI64VNVPROC = ?fn (GLuint, GLenum, [*c]GLuint64EXT) callconv(.C) void; pub const PFNGLPRIMITIVERESTARTNVPROC = ?fn () callconv(.C) void; pub const PFNGLPRIMITIVERESTARTINDEXNVPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLQUERYRESOURCENVPROC = ?fn (GLenum, GLint, GLuint, [*c]GLint) callconv(.C) GLint; pub const PFNGLGENQUERYRESOURCETAGNVPROC = ?fn (GLsizei, [*c]GLint) callconv(.C) void; pub const PFNGLDELETEQUERYRESOURCETAGNVPROC = ?fn (GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLQUERYRESOURCETAGNVPROC = ?fn (GLint, [*c]const GLchar) callconv(.C) void; pub const PFNGLCOMBINERPARAMETERFVNVPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLCOMBINERPARAMETERFNVPROC = ?fn (GLenum, GLfloat) callconv(.C) void; pub const PFNGLCOMBINERPARAMETERIVNVPROC = ?fn (GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLCOMBINERPARAMETERINVPROC = ?fn (GLenum, GLint) callconv(.C) void; pub const PFNGLCOMBINERINPUTNVPROC = ?fn (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum) callconv(.C) void; pub const PFNGLCOMBINEROUTPUTNVPROC = ?fn (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean) callconv(.C) void; pub const PFNGLFINALCOMBINERINPUTNVPROC = ?fn (GLenum, GLenum, GLenum, GLenum) callconv(.C) void; pub const PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC = ?fn (GLenum, GLenum, GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC = ?fn (GLenum, GLenum, GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC = ?fn (GLenum, GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC = ?fn (GLenum, GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC = ?fn (GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLCOMBINERSTAGEPARAMETERFVNVPROC = ?fn (GLenum, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC = ?fn (GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC = ?fn (GLenum, GLuint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC = ?fn (GLuint, GLuint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLRESOLVEDEPTHVALUESNVPROC = ?fn () callconv(.C) void; pub const PFNGLSCISSOREXCLUSIVENVPROC = ?fn (GLint, GLint, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLSCISSOREXCLUSIVEARRAYVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLint) callconv(.C) void; pub const PFNGLMAKEBUFFERRESIDENTNVPROC = ?fn (GLenum, GLenum) callconv(.C) void; pub const PFNGLMAKEBUFFERNONRESIDENTNVPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLISBUFFERRESIDENTNVPROC = ?fn (GLenum) callconv(.C) GLboolean; pub const PFNGLMAKENAMEDBUFFERRESIDENTNVPROC = ?fn (GLuint, GLenum) callconv(.C) void; pub const PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLISNAMEDBUFFERRESIDENTNVPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLGETBUFFERPARAMETERUI64VNVPROC = ?fn (GLenum, GLenum, [*c]GLuint64EXT) callconv(.C) void; pub const PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC = ?fn (GLuint, GLenum, [*c]GLuint64EXT) callconv(.C) void; pub const PFNGLGETINTEGERUI64VNVPROC = ?fn (GLenum, [*c]GLuint64EXT) callconv(.C) void; pub const PFNGLUNIFORMUI64NVPROC = ?fn (GLint, GLuint64EXT) callconv(.C) void; pub const PFNGLUNIFORMUI64VNVPROC = ?fn (GLint, GLsizei, [*c]const GLuint64EXT) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMUI64NVPROC = ?fn (GLuint, GLint, GLuint64EXT) callconv(.C) void; pub const PFNGLPROGRAMUNIFORMUI64VNVPROC = ?fn (GLuint, GLint, GLsizei, [*c]const GLuint64EXT) callconv(.C) void; pub const PFNGLBINDSHADINGRATEIMAGENVPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLGETSHADINGRATEIMAGEPALETTENVPROC = ?fn (GLuint, GLuint, [*c]GLenum) callconv(.C) void; pub const PFNGLGETSHADINGRATESAMPLELOCATIONIVNVPROC = ?fn (GLenum, GLuint, GLuint, [*c]GLint) callconv(.C) void; pub const PFNGLSHADINGRATEIMAGEBARRIERNVPROC = ?fn (GLboolean) callconv(.C) void; pub const PFNGLSHADINGRATEIMAGEPALETTENVPROC = ?fn (GLuint, GLuint, GLsizei, [*c]const GLenum) callconv(.C) void; pub const PFNGLSHADINGRATESAMPLEORDERNVPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLSHADINGRATESAMPLEORDERCUSTOMNVPROC = ?fn (GLenum, GLuint, [*c]const GLint) callconv(.C) void; pub const PFNGLTEXTUREBARRIERNVPROC = ?fn () callconv(.C) void; pub const PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC = ?fn (GLenum, GLsizei, GLsizei, GLint, GLsizei, GLsizei, GLboolean) callconv(.C) void; pub const PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC = ?fn (GLenum, GLsizei, GLsizei, GLint, GLsizei, GLsizei, GLsizei, GLboolean) callconv(.C) void; pub const PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC = ?fn (GLuint, GLenum, GLsizei, GLint, GLsizei, GLsizei, GLboolean) callconv(.C) void; pub const PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC = ?fn (GLuint, GLenum, GLsizei, GLint, GLsizei, GLsizei, GLsizei, GLboolean) callconv(.C) void; pub const PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC = ?fn (GLuint, GLenum, GLsizei, GLsizei, GLint, GLsizei, GLsizei, GLboolean) callconv(.C) void; pub const PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC = ?fn (GLuint, GLenum, GLsizei, GLsizei, GLint, GLsizei, GLsizei, GLsizei, GLboolean) callconv(.C) void; pub const PFNGLBEGINTRANSFORMFEEDBACKNVPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLENDTRANSFORMFEEDBACKNVPROC = ?fn () callconv(.C) void; pub const PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC = ?fn (GLsizei, [*c]const GLint, GLenum) callconv(.C) void; pub const PFNGLBINDBUFFERRANGENVPROC = ?fn (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr) callconv(.C) void; pub const PFNGLBINDBUFFEROFFSETNVPROC = ?fn (GLenum, GLuint, GLuint, GLintptr) callconv(.C) void; pub const PFNGLBINDBUFFERBASENVPROC = ?fn (GLenum, GLuint, GLuint) callconv(.C) void; pub const PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC = ?fn (GLuint, GLsizei, [*c]const GLint, GLenum) callconv(.C) void; pub const PFNGLACTIVEVARYINGNVPROC = ?fn (GLuint, [*c]const GLchar) callconv(.C) void; pub const PFNGLGETVARYINGLOCATIONNVPROC = ?fn (GLuint, [*c]const GLchar) callconv(.C) GLint; pub const PFNGLGETACTIVEVARYINGNVPROC = ?fn (GLuint, GLuint, GLsizei, [*c]GLsizei, [*c]GLsizei, [*c]GLenum, [*c]GLchar) callconv(.C) void; pub const PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC = ?fn (GLuint, GLuint, [*c]GLint) callconv(.C) void; pub const PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC = ?fn (GLsizei, [*c]const GLint, GLsizei, [*c]const GLint, GLenum) callconv(.C) void; pub const PFNGLBINDTRANSFORMFEEDBACKNVPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLDELETETRANSFORMFEEDBACKSNVPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLGENTRANSFORMFEEDBACKSNVPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLISTRANSFORMFEEDBACKNVPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLPAUSETRANSFORMFEEDBACKNVPROC = ?fn () callconv(.C) void; pub const PFNGLRESUMETRANSFORMFEEDBACKNVPROC = ?fn () callconv(.C) void; pub const PFNGLDRAWTRANSFORMFEEDBACKNVPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const GLvdpauSurfaceNV = GLintptr; pub const PFNGLVDPAUINITNVPROC = ?fn (?*const anyopaque, ?*const anyopaque) callconv(.C) void; pub const PFNGLVDPAUFININVPROC = ?fn () callconv(.C) void; pub const PFNGLVDPAUREGISTERVIDEOSURFACENVPROC = ?fn (?*const anyopaque, GLenum, GLsizei, [*c]const GLuint) callconv(.C) GLvdpauSurfaceNV; pub const PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC = ?fn (?*const anyopaque, GLenum, GLsizei, [*c]const GLuint) callconv(.C) GLvdpauSurfaceNV; pub const PFNGLVDPAUISSURFACENVPROC = ?fn (GLvdpauSurfaceNV) callconv(.C) GLboolean; pub const PFNGLVDPAUUNREGISTERSURFACENVPROC = ?fn (GLvdpauSurfaceNV) callconv(.C) void; pub const PFNGLVDPAUGETSURFACEIVNVPROC = ?fn (GLvdpauSurfaceNV, GLenum, GLsizei, [*c]GLsizei, [*c]GLint) callconv(.C) void; pub const PFNGLVDPAUSURFACEACCESSNVPROC = ?fn (GLvdpauSurfaceNV, GLenum) callconv(.C) void; pub const PFNGLVDPAUMAPSURFACESNVPROC = ?fn (GLsizei, [*c]const GLvdpauSurfaceNV) callconv(.C) void; pub const PFNGLVDPAUUNMAPSURFACESNVPROC = ?fn (GLsizei, [*c]const GLvdpauSurfaceNV) callconv(.C) void; pub const PFNGLVDPAUREGISTERVIDEOSURFACEWITHPICTURESTRUCTURENVPROC = ?fn (?*const anyopaque, GLenum, GLsizei, [*c]const GLuint, GLboolean) callconv(.C) GLvdpauSurfaceNV; pub const PFNGLFLUSHVERTEXARRAYRANGENVPROC = ?fn () callconv(.C) void; pub const PFNGLVERTEXARRAYRANGENVPROC = ?fn (GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLVERTEXATTRIBL1I64NVPROC = ?fn (GLuint, GLint64EXT) callconv(.C) void; pub const PFNGLVERTEXATTRIBL2I64NVPROC = ?fn (GLuint, GLint64EXT, GLint64EXT) callconv(.C) void; pub const PFNGLVERTEXATTRIBL3I64NVPROC = ?fn (GLuint, GLint64EXT, GLint64EXT, GLint64EXT) callconv(.C) void; pub const PFNGLVERTEXATTRIBL4I64NVPROC = ?fn (GLuint, GLint64EXT, GLint64EXT, GLint64EXT, GLint64EXT) callconv(.C) void; pub const PFNGLVERTEXATTRIBL1I64VNVPROC = ?fn (GLuint, [*c]const GLint64EXT) callconv(.C) void; pub const PFNGLVERTEXATTRIBL2I64VNVPROC = ?fn (GLuint, [*c]const GLint64EXT) callconv(.C) void; pub const PFNGLVERTEXATTRIBL3I64VNVPROC = ?fn (GLuint, [*c]const GLint64EXT) callconv(.C) void; pub const PFNGLVERTEXATTRIBL4I64VNVPROC = ?fn (GLuint, [*c]const GLint64EXT) callconv(.C) void; pub const PFNGLVERTEXATTRIBL1UI64NVPROC = ?fn (GLuint, GLuint64EXT) callconv(.C) void; pub const PFNGLVERTEXATTRIBL2UI64NVPROC = ?fn (GLuint, GLuint64EXT, GLuint64EXT) callconv(.C) void; pub const PFNGLVERTEXATTRIBL3UI64NVPROC = ?fn (GLuint, GLuint64EXT, GLuint64EXT, GLuint64EXT) callconv(.C) void; pub const PFNGLVERTEXATTRIBL4UI64NVPROC = ?fn (GLuint, GLuint64EXT, GLuint64EXT, GLuint64EXT, GLuint64EXT) callconv(.C) void; pub const PFNGLVERTEXATTRIBL1UI64VNVPROC = ?fn (GLuint, [*c]const GLuint64EXT) callconv(.C) void; pub const PFNGLVERTEXATTRIBL2UI64VNVPROC = ?fn (GLuint, [*c]const GLuint64EXT) callconv(.C) void; pub const PFNGLVERTEXATTRIBL3UI64VNVPROC = ?fn (GLuint, [*c]const GLuint64EXT) callconv(.C) void; pub const PFNGLVERTEXATTRIBL4UI64VNVPROC = ?fn (GLuint, [*c]const GLuint64EXT) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBLI64VNVPROC = ?fn (GLuint, GLenum, [*c]GLint64EXT) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBLUI64VNVPROC = ?fn (GLuint, GLenum, [*c]GLuint64EXT) callconv(.C) void; pub const PFNGLVERTEXATTRIBLFORMATNVPROC = ?fn (GLuint, GLint, GLenum, GLsizei) callconv(.C) void; pub const PFNGLBUFFERADDRESSRANGENVPROC = ?fn (GLenum, GLuint, GLuint64EXT, GLsizeiptr) callconv(.C) void; pub const PFNGLVERTEXFORMATNVPROC = ?fn (GLint, GLenum, GLsizei) callconv(.C) void; pub const PFNGLNORMALFORMATNVPROC = ?fn (GLenum, GLsizei) callconv(.C) void; pub const PFNGLCOLORFORMATNVPROC = ?fn (GLint, GLenum, GLsizei) callconv(.C) void; pub const PFNGLINDEXFORMATNVPROC = ?fn (GLenum, GLsizei) callconv(.C) void; pub const PFNGLTEXCOORDFORMATNVPROC = ?fn (GLint, GLenum, GLsizei) callconv(.C) void; pub const PFNGLEDGEFLAGFORMATNVPROC = ?fn (GLsizei) callconv(.C) void; pub const PFNGLSECONDARYCOLORFORMATNVPROC = ?fn (GLint, GLenum, GLsizei) callconv(.C) void; pub const PFNGLFOGCOORDFORMATNVPROC = ?fn (GLenum, GLsizei) callconv(.C) void; pub const PFNGLVERTEXATTRIBFORMATNVPROC = ?fn (GLuint, GLint, GLenum, GLboolean, GLsizei) callconv(.C) void; pub const PFNGLVERTEXATTRIBIFORMATNVPROC = ?fn (GLuint, GLint, GLenum, GLsizei) callconv(.C) void; pub const PFNGLGETINTEGERUI64I_VNVPROC = ?fn (GLenum, GLuint, [*c]GLuint64EXT) callconv(.C) void; pub const PFNGLAREPROGRAMSRESIDENTNVPROC = ?fn (GLsizei, [*c]const GLuint, [*c]GLboolean) callconv(.C) GLboolean; pub const PFNGLBINDPROGRAMNVPROC = ?fn (GLenum, GLuint) callconv(.C) void; pub const PFNGLDELETEPROGRAMSNVPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLEXECUTEPROGRAMNVPROC = ?fn (GLenum, GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLGENPROGRAMSNVPROC = ?fn (GLsizei, [*c]GLuint) callconv(.C) void; pub const PFNGLGETPROGRAMPARAMETERDVNVPROC = ?fn (GLenum, GLuint, GLenum, [*c]GLdouble) callconv(.C) void; pub const PFNGLGETPROGRAMPARAMETERFVNVPROC = ?fn (GLenum, GLuint, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETPROGRAMIVNVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETPROGRAMSTRINGNVPROC = ?fn (GLuint, GLenum, [*c]GLubyte) callconv(.C) void; pub const PFNGLGETTRACKMATRIXIVNVPROC = ?fn (GLenum, GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBDVNVPROC = ?fn (GLuint, GLenum, [*c]GLdouble) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBFVNVPROC = ?fn (GLuint, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBIVNVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBPOINTERVNVPROC = ?fn (GLuint, GLenum, [*c]?*anyopaque) callconv(.C) void; pub const PFNGLISPROGRAMNVPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLLOADPROGRAMNVPROC = ?fn (GLenum, GLuint, GLsizei, [*c]const GLubyte) callconv(.C) void; pub const PFNGLPROGRAMPARAMETER4DNVPROC = ?fn (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLPROGRAMPARAMETER4DVNVPROC = ?fn (GLenum, GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMPARAMETER4FNVPROC = ?fn (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLPROGRAMPARAMETER4FVNVPROC = ?fn (GLenum, GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLPROGRAMPARAMETERS4DVNVPROC = ?fn (GLenum, GLuint, GLsizei, [*c]const GLdouble) callconv(.C) void; pub const PFNGLPROGRAMPARAMETERS4FVNVPROC = ?fn (GLenum, GLuint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLREQUESTRESIDENTPROGRAMSNVPROC = ?fn (GLsizei, [*c]const GLuint) callconv(.C) void; pub const PFNGLTRACKMATRIXNVPROC = ?fn (GLenum, GLuint, GLenum, GLenum) callconv(.C) void; pub const PFNGLVERTEXATTRIBPOINTERNVPROC = ?fn (GLuint, GLint, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLVERTEXATTRIB1DNVPROC = ?fn (GLuint, GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB1DVNVPROC = ?fn (GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB1FNVPROC = ?fn (GLuint, GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB1FVNVPROC = ?fn (GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB1SNVPROC = ?fn (GLuint, GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB1SVNVPROC = ?fn (GLuint, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB2DNVPROC = ?fn (GLuint, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB2DVNVPROC = ?fn (GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB2FNVPROC = ?fn (GLuint, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB2FVNVPROC = ?fn (GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB2SNVPROC = ?fn (GLuint, GLshort, GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB2SVNVPROC = ?fn (GLuint, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB3DNVPROC = ?fn (GLuint, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB3DVNVPROC = ?fn (GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB3FNVPROC = ?fn (GLuint, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB3FVNVPROC = ?fn (GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB3SNVPROC = ?fn (GLuint, GLshort, GLshort, GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB3SVNVPROC = ?fn (GLuint, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB4DNVPROC = ?fn (GLuint, GLdouble, GLdouble, GLdouble, GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB4DVNVPROC = ?fn (GLuint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIB4FNVPROC = ?fn (GLuint, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB4FVNVPROC = ?fn (GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIB4SNVPROC = ?fn (GLuint, GLshort, GLshort, GLshort, GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB4SVNVPROC = ?fn (GLuint, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIB4UBNVPROC = ?fn (GLuint, GLubyte, GLubyte, GLubyte, GLubyte) callconv(.C) void; pub const PFNGLVERTEXATTRIB4UBVNVPROC = ?fn (GLuint, [*c]const GLubyte) callconv(.C) void; pub const PFNGLVERTEXATTRIBS1DVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIBS1FVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIBS1SVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIBS2DVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIBS2FVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIBS2SVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIBS3DVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIBS3FVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIBS3SVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIBS4DVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVERTEXATTRIBS4FVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVERTEXATTRIBS4SVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIBS4UBVNVPROC = ?fn (GLuint, GLsizei, [*c]const GLubyte) callconv(.C) void; pub const PFNGLVERTEXATTRIBI1IEXTPROC = ?fn (GLuint, GLint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI2IEXTPROC = ?fn (GLuint, GLint, GLint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI3IEXTPROC = ?fn (GLuint, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI4IEXTPROC = ?fn (GLuint, GLint, GLint, GLint, GLint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI1UIEXTPROC = ?fn (GLuint, GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI2UIEXTPROC = ?fn (GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI3UIEXTPROC = ?fn (GLuint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI4UIEXTPROC = ?fn (GLuint, GLuint, GLuint, GLuint, GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI1IVEXTPROC = ?fn (GLuint, [*c]const GLint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI2IVEXTPROC = ?fn (GLuint, [*c]const GLint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI3IVEXTPROC = ?fn (GLuint, [*c]const GLint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI4IVEXTPROC = ?fn (GLuint, [*c]const GLint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI1UIVEXTPROC = ?fn (GLuint, [*c]const GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI2UIVEXTPROC = ?fn (GLuint, [*c]const GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI3UIVEXTPROC = ?fn (GLuint, [*c]const GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI4UIVEXTPROC = ?fn (GLuint, [*c]const GLuint) callconv(.C) void; pub const PFNGLVERTEXATTRIBI4BVEXTPROC = ?fn (GLuint, [*c]const GLbyte) callconv(.C) void; pub const PFNGLVERTEXATTRIBI4SVEXTPROC = ?fn (GLuint, [*c]const GLshort) callconv(.C) void; pub const PFNGLVERTEXATTRIBI4UBVEXTPROC = ?fn (GLuint, [*c]const GLubyte) callconv(.C) void; pub const PFNGLVERTEXATTRIBI4USVEXTPROC = ?fn (GLuint, [*c]const GLushort) callconv(.C) void; pub const PFNGLVERTEXATTRIBIPOINTEREXTPROC = ?fn (GLuint, GLint, GLenum, GLsizei, ?*const anyopaque) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBIIVEXTPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETVERTEXATTRIBIUIVEXTPROC = ?fn (GLuint, GLenum, [*c]GLuint) callconv(.C) void; pub const PFNGLBEGINVIDEOCAPTURENVPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC = ?fn (GLuint, GLuint, GLenum, GLintptrARB) callconv(.C) void; pub const PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC = ?fn (GLuint, GLuint, GLenum, GLenum, GLuint) callconv(.C) void; pub const PFNGLENDVIDEOCAPTURENVPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLGETVIDEOCAPTUREIVNVPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETVIDEOCAPTURESTREAMIVNVPROC = ?fn (GLuint, GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETVIDEOCAPTURESTREAMFVNVPROC = ?fn (GLuint, GLuint, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETVIDEOCAPTURESTREAMDVNVPROC = ?fn (GLuint, GLuint, GLenum, [*c]GLdouble) callconv(.C) void; pub const PFNGLVIDEOCAPTURENVPROC = ?fn (GLuint, [*c]GLuint, [*c]GLuint64EXT) callconv(.C) GLenum; pub const PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC = ?fn (GLuint, GLuint, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC = ?fn (GLuint, GLuint, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC = ?fn (GLuint, GLuint, GLenum, [*c]const GLdouble) callconv(.C) void; pub const PFNGLVIEWPORTSWIZZLENVPROC = ?fn (GLuint, GLenum, GLenum, GLenum, GLenum) callconv(.C) void; pub const PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC = ?fn (GLenum, GLenum, GLuint, GLint, GLint, GLsizei) callconv(.C) void; pub const PFNGLHINTPGIPROC = ?fn (GLenum, GLint) callconv(.C) void; pub const PFNGLDETAILTEXFUNCSGISPROC = ?fn (GLenum, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLGETDETAILTEXFUNCSGISPROC = ?fn (GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLFOGFUNCSGISPROC = ?fn (GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLGETFOGFUNCSGISPROC = ?fn ([*c]GLfloat) callconv(.C) void; pub const PFNGLSAMPLEMASKSGISPROC = ?fn (GLclampf, GLboolean) callconv(.C) void; pub const PFNGLSAMPLEPATTERNSGISPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLPIXELTEXGENPARAMETERISGISPROC = ?fn (GLenum, GLint) callconv(.C) void; pub const PFNGLPIXELTEXGENPARAMETERIVSGISPROC = ?fn (GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLPIXELTEXGENPARAMETERFSGISPROC = ?fn (GLenum, GLfloat) callconv(.C) void; pub const PFNGLPIXELTEXGENPARAMETERFVSGISPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC = ?fn (GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC = ?fn (GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLPOINTPARAMETERFSGISPROC = ?fn (GLenum, GLfloat) callconv(.C) void; pub const PFNGLPOINTPARAMETERFVSGISPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLSHARPENTEXFUNCSGISPROC = ?fn (GLenum, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLGETSHARPENTEXFUNCSGISPROC = ?fn (GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLTEXIMAGE4DSGISPROC = ?fn (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLTEXSUBIMAGE4DSGISPROC = ?fn (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLTEXTURECOLORMASKSGISPROC = ?fn (GLboolean, GLboolean, GLboolean, GLboolean) callconv(.C) void; pub const PFNGLGETTEXFILTERFUNCSGISPROC = ?fn (GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLTEXFILTERFUNCSGISPROC = ?fn (GLenum, GLenum, GLsizei, [*c]const GLfloat) callconv(.C) void; pub const PFNGLASYNCMARKERSGIXPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLFINISHASYNCSGIXPROC = ?fn ([*c]GLuint) callconv(.C) GLint; pub const PFNGLPOLLASYNCSGIXPROC = ?fn ([*c]GLuint) callconv(.C) GLint; pub const PFNGLGENASYNCMARKERSSGIXPROC = ?fn (GLsizei) callconv(.C) GLuint; pub const PFNGLDELETEASYNCMARKERSSGIXPROC = ?fn (GLuint, GLsizei) callconv(.C) void; pub const PFNGLISASYNCMARKERSGIXPROC = ?fn (GLuint) callconv(.C) GLboolean; pub const PFNGLFLUSHRASTERSGIXPROC = ?fn () callconv(.C) void; pub const PFNGLFRAGMENTCOLORMATERIALSGIXPROC = ?fn (GLenum, GLenum) callconv(.C) void; pub const PFNGLFRAGMENTLIGHTFSGIXPROC = ?fn (GLenum, GLenum, GLfloat) callconv(.C) void; pub const PFNGLFRAGMENTLIGHTFVSGIXPROC = ?fn (GLenum, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLFRAGMENTLIGHTISGIXPROC = ?fn (GLenum, GLenum, GLint) callconv(.C) void; pub const PFNGLFRAGMENTLIGHTIVSGIXPROC = ?fn (GLenum, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLFRAGMENTLIGHTMODELFSGIXPROC = ?fn (GLenum, GLfloat) callconv(.C) void; pub const PFNGLFRAGMENTLIGHTMODELFVSGIXPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLFRAGMENTLIGHTMODELISGIXPROC = ?fn (GLenum, GLint) callconv(.C) void; pub const PFNGLFRAGMENTLIGHTMODELIVSGIXPROC = ?fn (GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLFRAGMENTMATERIALFSGIXPROC = ?fn (GLenum, GLenum, GLfloat) callconv(.C) void; pub const PFNGLFRAGMENTMATERIALFVSGIXPROC = ?fn (GLenum, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLFRAGMENTMATERIALISGIXPROC = ?fn (GLenum, GLenum, GLint) callconv(.C) void; pub const PFNGLFRAGMENTMATERIALIVSGIXPROC = ?fn (GLenum, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLGETFRAGMENTLIGHTFVSGIXPROC = ?fn (GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETFRAGMENTLIGHTIVSGIXPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLGETFRAGMENTMATERIALFVSGIXPROC = ?fn (GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETFRAGMENTMATERIALIVSGIXPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLLIGHTENVISGIXPROC = ?fn (GLenum, GLint) callconv(.C) void; pub const PFNGLFRAMEZOOMSGIXPROC = ?fn (GLint) callconv(.C) void; pub const PFNGLIGLOOINTERFACESGIXPROC = ?fn (GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLGETINSTRUMENTSSGIXPROC = ?fn () callconv(.C) GLint; pub const PFNGLINSTRUMENTSBUFFERSGIXPROC = ?fn (GLsizei, [*c]GLint) callconv(.C) void; pub const PFNGLPOLLINSTRUMENTSSGIXPROC = ?fn ([*c]GLint) callconv(.C) GLint; pub const PFNGLREADINSTRUMENTSSGIXPROC = ?fn (GLint) callconv(.C) void; pub const PFNGLSTARTINSTRUMENTSSGIXPROC = ?fn () callconv(.C) void; pub const PFNGLSTOPINSTRUMENTSSGIXPROC = ?fn (GLint) callconv(.C) void; pub const PFNGLGETLISTPARAMETERFVSGIXPROC = ?fn (GLuint, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETLISTPARAMETERIVSGIXPROC = ?fn (GLuint, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLLISTPARAMETERFSGIXPROC = ?fn (GLuint, GLenum, GLfloat) callconv(.C) void; pub const PFNGLLISTPARAMETERFVSGIXPROC = ?fn (GLuint, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLLISTPARAMETERISGIXPROC = ?fn (GLuint, GLenum, GLint) callconv(.C) void; pub const PFNGLLISTPARAMETERIVSGIXPROC = ?fn (GLuint, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLPIXELTEXGENSGIXPROC = ?fn (GLenum) callconv(.C) void; pub const PFNGLDEFORMATIONMAP3DSGIXPROC = ?fn (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, [*c]const GLdouble) callconv(.C) void; pub const PFNGLDEFORMATIONMAP3FSGIXPROC = ?fn (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLDEFORMSGIXPROC = ?fn (GLbitfield) callconv(.C) void; pub const PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC = ?fn (GLbitfield) callconv(.C) void; pub const PFNGLREFERENCEPLANESGIXPROC = ?fn ([*c]const GLdouble) callconv(.C) void; pub const PFNGLSPRITEPARAMETERFSGIXPROC = ?fn (GLenum, GLfloat) callconv(.C) void; pub const PFNGLSPRITEPARAMETERFVSGIXPROC = ?fn (GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLSPRITEPARAMETERISGIXPROC = ?fn (GLenum, GLint) callconv(.C) void; pub const PFNGLSPRITEPARAMETERIVSGIXPROC = ?fn (GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLTAGSAMPLEBUFFERSGIXPROC = ?fn () callconv(.C) void; pub const PFNGLCOLORTABLESGIPROC = ?fn (GLenum, GLenum, GLsizei, GLenum, GLenum, ?*const anyopaque) callconv(.C) void; pub const PFNGLCOLORTABLEPARAMETERFVSGIPROC = ?fn (GLenum, GLenum, [*c]const GLfloat) callconv(.C) void; pub const PFNGLCOLORTABLEPARAMETERIVSGIPROC = ?fn (GLenum, GLenum, [*c]const GLint) callconv(.C) void; pub const PFNGLCOPYCOLORTABLESGIPROC = ?fn (GLenum, GLenum, GLint, GLint, GLsizei) callconv(.C) void; pub const PFNGLGETCOLORTABLESGIPROC = ?fn (GLenum, GLenum, GLenum, ?*anyopaque) callconv(.C) void; pub const PFNGLGETCOLORTABLEPARAMETERFVSGIPROC = ?fn (GLenum, GLenum, [*c]GLfloat) callconv(.C) void; pub const PFNGLGETCOLORTABLEPARAMETERIVSGIPROC = ?fn (GLenum, GLenum, [*c]GLint) callconv(.C) void; pub const PFNGLFINISHTEXTURESUNXPROC = ?fn () callconv(.C) void; pub const PFNGLGLOBALALPHAFACTORBSUNPROC = ?fn (GLbyte) callconv(.C) void; pub const PFNGLGLOBALALPHAFACTORSSUNPROC = ?fn (GLshort) callconv(.C) void; pub const PFNGLGLOBALALPHAFACTORISUNPROC = ?fn (GLint) callconv(.C) void; pub const PFNGLGLOBALALPHAFACTORFSUNPROC = ?fn (GLfloat) callconv(.C) void; pub const PFNGLGLOBALALPHAFACTORDSUNPROC = ?fn (GLdouble) callconv(.C) void; pub const PFNGLGLOBALALPHAFACTORUBSUNPROC = ?fn (GLubyte) callconv(.C) void; pub const PFNGLGLOBALALPHAFACTORUSSUNPROC = ?fn (GLushort) callconv(.C) void; pub const PFNGLGLOBALALPHAFACTORUISUNPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLDRAWMESHARRAYSSUNPROC = ?fn (GLenum, GLint, GLsizei, GLsizei) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUISUNPROC = ?fn (GLuint) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUSSUNPROC = ?fn (GLushort) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUBSUNPROC = ?fn (GLubyte) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUIVSUNPROC = ?fn ([*c]const GLuint) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUSVSUNPROC = ?fn ([*c]const GLushort) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUBVSUNPROC = ?fn ([*c]const GLubyte) callconv(.C) void; pub const PFNGLREPLACEMENTCODEPOINTERSUNPROC = ?fn (GLenum, GLsizei, [*c]?*const anyopaque) callconv(.C) void; pub const PFNGLCOLOR4UBVERTEX2FSUNPROC = ?fn (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLCOLOR4UBVERTEX2FVSUNPROC = ?fn ([*c]const GLubyte, [*c]const GLfloat) callconv(.C) void; pub const PFNGLCOLOR4UBVERTEX3FSUNPROC = ?fn (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLCOLOR4UBVERTEX3FVSUNPROC = ?fn ([*c]const GLubyte, [*c]const GLfloat) callconv(.C) void; pub const PFNGLCOLOR3FVERTEX3FSUNPROC = ?fn (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLCOLOR3FVERTEX3FVSUNPROC = ?fn ([*c]const GLfloat, [*c]const GLfloat) callconv(.C) void; pub const PFNGLNORMAL3FVERTEX3FSUNPROC = ?fn (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLNORMAL3FVERTEX3FVSUNPROC = ?fn ([*c]const GLfloat, [*c]const GLfloat) callconv(.C) void; pub const PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC = ?fn (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC = ?fn ([*c]const GLfloat, [*c]const GLfloat, [*c]const GLfloat) callconv(.C) void; pub const PFNGLTEXCOORD2FVERTEX3FSUNPROC = ?fn (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLTEXCOORD2FVERTEX3FVSUNPROC = ?fn ([*c]const GLfloat, [*c]const GLfloat) callconv(.C) void; pub const PFNGLTEXCOORD4FVERTEX4FSUNPROC = ?fn (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLTEXCOORD4FVERTEX4FVSUNPROC = ?fn ([*c]const GLfloat, [*c]const GLfloat) callconv(.C) void; pub const PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC = ?fn (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC = ?fn ([*c]const GLfloat, [*c]const GLubyte, [*c]const GLfloat) callconv(.C) void; pub const PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC = ?fn (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC = ?fn ([*c]const GLfloat, [*c]const GLfloat, [*c]const GLfloat) callconv(.C) void; pub const PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC = ?fn (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC = ?fn ([*c]const GLfloat, [*c]const GLfloat, [*c]const GLfloat) callconv(.C) void; pub const PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC = ?fn (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC = ?fn ([*c]const GLfloat, [*c]const GLfloat, [*c]const GLfloat, [*c]const GLfloat) callconv(.C) void; pub const PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC = ?fn (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC = ?fn ([*c]const GLfloat, [*c]const GLfloat, [*c]const GLfloat, [*c]const GLfloat) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC = ?fn (GLuint, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC = ?fn ([*c]const GLuint, [*c]const GLfloat) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC = ?fn (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC = ?fn ([*c]const GLuint, [*c]const GLubyte, [*c]const GLfloat) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC = ?fn (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC = ?fn ([*c]const GLuint, [*c]const GLfloat, [*c]const GLfloat) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC = ?fn (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC = ?fn ([*c]const GLuint, [*c]const GLfloat, [*c]const GLfloat) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC = ?fn (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC = ?fn ([*c]const GLuint, [*c]const GLfloat, [*c]const GLfloat, [*c]const GLfloat) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC = ?fn (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC = ?fn ([*c]const GLuint, [*c]const GLfloat, [*c]const GLfloat) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC = ?fn (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC = ?fn ([*c]const GLuint, [*c]const GLfloat, [*c]const GLfloat, [*c]const GLfloat) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC = ?fn (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat) callconv(.C) void; pub const PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC = ?fn ([*c]const GLuint, [*c]const GLfloat, [*c]const GLfloat, [*c]const GLfloat, [*c]const GLfloat) callconv(.C) void; pub extern fn glBlendEquationSeparateATI(modeRGB: GLenum, modeA: GLenum) void; pub const PFNGLBLENDEQUATIONSEPARATEATIPROC = ?fn (GLenum, GLenum) callconv(.C) void; pub const PFNGLEGLIMAGETARGETTEXTURE2DOESPROC = ?fn (GLenum, GLeglImageOES) callconv(.C) void; pub const PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC = ?fn (GLenum, GLeglImageOES) callconv(.C) void; pub const struct___GLXcontextRec = opaque {}; pub const GLXContext = ?*struct___GLXcontextRec; pub const GLXPixmap = xlib.XID; pub const GLXDrawable = xlib.XID; pub const struct___GLXFBConfigRec = opaque {}; pub const GLXFBConfig = ?*struct___GLXFBConfigRec; pub const GLXFBConfigID = xlib.XID; pub const GLXContextID = xlib.XID; pub const GLXWindow = xlib.XID; pub const GLXPbuffer = xlib.XID; pub extern fn glXChooseVisual(dpy: [*c]xlib.Display, screen: c_int, attribList: [*c]c_int) [*c]xlib.XVisualInfo; pub extern fn glXCreateContext(dpy: [*c]xlib.Display, vis: [*c]xlib.XVisualInfo, shareList: GLXContext, direct: xlib.Bool) GLXContext; pub extern fn glXDestroyContext(dpy: [*c]xlib.Display, ctx: GLXContext) void; pub extern fn glXMakeCurrent(dpy: [*c]xlib.Display, drawable: GLXDrawable, ctx: GLXContext) xlib.Bool; pub extern fn glXCopyContext(dpy: [*c]xlib.Display, src: GLXContext, dst: GLXContext, mask: c_ulong) void; pub extern fn glXSwapBuffers(dpy: [*c]xlib.Display, drawable: GLXDrawable) void; pub extern fn glXCreateGLXPixmap(dpy: [*c]xlib.Display, visual: [*c]xlib.XVisualInfo, pixmap: xlib.Pixmap) GLXPixmap; pub extern fn glXDestroyGLXPixmap(dpy: [*c]xlib.Display, pixmap: GLXPixmap) void; pub extern fn glXQueryExtension(dpy: [*c]xlib.Display, errorb: [*c]c_int, event: [*c]c_int) xlib.Bool; pub extern fn glXQueryVersion(dpy: [*c]xlib.Display, maj: [*c]c_int, min: [*c]c_int) xlib.Bool; pub extern fn glXIsDirect(dpy: [*c]xlib.Display, ctx: GLXContext) xlib.Bool; pub extern fn glXGetConfig(dpy: [*c]xlib.Display, visual: [*c]xlib.XVisualInfo, attrib: c_int, value: [*c]c_int) c_int; pub extern fn glXGetCurrentContext() GLXContext; pub extern fn glXGetCurrentDrawable() GLXDrawable; pub extern fn glXWaitGL() void; pub extern fn glXWaitX() void; pub extern fn glXUseXFont(font: xlib.Font, first: c_int, count: c_int, list: c_int) void; pub extern fn glXQueryExtensionsString(dpy: [*c]xlib.Display, screen: c_int) [*c]const u8; pub extern fn glXQueryServerString(dpy: [*c]xlib.Display, screen: c_int, name: c_int) [*c]const u8; pub extern fn glXGetClientString(dpy: [*c]xlib.Display, name: c_int) [*c]const u8; pub extern fn glXGetCurrentDisplay() [*c]xlib.Display; pub extern fn glXChooseFBConfig(dpy: [*c]xlib.Display, screen: c_int, attribList: [*c]const c_int, nitems: [*c]c_int) [*c]GLXFBConfig; pub extern fn glXGetFBConfigAttrib(dpy: [*c]xlib.Display, config: GLXFBConfig, attribute: c_int, value: [*c]c_int) c_int; pub extern fn glXGetFBConfigs(dpy: [*c]xlib.Display, screen: c_int, nelements: [*c]c_int) [*c]GLXFBConfig; pub extern fn glXGetVisualFromFBConfig(dpy: [*c]xlib.Display, config: GLXFBConfig) [*c]xlib.XVisualInfo; pub extern fn glXCreateWindow(dpy: [*c]xlib.Display, config: GLXFBConfig, win: xlib.Window, attribList: [*c]const c_int) GLXWindow; pub extern fn glXDestroyWindow(dpy: [*c]xlib.Display, window: GLXWindow) void; pub extern fn glXCreatePixmap(dpy: [*c]xlib.Display, config: GLXFBConfig, pixmap: xlib.Pixmap, attribList: [*c]const c_int) GLXPixmap; pub extern fn glXDestroyPixmap(dpy: [*c]xlib.Display, pixmap: GLXPixmap) void; pub extern fn glXCreatePbuffer(dpy: [*c]xlib.Display, config: GLXFBConfig, attribList: [*c]const c_int) GLXPbuffer; pub extern fn glXDestroyPbuffer(dpy: [*c]xlib.Display, pbuf: GLXPbuffer) void; pub extern fn glXQueryDrawable(dpy: [*c]xlib.Display, draw: GLXDrawable, attribute: c_int, value: [*c]c_uint) void; pub extern fn glXCreateNewContext(dpy: [*c]xlib.Display, config: GLXFBConfig, renderType: c_int, shareList: GLXContext, direct: xlib.Bool) GLXContext; pub extern fn glXMakeContextCurrent(dpy: [*c]xlib.Display, draw: GLXDrawable, read: GLXDrawable, ctx: GLXContext) xlib.Bool; pub extern fn glXGetCurrentReadDrawable() GLXDrawable; pub extern fn glXQueryContext(dpy: [*c]xlib.Display, ctx: GLXContext, attribute: c_int, value: [*c]c_int) c_int; pub extern fn glXSelectEvent(dpy: [*c]xlib.Display, drawable: GLXDrawable, mask: c_ulong) void; pub extern fn glXGetSelectedEvent(dpy: [*c]xlib.Display, drawable: GLXDrawable, mask: [*c]c_ulong) void; pub const PFNGLXGETFBCONFIGSPROC = ?fn ([*c]xlib.Display, c_int, [*c]c_int) callconv(.C) [*c]GLXFBConfig; pub const PFNGLXCHOOSEFBCONFIGPROC = ?fn ([*c]xlib.Display, c_int, [*c]const c_int, [*c]c_int) callconv(.C) [*c]GLXFBConfig; pub const PFNGLXGETFBCONFIGATTRIBPROC = ?fn ([*c]xlib.Display, GLXFBConfig, c_int, [*c]c_int) callconv(.C) c_int; pub const PFNGLXGETVISUALFROMFBCONFIGPROC = ?fn ([*c]xlib.Display, GLXFBConfig) callconv(.C) [*c]xlib.XVisualInfo; pub const PFNGLXCREATEWINDOWPROC = ?fn ([*c]xlib.Display, GLXFBConfig, xlib.Window, [*c]const c_int) callconv(.C) GLXWindow; pub const PFNGLXDESTROYWINDOWPROC = ?fn ([*c]xlib.Display, GLXWindow) callconv(.C) void; pub const PFNGLXCREATEPIXMAPPROC = ?fn ([*c]xlib.Display, GLXFBConfig, xlib.Pixmap, [*c]const c_int) callconv(.C) GLXPixmap; pub const PFNGLXDESTROYPIXMAPPROC = ?fn ([*c]xlib.Display, GLXPixmap) callconv(.C) void; pub const PFNGLXCREATEPBUFFERPROC = ?fn ([*c]xlib.Display, GLXFBConfig, [*c]const c_int) callconv(.C) GLXPbuffer; pub const PFNGLXDESTROYPBUFFERPROC = ?fn ([*c]xlib.Display, GLXPbuffer) callconv(.C) void; pub const PFNGLXQUERYDRAWABLEPROC = ?fn ([*c]xlib.Display, GLXDrawable, c_int, [*c]c_uint) callconv(.C) void; pub const PFNGLXCREATENEWCONTEXTPROC = ?fn ([*c]xlib.Display, GLXFBConfig, c_int, GLXContext, xlib.Bool) callconv(.C) GLXContext; pub const PFNGLXMAKECONTEXTCURRENTPROC = ?fn ([*c]xlib.Display, GLXDrawable, GLXDrawable, GLXContext) callconv(.C) xlib.Bool; pub const PFNGLXGETCURRENTREADDRAWABLEPROC = ?fn () callconv(.C) GLXDrawable; pub const PFNGLXGETCURRENTDISPLAYPROC = ?fn () callconv(.C) [*c]xlib.Display; pub const PFNGLXQUERYCONTEXTPROC = ?fn ([*c]xlib.Display, GLXContext, c_int, [*c]c_int) callconv(.C) c_int; pub const PFNGLXSELECTEVENTPROC = ?fn ([*c]xlib.Display, GLXDrawable, c_ulong) callconv(.C) void; pub const PFNGLXGETSELECTEDEVENTPROC = ?fn ([*c]xlib.Display, GLXDrawable, [*c]c_ulong) callconv(.C) void; pub const __GLXextFuncPtr = ?fn () callconv(.C) void; pub extern fn glXGetProcAddressARB([*c]const GLubyte) __GLXextFuncPtr; pub extern fn glXGetProcAddress(procname: [*c]const GLubyte) ?fn () callconv(.C) void; pub const PFNGLXGETPROCADDRESSPROC = ?fn ([*c]const GLubyte) callconv(.C) __GLXextFuncPtr; pub extern fn glXAllocateMemoryNV(size: GLsizei, readfreq: GLfloat, writefreq: GLfloat, priority: GLfloat) ?*anyopaque; pub extern fn glXFreeMemoryNV(pointer: ?*GLvoid) void; pub const PFNGLXALLOCATEMEMORYNVPROC = ?fn (GLsizei, GLfloat, GLfloat, GLfloat) callconv(.C) ?*anyopaque; pub const PFNGLXFREEMEMORYNVPROC = ?fn (?*GLvoid) callconv(.C) void; pub extern fn glXBindTexImageARB(dpy: [*c]xlib.Display, pbuffer: GLXPbuffer, buffer: c_int) xlib.Bool; pub extern fn glXReleaseTexImageARB(dpy: [*c]xlib.Display, pbuffer: GLXPbuffer, buffer: c_int) xlib.Bool; pub extern fn glXDrawableAttribARB(dpy: [*c]xlib.Display, draw: GLXDrawable, attribList: [*c]const c_int) xlib.Bool; pub extern fn glXGetFrameUsageMESA(dpy: [*c]xlib.Display, drawable: GLXDrawable, usage: [*c]f32) c_int; pub extern fn glXBeginFrameTrackingMESA(dpy: [*c]xlib.Display, drawable: GLXDrawable) c_int; pub extern fn glXEndFrameTrackingMESA(dpy: [*c]xlib.Display, drawable: GLXDrawable) c_int; pub extern fn glXQueryFrameTrackingMESA(dpy: [*c]xlib.Display, drawable: GLXDrawable, swapCount: [*c]i64, missedFrames: [*c]i64, lastMissedUsage: [*c]f32) c_int; pub const PFNGLXGETFRAMEUSAGEMESAPROC = ?fn ([*c]xlib.Display, GLXDrawable, [*c]f32) callconv(.C) c_int; pub const PFNGLXBEGINFRAMETRACKINGMESAPROC = ?fn ([*c]xlib.Display, GLXDrawable) callconv(.C) c_int; pub const PFNGLXENDFRAMETRACKINGMESAPROC = ?fn ([*c]xlib.Display, GLXDrawable) callconv(.C) c_int; pub const PFNGLXQUERYFRAMETRACKINGMESAPROC = ?fn ([*c]xlib.Display, GLXDrawable, [*c]i64, [*c]i64, [*c]f32) callconv(.C) c_int; pub extern fn glXSwapIntervalMESA(interval: c_uint) c_int; pub extern fn glXGetSwapIntervalMESA() c_int; pub const PFNGLXSWAPINTERVALMESAPROC = ?fn (c_uint) callconv(.C) c_int; pub const PFNGLXGETSWAPINTERVALMESAPROC = ?fn () callconv(.C) c_int; pub extern fn glXBindTexImageEXT(dpy: [*c]xlib.Display, drawable: GLXDrawable, buffer: c_int, attrib_list: [*c]const c_int) void; pub extern fn glXReleaseTexImageEXT(dpy: [*c]xlib.Display, drawable: GLXDrawable, buffer: c_int) void; pub const GLXPbufferClobberEvent = extern struct { event_type: c_int, draw_type: c_int, serial: c_ulong, send_event: xlib.Bool, display: [*c]xlib.Display, drawable: GLXDrawable, buffer_mask: c_uint, aux_buffer: c_uint, x: c_int, y: c_int, width: c_int, height: c_int, count: c_int, }; pub const GLXBufferSwapComplete = extern struct { type: c_int, serial: c_ulong, send_event: xlib.Bool, display: [*c]xlib.Display, drawable: GLXDrawable, event_type: c_int, ust: i64, msc: i64, sbc: i64, }; pub const union___GLXEvent = extern union { glxpbufferclobber: GLXPbufferClobberEvent, glxbufferswapcomplete: GLXBufferSwapComplete, pad: [24]c_long, }; pub const GLXEvent = union___GLXEvent; pub const GL_VERSION_1_1 = @as(c_int, 1); pub const GL_VERSION_1_2 = @as(c_int, 1); pub const GL_VERSION_1_3 = @as(c_int, 1); pub const GL_ARB_imaging = @as(c_int, 1); pub const GL_FALSE = @as(c_int, 0); pub const GL_TRUE = @as(c_int, 1); pub const GL_BYTE = @as(c_int, 0x1400); pub const GL_UNSIGNED_BYTE = @as(c_int, 0x1401); pub const GL_SHORT = @as(c_int, 0x1402); pub const GL_UNSIGNED_SHORT = @as(c_int, 0x1403); pub const GL_INT = @as(c_int, 0x1404); pub const GL_UNSIGNED_INT = @as(c_int, 0x1405); pub const GL_FLOAT = @as(c_int, 0x1406); pub const GL_2_BYTES = @as(c_int, 0x1407); pub const GL_3_BYTES = @as(c_int, 0x1408); pub const GL_4_BYTES = @as(c_int, 0x1409); pub const GL_DOUBLE = @as(c_int, 0x140A); pub const GL_POINTS = @as(c_int, 0x0000); pub const GL_LINES = @as(c_int, 0x0001); pub const GL_LINE_LOOP = @as(c_int, 0x0002); pub const GL_LINE_STRIP = @as(c_int, 0x0003); pub const GL_TRIANGLES = @as(c_int, 0x0004); pub const GL_TRIANGLE_STRIP = @as(c_int, 0x0005); pub const GL_TRIANGLE_FAN = @as(c_int, 0x0006); pub const GL_QUADS = @as(c_int, 0x0007); pub const GL_QUAD_STRIP = @as(c_int, 0x0008); pub const GL_POLYGON = @as(c_int, 0x0009); pub const GL_VERTEX_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8074, .hexadecimal); pub const GL_NORMAL_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8075, .hexadecimal); pub const GL_COLOR_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8076, .hexadecimal); pub const GL_INDEX_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8077, .hexadecimal); pub const GL_TEXTURE_COORD_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8078, .hexadecimal); pub const GL_EDGE_FLAG_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8079, .hexadecimal); pub const GL_VERTEX_ARRAY_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x807A, .hexadecimal); pub const GL_VERTEX_ARRAY_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x807B, .hexadecimal); pub const GL_VERTEX_ARRAY_STRIDE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x807C, .hexadecimal); pub const GL_NORMAL_ARRAY_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x807E, .hexadecimal); pub const GL_NORMAL_ARRAY_STRIDE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x807F, .hexadecimal); pub const GL_COLOR_ARRAY_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8081, .hexadecimal); pub const GL_COLOR_ARRAY_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8082, .hexadecimal); pub const GL_COLOR_ARRAY_STRIDE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8083, .hexadecimal); pub const GL_INDEX_ARRAY_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8085, .hexadecimal); pub const GL_INDEX_ARRAY_STRIDE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8086, .hexadecimal); pub const GL_TEXTURE_COORD_ARRAY_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8088, .hexadecimal); pub const GL_TEXTURE_COORD_ARRAY_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8089, .hexadecimal); pub const GL_TEXTURE_COORD_ARRAY_STRIDE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x808A, .hexadecimal); pub const GL_EDGE_FLAG_ARRAY_STRIDE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x808C, .hexadecimal); pub const GL_VERTEX_ARRAY_POINTER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x808E, .hexadecimal); pub const GL_NORMAL_ARRAY_POINTER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x808F, .hexadecimal); pub const GL_COLOR_ARRAY_POINTER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8090, .hexadecimal); pub const GL_INDEX_ARRAY_POINTER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8091, .hexadecimal); pub const GL_TEXTURE_COORD_ARRAY_POINTER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8092, .hexadecimal); pub const GL_EDGE_FLAG_ARRAY_POINTER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8093, .hexadecimal); pub const GL_V2F = @as(c_int, 0x2A20); pub const GL_V3F = @as(c_int, 0x2A21); pub const GL_C4UB_V2F = @as(c_int, 0x2A22); pub const GL_C4UB_V3F = @as(c_int, 0x2A23); pub const GL_C3F_V3F = @as(c_int, 0x2A24); pub const GL_N3F_V3F = @as(c_int, 0x2A25); pub const GL_C4F_N3F_V3F = @as(c_int, 0x2A26); pub const GL_T2F_V3F = @as(c_int, 0x2A27); pub const GL_T4F_V4F = @as(c_int, 0x2A28); pub const GL_T2F_C4UB_V3F = @as(c_int, 0x2A29); pub const GL_T2F_C3F_V3F = @as(c_int, 0x2A2A); pub const GL_T2F_N3F_V3F = @as(c_int, 0x2A2B); pub const GL_T2F_C4F_N3F_V3F = @as(c_int, 0x2A2C); pub const GL_T4F_C4F_N3F_V4F = @as(c_int, 0x2A2D); pub const GL_MATRIX_MODE = @as(c_int, 0x0BA0); pub const GL_MODELVIEW = @as(c_int, 0x1700); pub const GL_PROJECTION = @as(c_int, 0x1701); pub const GL_TEXTURE = @as(c_int, 0x1702); pub const GL_POINT_SMOOTH = @as(c_int, 0x0B10); pub const GL_POINT_SIZE = @as(c_int, 0x0B11); pub const GL_POINT_SIZE_GRANULARITY = @as(c_int, 0x0B13); pub const GL_POINT_SIZE_RANGE = @as(c_int, 0x0B12); pub const GL_LINE_SMOOTH = @as(c_int, 0x0B20); pub const GL_LINE_STIPPLE = @as(c_int, 0x0B24); pub const GL_LINE_STIPPLE_PATTERN = @as(c_int, 0x0B25); pub const GL_LINE_STIPPLE_REPEAT = @as(c_int, 0x0B26); pub const GL_LINE_WIDTH = @as(c_int, 0x0B21); pub const GL_LINE_WIDTH_GRANULARITY = @as(c_int, 0x0B23); pub const GL_LINE_WIDTH_RANGE = @as(c_int, 0x0B22); pub const GL_POINT = @as(c_int, 0x1B00); pub const GL_LINE = @as(c_int, 0x1B01); pub const GL_FILL = @as(c_int, 0x1B02); pub const GL_CW = @as(c_int, 0x0900); pub const GL_CCW = @as(c_int, 0x0901); pub const GL_FRONT = @as(c_int, 0x0404); pub const GL_BACK = @as(c_int, 0x0405); pub const GL_POLYGON_MODE = @as(c_int, 0x0B40); pub const GL_POLYGON_SMOOTH = @as(c_int, 0x0B41); pub const GL_POLYGON_STIPPLE = @as(c_int, 0x0B42); pub const GL_EDGE_FLAG = @as(c_int, 0x0B43); pub const GL_CULL_FACE = @as(c_int, 0x0B44); pub const GL_CULL_FACE_MODE = @as(c_int, 0x0B45); pub const GL_FRONT_FACE = @as(c_int, 0x0B46); pub const GL_POLYGON_OFFSET_FACTOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8038, .hexadecimal); pub const GL_POLYGON_OFFSET_UNITS = @as(c_int, 0x2A00); pub const GL_POLYGON_OFFSET_POINT = @as(c_int, 0x2A01); pub const GL_POLYGON_OFFSET_LINE = @as(c_int, 0x2A02); pub const GL_POLYGON_OFFSET_FILL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8037, .hexadecimal); pub const GL_COMPILE = @as(c_int, 0x1300); pub const GL_COMPILE_AND_EXECUTE = @as(c_int, 0x1301); pub const GL_LIST_BASE = @as(c_int, 0x0B32); pub const GL_LIST_INDEX = @as(c_int, 0x0B33); pub const GL_LIST_MODE = @as(c_int, 0x0B30); pub const GL_NEVER = @as(c_int, 0x0200); pub const GL_LESS = @as(c_int, 0x0201); pub const GL_EQUAL = @as(c_int, 0x0202); pub const GL_LEQUAL = @as(c_int, 0x0203); pub const GL_GREATER = @as(c_int, 0x0204); pub const GL_NOTEQUAL = @as(c_int, 0x0205); pub const GL_GEQUAL = @as(c_int, 0x0206); pub const GL_ALWAYS = @as(c_int, 0x0207); pub const GL_DEPTH_TEST = @as(c_int, 0x0B71); pub const GL_DEPTH_BITS = @as(c_int, 0x0D56); pub const GL_DEPTH_CLEAR_VALUE = @as(c_int, 0x0B73); pub const GL_DEPTH_FUNC = @as(c_int, 0x0B74); pub const GL_DEPTH_RANGE = @as(c_int, 0x0B70); pub const GL_DEPTH_WRITEMASK = @as(c_int, 0x0B72); pub const GL_DEPTH_COMPONENT = @as(c_int, 0x1902); pub const GL_LIGHTING = @as(c_int, 0x0B50); pub const GL_LIGHT0 = @as(c_int, 0x4000); pub const GL_LIGHT1 = @as(c_int, 0x4001); pub const GL_LIGHT2 = @as(c_int, 0x4002); pub const GL_LIGHT3 = @as(c_int, 0x4003); pub const GL_LIGHT4 = @as(c_int, 0x4004); pub const GL_LIGHT5 = @as(c_int, 0x4005); pub const GL_LIGHT6 = @as(c_int, 0x4006); pub const GL_LIGHT7 = @as(c_int, 0x4007); pub const GL_SPOT_EXPONENT = @as(c_int, 0x1205); pub const GL_SPOT_CUTOFF = @as(c_int, 0x1206); pub const GL_CONSTANT_ATTENUATION = @as(c_int, 0x1207); pub const GL_LINEAR_ATTENUATION = @as(c_int, 0x1208); pub const GL_QUADRATIC_ATTENUATION = @as(c_int, 0x1209); pub const GL_AMBIENT = @as(c_int, 0x1200); pub const GL_DIFFUSE = @as(c_int, 0x1201); pub const GL_SPECULAR = @as(c_int, 0x1202); pub const GL_SHININESS = @as(c_int, 0x1601); pub const GL_EMISSION = @as(c_int, 0x1600); pub const GL_POSITION = @as(c_int, 0x1203); pub const GL_SPOT_DIRECTION = @as(c_int, 0x1204); pub const GL_AMBIENT_AND_DIFFUSE = @as(c_int, 0x1602); pub const GL_COLOR_INDEXES = @as(c_int, 0x1603); pub const GL_LIGHT_MODEL_TWO_SIDE = @as(c_int, 0x0B52); pub const GL_LIGHT_MODEL_LOCAL_VIEWER = @as(c_int, 0x0B51); pub const GL_LIGHT_MODEL_AMBIENT = @as(c_int, 0x0B53); pub const GL_FRONT_AND_BACK = @as(c_int, 0x0408); pub const GL_SHADE_MODEL = @as(c_int, 0x0B54); pub const GL_FLAT = @as(c_int, 0x1D00); pub const GL_SMOOTH = @as(c_int, 0x1D01); pub const GL_COLOR_MATERIAL = @as(c_int, 0x0B57); pub const GL_COLOR_MATERIAL_FACE = @as(c_int, 0x0B55); pub const GL_COLOR_MATERIAL_PARAMETER = @as(c_int, 0x0B56); pub const GL_NORMALIZE = @as(c_int, 0x0BA1); pub const GL_CLIP_PLANE0 = @as(c_int, 0x3000); pub const GL_CLIP_PLANE1 = @as(c_int, 0x3001); pub const GL_CLIP_PLANE2 = @as(c_int, 0x3002); pub const GL_CLIP_PLANE3 = @as(c_int, 0x3003); pub const GL_CLIP_PLANE4 = @as(c_int, 0x3004); pub const GL_CLIP_PLANE5 = @as(c_int, 0x3005); pub const GL_ACCUM_RED_BITS = @as(c_int, 0x0D58); pub const GL_ACCUM_GREEN_BITS = @as(c_int, 0x0D59); pub const GL_ACCUM_BLUE_BITS = @as(c_int, 0x0D5A); pub const GL_ACCUM_ALPHA_BITS = @as(c_int, 0x0D5B); pub const GL_ACCUM_CLEAR_VALUE = @as(c_int, 0x0B80); pub const GL_ACCUM = @as(c_int, 0x0100); pub const GL_ADD = @as(c_int, 0x0104); pub const GL_LOAD = @as(c_int, 0x0101); pub const GL_MULT = @as(c_int, 0x0103); pub const GL_RETURN = @as(c_int, 0x0102); pub const GL_ALPHA_TEST = @as(c_int, 0x0BC0); pub const GL_ALPHA_TEST_REF = @as(c_int, 0x0BC2); pub const GL_ALPHA_TEST_FUNC = @as(c_int, 0x0BC1); pub const GL_BLEND = @as(c_int, 0x0BE2); pub const GL_BLEND_SRC = @as(c_int, 0x0BE1); pub const GL_BLEND_DST = @as(c_int, 0x0BE0); pub const GL_ZERO = @as(c_int, 0); pub const GL_ONE = @as(c_int, 1); pub const GL_SRC_COLOR = @as(c_int, 0x0300); pub const GL_ONE_MINUS_SRC_COLOR = @as(c_int, 0x0301); pub const GL_SRC_ALPHA = @as(c_int, 0x0302); pub const GL_ONE_MINUS_SRC_ALPHA = @as(c_int, 0x0303); pub const GL_DST_ALPHA = @as(c_int, 0x0304); pub const GL_ONE_MINUS_DST_ALPHA = @as(c_int, 0x0305); pub const GL_DST_COLOR = @as(c_int, 0x0306); pub const GL_ONE_MINUS_DST_COLOR = @as(c_int, 0x0307); pub const GL_SRC_ALPHA_SATURATE = @as(c_int, 0x0308); pub const GL_FEEDBACK = @as(c_int, 0x1C01); pub const GL_RENDER = @as(c_int, 0x1C00); pub const GL_SELECT = @as(c_int, 0x1C02); pub const GL_2D = @as(c_int, 0x0600); pub const GL_3D = @as(c_int, 0x0601); pub const GL_3D_COLOR = @as(c_int, 0x0602); pub const GL_3D_COLOR_TEXTURE = @as(c_int, 0x0603); pub const GL_4D_COLOR_TEXTURE = @as(c_int, 0x0604); pub const GL_POINT_TOKEN = @as(c_int, 0x0701); pub const GL_LINE_TOKEN = @as(c_int, 0x0702); pub const GL_LINE_RESET_TOKEN = @as(c_int, 0x0707); pub const GL_POLYGON_TOKEN = @as(c_int, 0x0703); pub const GL_BITMAP_TOKEN = @as(c_int, 0x0704); pub const GL_DRAW_PIXEL_TOKEN = @as(c_int, 0x0705); pub const GL_COPY_PIXEL_TOKEN = @as(c_int, 0x0706); pub const GL_PASS_THROUGH_TOKEN = @as(c_int, 0x0700); pub const GL_FEEDBACK_BUFFER_POINTER = @as(c_int, 0x0DF0); pub const GL_FEEDBACK_BUFFER_SIZE = @as(c_int, 0x0DF1); pub const GL_FEEDBACK_BUFFER_TYPE = @as(c_int, 0x0DF2); pub const GL_SELECTION_BUFFER_POINTER = @as(c_int, 0x0DF3); pub const GL_SELECTION_BUFFER_SIZE = @as(c_int, 0x0DF4); pub const GL_FOG = @as(c_int, 0x0B60); pub const GL_FOG_MODE = @as(c_int, 0x0B65); pub const GL_FOG_DENSITY = @as(c_int, 0x0B62); pub const GL_FOG_COLOR = @as(c_int, 0x0B66); pub const GL_FOG_INDEX = @as(c_int, 0x0B61); pub const GL_FOG_START = @as(c_int, 0x0B63); pub const GL_FOG_END = @as(c_int, 0x0B64); pub const GL_LINEAR = @as(c_int, 0x2601); pub const GL_EXP = @as(c_int, 0x0800); pub const GL_EXP2 = @as(c_int, 0x0801); pub const GL_LOGIC_OP = @as(c_int, 0x0BF1); pub const GL_INDEX_LOGIC_OP = @as(c_int, 0x0BF1); pub const GL_COLOR_LOGIC_OP = @as(c_int, 0x0BF2); pub const GL_LOGIC_OP_MODE = @as(c_int, 0x0BF0); pub const GL_CLEAR = @as(c_int, 0x1500); pub const GL_SET = @as(c_int, 0x150F); pub const GL_COPY = @as(c_int, 0x1503); pub const GL_COPY_INVERTED = @as(c_int, 0x150C); pub const GL_NOOP = @as(c_int, 0x1505); pub const GL_INVERT = @as(c_int, 0x150A); pub const GL_AND = @as(c_int, 0x1501); pub const GL_NAND = @as(c_int, 0x150E); pub const GL_OR = @as(c_int, 0x1507); pub const GL_NOR = @as(c_int, 0x1508); pub const GL_XOR = @as(c_int, 0x1506); pub const GL_EQUIV = @as(c_int, 0x1509); pub const GL_AND_REVERSE = @as(c_int, 0x1502); pub const GL_AND_INVERTED = @as(c_int, 0x1504); pub const GL_OR_REVERSE = @as(c_int, 0x150B); pub const GL_OR_INVERTED = @as(c_int, 0x150D); pub const GL_STENCIL_BITS = @as(c_int, 0x0D57); pub const GL_STENCIL_TEST = @as(c_int, 0x0B90); pub const GL_STENCIL_CLEAR_VALUE = @as(c_int, 0x0B91); pub const GL_STENCIL_FUNC = @as(c_int, 0x0B92); pub const GL_STENCIL_VALUE_MASK = @as(c_int, 0x0B93); pub const GL_STENCIL_FAIL = @as(c_int, 0x0B94); pub const GL_STENCIL_PASS_DEPTH_FAIL = @as(c_int, 0x0B95); pub const GL_STENCIL_PASS_DEPTH_PASS = @as(c_int, 0x0B96); pub const GL_STENCIL_REF = @as(c_int, 0x0B97); pub const GL_STENCIL_WRITEMASK = @as(c_int, 0x0B98); pub const GL_STENCIL_INDEX = @as(c_int, 0x1901); pub const GL_KEEP = @as(c_int, 0x1E00); pub const GL_REPLACE = @as(c_int, 0x1E01); pub const GL_INCR = @as(c_int, 0x1E02); pub const GL_DECR = @as(c_int, 0x1E03); pub const GL_NONE = @as(c_int, 0); pub const GL_LEFT = @as(c_int, 0x0406); pub const GL_RIGHT = @as(c_int, 0x0407); pub const GL_FRONT_LEFT = @as(c_int, 0x0400); pub const GL_FRONT_RIGHT = @as(c_int, 0x0401); pub const GL_BACK_LEFT = @as(c_int, 0x0402); pub const GL_BACK_RIGHT = @as(c_int, 0x0403); pub const GL_AUX0 = @as(c_int, 0x0409); pub const GL_AUX1 = @as(c_int, 0x040A); pub const GL_AUX2 = @as(c_int, 0x040B); pub const GL_AUX3 = @as(c_int, 0x040C); pub const GL_COLOR_INDEX = @as(c_int, 0x1900); pub const GL_RED = @as(c_int, 0x1903); pub const GL_GREEN = @as(c_int, 0x1904); pub const GL_BLUE = @as(c_int, 0x1905); pub const GL_ALPHA = @as(c_int, 0x1906); pub const GL_LUMINANCE = @as(c_int, 0x1909); pub const GL_LUMINANCE_ALPHA = @as(c_int, 0x190A); pub const GL_ALPHA_BITS = @as(c_int, 0x0D55); pub const GL_RED_BITS = @as(c_int, 0x0D52); pub const GL_GREEN_BITS = @as(c_int, 0x0D53); pub const GL_BLUE_BITS = @as(c_int, 0x0D54); pub const GL_INDEX_BITS = @as(c_int, 0x0D51); pub const GL_SUBPIXEL_BITS = @as(c_int, 0x0D50); pub const GL_AUX_BUFFERS = @as(c_int, 0x0C00); pub const GL_READ_BUFFER = @as(c_int, 0x0C02); pub const GL_DRAW_BUFFER = @as(c_int, 0x0C01); pub const GL_DOUBLEBUFFER = @as(c_int, 0x0C32); pub const GL_STEREO = @as(c_int, 0x0C33); pub const GL_BITMAP = @as(c_int, 0x1A00); pub const GL_COLOR = @as(c_int, 0x1800); pub const GL_DEPTH = @as(c_int, 0x1801); pub const GL_STENCIL = @as(c_int, 0x1802); pub const GL_DITHER = @as(c_int, 0x0BD0); pub const GL_RGB = @as(c_int, 0x1907); pub const GL_RGBA = @as(c_int, 0x1908); pub const GL_MAX_LIST_NESTING = @as(c_int, 0x0B31); pub const GL_MAX_EVAL_ORDER = @as(c_int, 0x0D30); pub const GL_MAX_LIGHTS = @as(c_int, 0x0D31); pub const GL_MAX_CLIP_PLANES = @as(c_int, 0x0D32); pub const GL_MAX_TEXTURE_SIZE = @as(c_int, 0x0D33); pub const GL_MAX_PIXEL_MAP_TABLE = @as(c_int, 0x0D34); pub const GL_MAX_ATTRIB_STACK_DEPTH = @as(c_int, 0x0D35); pub const GL_MAX_MODELVIEW_STACK_DEPTH = @as(c_int, 0x0D36); pub const GL_MAX_NAME_STACK_DEPTH = @as(c_int, 0x0D37); pub const GL_MAX_PROJECTION_STACK_DEPTH = @as(c_int, 0x0D38); pub const GL_MAX_TEXTURE_STACK_DEPTH = @as(c_int, 0x0D39); pub const GL_MAX_VIEWPORT_DIMS = @as(c_int, 0x0D3A); pub const GL_MAX_CLIENT_ATTRIB_STACK_DEPTH = @as(c_int, 0x0D3B); pub const GL_ATTRIB_STACK_DEPTH = @as(c_int, 0x0BB0); pub const GL_CLIENT_ATTRIB_STACK_DEPTH = @as(c_int, 0x0BB1); pub const GL_COLOR_CLEAR_VALUE = @as(c_int, 0x0C22); pub const GL_COLOR_WRITEMASK = @as(c_int, 0x0C23); pub const GL_CURRENT_INDEX = @as(c_int, 0x0B01); pub const GL_CURRENT_COLOR = @as(c_int, 0x0B00); pub const GL_CURRENT_NORMAL = @as(c_int, 0x0B02); pub const GL_CURRENT_RASTER_COLOR = @as(c_int, 0x0B04); pub const GL_CURRENT_RASTER_DISTANCE = @as(c_int, 0x0B09); pub const GL_CURRENT_RASTER_INDEX = @as(c_int, 0x0B05); pub const GL_CURRENT_RASTER_POSITION = @as(c_int, 0x0B07); pub const GL_CURRENT_RASTER_TEXTURE_COORDS = @as(c_int, 0x0B06); pub const GL_CURRENT_RASTER_POSITION_VALID = @as(c_int, 0x0B08); pub const GL_CURRENT_TEXTURE_COORDS = @as(c_int, 0x0B03); pub const GL_INDEX_CLEAR_VALUE = @as(c_int, 0x0C20); pub const GL_INDEX_MODE = @as(c_int, 0x0C30); pub const GL_INDEX_WRITEMASK = @as(c_int, 0x0C21); pub const GL_MODELVIEW_MATRIX = @as(c_int, 0x0BA6); pub const GL_MODELVIEW_STACK_DEPTH = @as(c_int, 0x0BA3); pub const GL_NAME_STACK_DEPTH = @as(c_int, 0x0D70); pub const GL_PROJECTION_MATRIX = @as(c_int, 0x0BA7); pub const GL_PROJECTION_STACK_DEPTH = @as(c_int, 0x0BA4); pub const GL_RENDER_MODE = @as(c_int, 0x0C40); pub const GL_RGBA_MODE = @as(c_int, 0x0C31); pub const GL_TEXTURE_MATRIX = @as(c_int, 0x0BA8); pub const GL_TEXTURE_STACK_DEPTH = @as(c_int, 0x0BA5); pub const GL_VIEWPORT = @as(c_int, 0x0BA2); pub const GL_AUTO_NORMAL = @as(c_int, 0x0D80); pub const GL_MAP1_COLOR_4 = @as(c_int, 0x0D90); pub const GL_MAP1_INDEX = @as(c_int, 0x0D91); pub const GL_MAP1_NORMAL = @as(c_int, 0x0D92); pub const GL_MAP1_TEXTURE_COORD_1 = @as(c_int, 0x0D93); pub const GL_MAP1_TEXTURE_COORD_2 = @as(c_int, 0x0D94); pub const GL_MAP1_TEXTURE_COORD_3 = @as(c_int, 0x0D95); pub const GL_MAP1_TEXTURE_COORD_4 = @as(c_int, 0x0D96); pub const GL_MAP1_VERTEX_3 = @as(c_int, 0x0D97); pub const GL_MAP1_VERTEX_4 = @as(c_int, 0x0D98); pub const GL_MAP2_COLOR_4 = @as(c_int, 0x0DB0); pub const GL_MAP2_INDEX = @as(c_int, 0x0DB1); pub const GL_MAP2_NORMAL = @as(c_int, 0x0DB2); pub const GL_MAP2_TEXTURE_COORD_1 = @as(c_int, 0x0DB3); pub const GL_MAP2_TEXTURE_COORD_2 = @as(c_int, 0x0DB4); pub const GL_MAP2_TEXTURE_COORD_3 = @as(c_int, 0x0DB5); pub const GL_MAP2_TEXTURE_COORD_4 = @as(c_int, 0x0DB6); pub const GL_MAP2_VERTEX_3 = @as(c_int, 0x0DB7); pub const GL_MAP2_VERTEX_4 = @as(c_int, 0x0DB8); pub const GL_MAP1_GRID_DOMAIN = @as(c_int, 0x0DD0); pub const GL_MAP1_GRID_SEGMENTS = @as(c_int, 0x0DD1); pub const GL_MAP2_GRID_DOMAIN = @as(c_int, 0x0DD2); pub const GL_MAP2_GRID_SEGMENTS = @as(c_int, 0x0DD3); pub const GL_COEFF = @as(c_int, 0x0A00); pub const GL_ORDER = @as(c_int, 0x0A01); pub const GL_DOMAIN = @as(c_int, 0x0A02); pub const GL_PERSPECTIVE_CORRECTION_HINT = @as(c_int, 0x0C50); pub const GL_POINT_SMOOTH_HINT = @as(c_int, 0x0C51); pub const GL_LINE_SMOOTH_HINT = @as(c_int, 0x0C52); pub const GL_POLYGON_SMOOTH_HINT = @as(c_int, 0x0C53); pub const GL_FOG_HINT = @as(c_int, 0x0C54); pub const GL_DONT_CARE = @as(c_int, 0x1100); pub const GL_FASTEST = @as(c_int, 0x1101); pub const GL_NICEST = @as(c_int, 0x1102); pub const GL_SCISSOR_BOX = @as(c_int, 0x0C10); pub const GL_SCISSOR_TEST = @as(c_int, 0x0C11); pub const GL_MAP_COLOR = @as(c_int, 0x0D10); pub const GL_MAP_STENCIL = @as(c_int, 0x0D11); pub const GL_INDEX_SHIFT = @as(c_int, 0x0D12); pub const GL_INDEX_OFFSET = @as(c_int, 0x0D13); pub const GL_RED_SCALE = @as(c_int, 0x0D14); pub const GL_RED_BIAS = @as(c_int, 0x0D15); pub const GL_GREEN_SCALE = @as(c_int, 0x0D18); pub const GL_GREEN_BIAS = @as(c_int, 0x0D19); pub const GL_BLUE_SCALE = @as(c_int, 0x0D1A); pub const GL_BLUE_BIAS = @as(c_int, 0x0D1B); pub const GL_ALPHA_SCALE = @as(c_int, 0x0D1C); pub const GL_ALPHA_BIAS = @as(c_int, 0x0D1D); pub const GL_DEPTH_SCALE = @as(c_int, 0x0D1E); pub const GL_DEPTH_BIAS = @as(c_int, 0x0D1F); pub const GL_PIXEL_MAP_S_TO_S_SIZE = @as(c_int, 0x0CB1); pub const GL_PIXEL_MAP_I_TO_I_SIZE = @as(c_int, 0x0CB0); pub const GL_PIXEL_MAP_I_TO_R_SIZE = @as(c_int, 0x0CB2); pub const GL_PIXEL_MAP_I_TO_G_SIZE = @as(c_int, 0x0CB3); pub const GL_PIXEL_MAP_I_TO_B_SIZE = @as(c_int, 0x0CB4); pub const GL_PIXEL_MAP_I_TO_A_SIZE = @as(c_int, 0x0CB5); pub const GL_PIXEL_MAP_R_TO_R_SIZE = @as(c_int, 0x0CB6); pub const GL_PIXEL_MAP_G_TO_G_SIZE = @as(c_int, 0x0CB7); pub const GL_PIXEL_MAP_B_TO_B_SIZE = @as(c_int, 0x0CB8); pub const GL_PIXEL_MAP_A_TO_A_SIZE = @as(c_int, 0x0CB9); pub const GL_PIXEL_MAP_S_TO_S = @as(c_int, 0x0C71); pub const GL_PIXEL_MAP_I_TO_I = @as(c_int, 0x0C70); pub const GL_PIXEL_MAP_I_TO_R = @as(c_int, 0x0C72); pub const GL_PIXEL_MAP_I_TO_G = @as(c_int, 0x0C73); pub const GL_PIXEL_MAP_I_TO_B = @as(c_int, 0x0C74); pub const GL_PIXEL_MAP_I_TO_A = @as(c_int, 0x0C75); pub const GL_PIXEL_MAP_R_TO_R = @as(c_int, 0x0C76); pub const GL_PIXEL_MAP_G_TO_G = @as(c_int, 0x0C77); pub const GL_PIXEL_MAP_B_TO_B = @as(c_int, 0x0C78); pub const GL_PIXEL_MAP_A_TO_A = @as(c_int, 0x0C79); pub const GL_PACK_ALIGNMENT = @as(c_int, 0x0D05); pub const GL_PACK_LSB_FIRST = @as(c_int, 0x0D01); pub const GL_PACK_ROW_LENGTH = @as(c_int, 0x0D02); pub const GL_PACK_SKIP_PIXELS = @as(c_int, 0x0D04); pub const GL_PACK_SKIP_ROWS = @as(c_int, 0x0D03); pub const GL_PACK_SWAP_BYTES = @as(c_int, 0x0D00); pub const GL_UNPACK_ALIGNMENT = @as(c_int, 0x0CF5); pub const GL_UNPACK_LSB_FIRST = @as(c_int, 0x0CF1); pub const GL_UNPACK_ROW_LENGTH = @as(c_int, 0x0CF2); pub const GL_UNPACK_SKIP_PIXELS = @as(c_int, 0x0CF4); pub const GL_UNPACK_SKIP_ROWS = @as(c_int, 0x0CF3); pub const GL_UNPACK_SWAP_BYTES = @as(c_int, 0x0CF0); pub const GL_ZOOM_X = @as(c_int, 0x0D16); pub const GL_ZOOM_Y = @as(c_int, 0x0D17); pub const GL_TEXTURE_ENV = @as(c_int, 0x2300); pub const GL_TEXTURE_ENV_MODE = @as(c_int, 0x2200); pub const GL_TEXTURE_1D = @as(c_int, 0x0DE0); pub const GL_TEXTURE_2D = @as(c_int, 0x0DE1); pub const GL_TEXTURE_WRAP_S = @as(c_int, 0x2802); pub const GL_TEXTURE_WRAP_T = @as(c_int, 0x2803); pub const GL_TEXTURE_MAG_FILTER = @as(c_int, 0x2800); pub const GL_TEXTURE_MIN_FILTER = @as(c_int, 0x2801); pub const GL_TEXTURE_ENV_COLOR = @as(c_int, 0x2201); pub const GL_TEXTURE_GEN_S = @as(c_int, 0x0C60); pub const GL_TEXTURE_GEN_T = @as(c_int, 0x0C61); pub const GL_TEXTURE_GEN_R = @as(c_int, 0x0C62); pub const GL_TEXTURE_GEN_Q = @as(c_int, 0x0C63); pub const GL_TEXTURE_GEN_MODE = @as(c_int, 0x2500); pub const GL_TEXTURE_BORDER_COLOR = @as(c_int, 0x1004); pub const GL_TEXTURE_WIDTH = @as(c_int, 0x1000); pub const GL_TEXTURE_HEIGHT = @as(c_int, 0x1001); pub const GL_TEXTURE_BORDER = @as(c_int, 0x1005); pub const GL_TEXTURE_COMPONENTS = @as(c_int, 0x1003); pub const GL_TEXTURE_RED_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x805C, .hexadecimal); pub const GL_TEXTURE_GREEN_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x805D, .hexadecimal); pub const GL_TEXTURE_BLUE_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x805E, .hexadecimal); pub const GL_TEXTURE_ALPHA_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x805F, .hexadecimal); pub const GL_TEXTURE_LUMINANCE_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8060, .hexadecimal); pub const GL_TEXTURE_INTENSITY_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8061, .hexadecimal); pub const GL_NEAREST_MIPMAP_NEAREST = @as(c_int, 0x2700); pub const GL_NEAREST_MIPMAP_LINEAR = @as(c_int, 0x2702); pub const GL_LINEAR_MIPMAP_NEAREST = @as(c_int, 0x2701); pub const GL_LINEAR_MIPMAP_LINEAR = @as(c_int, 0x2703); pub const GL_OBJECT_LINEAR = @as(c_int, 0x2401); pub const GL_OBJECT_PLANE = @as(c_int, 0x2501); pub const GL_EYE_LINEAR = @as(c_int, 0x2400); pub const GL_EYE_PLANE = @as(c_int, 0x2502); pub const GL_SPHERE_MAP = @as(c_int, 0x2402); pub const GL_DECAL = @as(c_int, 0x2101); pub const GL_MODULATE = @as(c_int, 0x2100); pub const GL_NEAREST = @as(c_int, 0x2600); pub const GL_REPEAT = @as(c_int, 0x2901); pub const GL_CLAMP = @as(c_int, 0x2900); pub const GL_S = @as(c_int, 0x2000); pub const GL_T = @as(c_int, 0x2001); pub const GL_R = @as(c_int, 0x2002); pub const GL_Q = @as(c_int, 0x2003); pub const GL_VENDOR = @as(c_int, 0x1F00); pub const GL_RENDERER = @as(c_int, 0x1F01); pub const GL_VERSION = @as(c_int, 0x1F02); pub const GL_EXTENSIONS = @as(c_int, 0x1F03); pub const GL_NO_ERROR = @as(c_int, 0); pub const GL_INVALID_ENUM = @as(c_int, 0x0500); pub const GL_INVALID_VALUE = @as(c_int, 0x0501); pub const GL_INVALID_OPERATION = @as(c_int, 0x0502); pub const GL_STACK_OVERFLOW = @as(c_int, 0x0503); pub const GL_STACK_UNDERFLOW = @as(c_int, 0x0504); pub const GL_OUT_OF_MEMORY = @as(c_int, 0x0505); pub const GL_CURRENT_BIT = @as(c_int, 0x00000001); pub const GL_POINT_BIT = @as(c_int, 0x00000002); pub const GL_LINE_BIT = @as(c_int, 0x00000004); pub const GL_POLYGON_BIT = @as(c_int, 0x00000008); pub const GL_POLYGON_STIPPLE_BIT = @as(c_int, 0x00000010); pub const GL_PIXEL_MODE_BIT = @as(c_int, 0x00000020); pub const GL_LIGHTING_BIT = @as(c_int, 0x00000040); pub const GL_FOG_BIT = @as(c_int, 0x00000080); pub const GL_DEPTH_BUFFER_BIT = @as(c_int, 0x00000100); pub const GL_ACCUM_BUFFER_BIT = @as(c_int, 0x00000200); pub const GL_STENCIL_BUFFER_BIT = @as(c_int, 0x00000400); pub const GL_VIEWPORT_BIT = @as(c_int, 0x00000800); pub const GL_TRANSFORM_BIT = @as(c_int, 0x00001000); pub const GL_ENABLE_BIT = @as(c_int, 0x00002000); pub const GL_COLOR_BUFFER_BIT = @as(c_int, 0x00004000); pub const GL_HINT_BIT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00008000, .hexadecimal); pub const GL_EVAL_BIT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00010000, .hexadecimal); pub const GL_LIST_BIT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00020000, .hexadecimal); pub const GL_TEXTURE_BIT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00040000, .hexadecimal); pub const GL_SCISSOR_BIT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00080000, .hexadecimal); pub const GL_ALL_ATTRIB_BITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0xFFFFFFFF, .hexadecimal); pub const GL_PROXY_TEXTURE_1D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8063, .hexadecimal); pub const GL_PROXY_TEXTURE_2D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8064, .hexadecimal); pub const GL_TEXTURE_PRIORITY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8066, .hexadecimal); pub const GL_TEXTURE_RESIDENT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8067, .hexadecimal); pub const GL_TEXTURE_BINDING_1D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8068, .hexadecimal); pub const GL_TEXTURE_BINDING_2D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8069, .hexadecimal); pub const GL_TEXTURE_INTERNAL_FORMAT = @as(c_int, 0x1003); pub const GL_ALPHA4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x803B, .hexadecimal); pub const GL_ALPHA8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x803C, .hexadecimal); pub const GL_ALPHA12 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x803D, .hexadecimal); pub const GL_ALPHA16 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x803E, .hexadecimal); pub const GL_LUMINANCE4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x803F, .hexadecimal); pub const GL_LUMINANCE8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8040, .hexadecimal); pub const GL_LUMINANCE12 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8041, .hexadecimal); pub const GL_LUMINANCE16 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8042, .hexadecimal); pub const GL_LUMINANCE4_ALPHA4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8043, .hexadecimal); pub const GL_LUMINANCE6_ALPHA2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8044, .hexadecimal); pub const GL_LUMINANCE8_ALPHA8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8045, .hexadecimal); pub const GL_LUMINANCE12_ALPHA4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8046, .hexadecimal); pub const GL_LUMINANCE12_ALPHA12 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8047, .hexadecimal); pub const GL_LUMINANCE16_ALPHA16 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8048, .hexadecimal); pub const GL_INTENSITY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8049, .hexadecimal); pub const GL_INTENSITY4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x804A, .hexadecimal); pub const GL_INTENSITY8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x804B, .hexadecimal); pub const GL_INTENSITY12 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x804C, .hexadecimal); pub const GL_INTENSITY16 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x804D, .hexadecimal); pub const GL_R3_G3_B2 = @as(c_int, 0x2A10); pub const GL_RGB4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x804F, .hexadecimal); pub const GL_RGB5 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8050, .hexadecimal); pub const GL_RGB8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8051, .hexadecimal); pub const GL_RGB10 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8052, .hexadecimal); pub const GL_RGB12 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8053, .hexadecimal); pub const GL_RGB16 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8054, .hexadecimal); pub const GL_RGBA2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8055, .hexadecimal); pub const GL_RGBA4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8056, .hexadecimal); pub const GL_RGB5_A1 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8057, .hexadecimal); pub const GL_RGBA8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8058, .hexadecimal); pub const GL_RGB10_A2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8059, .hexadecimal); pub const GL_RGBA12 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x805A, .hexadecimal); pub const GL_RGBA16 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x805B, .hexadecimal); pub const GL_CLIENT_PIXEL_STORE_BIT = @as(c_int, 0x00000001); pub const GL_CLIENT_VERTEX_ARRAY_BIT = @as(c_int, 0x00000002); pub const GL_ALL_CLIENT_ATTRIB_BITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0xFFFFFFFF, .hexadecimal); pub const GL_CLIENT_ALL_ATTRIB_BITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0xFFFFFFFF, .hexadecimal); pub const GL_RESCALE_NORMAL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x803A, .hexadecimal); pub const GL_CLAMP_TO_EDGE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x812F, .hexadecimal); pub const GL_MAX_ELEMENTS_VERTICES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80E8, .hexadecimal); pub const GL_MAX_ELEMENTS_INDICES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80E9, .hexadecimal); pub const GL_BGR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80E0, .hexadecimal); pub const GL_BGRA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80E1, .hexadecimal); pub const GL_UNSIGNED_BYTE_3_3_2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8032, .hexadecimal); pub const GL_UNSIGNED_BYTE_2_3_3_REV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8362, .hexadecimal); pub const GL_UNSIGNED_SHORT_5_6_5 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8363, .hexadecimal); pub const GL_UNSIGNED_SHORT_5_6_5_REV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8364, .hexadecimal); pub const GL_UNSIGNED_SHORT_4_4_4_4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8033, .hexadecimal); pub const GL_UNSIGNED_SHORT_4_4_4_4_REV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8365, .hexadecimal); pub const GL_UNSIGNED_SHORT_5_5_5_1 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8034, .hexadecimal); pub const GL_UNSIGNED_SHORT_1_5_5_5_REV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8366, .hexadecimal); pub const GL_UNSIGNED_INT_8_8_8_8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8035, .hexadecimal); pub const GL_UNSIGNED_INT_8_8_8_8_REV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8367, .hexadecimal); pub const GL_UNSIGNED_INT_10_10_10_2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8036, .hexadecimal); pub const GL_UNSIGNED_INT_2_10_10_10_REV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8368, .hexadecimal); pub const GL_LIGHT_MODEL_COLOR_CONTROL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81F8, .hexadecimal); pub const GL_SINGLE_COLOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81F9, .hexadecimal); pub const GL_SEPARATE_SPECULAR_COLOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81FA, .hexadecimal); pub const GL_TEXTURE_MIN_LOD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x813A, .hexadecimal); pub const GL_TEXTURE_MAX_LOD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x813B, .hexadecimal); pub const GL_TEXTURE_BASE_LEVEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x813C, .hexadecimal); pub const GL_TEXTURE_MAX_LEVEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x813D, .hexadecimal); pub const GL_SMOOTH_POINT_SIZE_RANGE = @as(c_int, 0x0B12); pub const GL_SMOOTH_POINT_SIZE_GRANULARITY = @as(c_int, 0x0B13); pub const GL_SMOOTH_LINE_WIDTH_RANGE = @as(c_int, 0x0B22); pub const GL_SMOOTH_LINE_WIDTH_GRANULARITY = @as(c_int, 0x0B23); pub const GL_ALIASED_POINT_SIZE_RANGE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x846D, .hexadecimal); pub const GL_ALIASED_LINE_WIDTH_RANGE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x846E, .hexadecimal); pub const GL_PACK_SKIP_IMAGES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x806B, .hexadecimal); pub const GL_PACK_IMAGE_HEIGHT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x806C, .hexadecimal); pub const GL_UNPACK_SKIP_IMAGES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x806D, .hexadecimal); pub const GL_UNPACK_IMAGE_HEIGHT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x806E, .hexadecimal); pub const GL_TEXTURE_3D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x806F, .hexadecimal); pub const GL_PROXY_TEXTURE_3D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8070, .hexadecimal); pub const GL_TEXTURE_DEPTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8071, .hexadecimal); pub const GL_TEXTURE_WRAP_R = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8072, .hexadecimal); pub const GL_MAX_3D_TEXTURE_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8073, .hexadecimal); pub const GL_TEXTURE_BINDING_3D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x806A, .hexadecimal); pub const GL_CONSTANT_COLOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8001, .hexadecimal); pub const GL_ONE_MINUS_CONSTANT_COLOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8002, .hexadecimal); pub const GL_CONSTANT_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8003, .hexadecimal); pub const GL_ONE_MINUS_CONSTANT_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8004, .hexadecimal); pub const GL_COLOR_TABLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80D0, .hexadecimal); pub const GL_POST_CONVOLUTION_COLOR_TABLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80D1, .hexadecimal); pub const GL_POST_COLOR_MATRIX_COLOR_TABLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80D2, .hexadecimal); pub const GL_PROXY_COLOR_TABLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80D3, .hexadecimal); pub const GL_PROXY_POST_CONVOLUTION_COLOR_TABLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80D4, .hexadecimal); pub const GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80D5, .hexadecimal); pub const GL_COLOR_TABLE_SCALE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80D6, .hexadecimal); pub const GL_COLOR_TABLE_BIAS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80D7, .hexadecimal); pub const GL_COLOR_TABLE_FORMAT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80D8, .hexadecimal); pub const GL_COLOR_TABLE_WIDTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80D9, .hexadecimal); pub const GL_COLOR_TABLE_RED_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80DA, .hexadecimal); pub const GL_COLOR_TABLE_GREEN_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80DB, .hexadecimal); pub const GL_COLOR_TABLE_BLUE_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80DC, .hexadecimal); pub const GL_COLOR_TABLE_ALPHA_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80DD, .hexadecimal); pub const GL_COLOR_TABLE_LUMINANCE_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80DE, .hexadecimal); pub const GL_COLOR_TABLE_INTENSITY_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80DF, .hexadecimal); pub const GL_CONVOLUTION_1D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8010, .hexadecimal); pub const GL_CONVOLUTION_2D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8011, .hexadecimal); pub const GL_SEPARABLE_2D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8012, .hexadecimal); pub const GL_CONVOLUTION_BORDER_MODE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8013, .hexadecimal); pub const GL_CONVOLUTION_FILTER_SCALE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8014, .hexadecimal); pub const GL_CONVOLUTION_FILTER_BIAS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8015, .hexadecimal); pub const GL_REDUCE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8016, .hexadecimal); pub const GL_CONVOLUTION_FORMAT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8017, .hexadecimal); pub const GL_CONVOLUTION_WIDTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8018, .hexadecimal); pub const GL_CONVOLUTION_HEIGHT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8019, .hexadecimal); pub const GL_MAX_CONVOLUTION_WIDTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x801A, .hexadecimal); pub const GL_MAX_CONVOLUTION_HEIGHT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x801B, .hexadecimal); pub const GL_POST_CONVOLUTION_RED_SCALE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x801C, .hexadecimal); pub const GL_POST_CONVOLUTION_GREEN_SCALE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x801D, .hexadecimal); pub const GL_POST_CONVOLUTION_BLUE_SCALE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x801E, .hexadecimal); pub const GL_POST_CONVOLUTION_ALPHA_SCALE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x801F, .hexadecimal); pub const GL_POST_CONVOLUTION_RED_BIAS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8020, .hexadecimal); pub const GL_POST_CONVOLUTION_GREEN_BIAS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8021, .hexadecimal); pub const GL_POST_CONVOLUTION_BLUE_BIAS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8022, .hexadecimal); pub const GL_POST_CONVOLUTION_ALPHA_BIAS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8023, .hexadecimal); pub const GL_CONSTANT_BORDER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8151, .hexadecimal); pub const GL_REPLICATE_BORDER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8153, .hexadecimal); pub const GL_CONVOLUTION_BORDER_COLOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8154, .hexadecimal); pub const GL_COLOR_MATRIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80B1, .hexadecimal); pub const GL_COLOR_MATRIX_STACK_DEPTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80B2, .hexadecimal); pub const GL_MAX_COLOR_MATRIX_STACK_DEPTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80B3, .hexadecimal); pub const GL_POST_COLOR_MATRIX_RED_SCALE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80B4, .hexadecimal); pub const GL_POST_COLOR_MATRIX_GREEN_SCALE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80B5, .hexadecimal); pub const GL_POST_COLOR_MATRIX_BLUE_SCALE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80B6, .hexadecimal); pub const GL_POST_COLOR_MATRIX_ALPHA_SCALE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80B7, .hexadecimal); pub const GL_POST_COLOR_MATRIX_RED_BIAS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80B8, .hexadecimal); pub const GL_POST_COLOR_MATRIX_GREEN_BIAS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80B9, .hexadecimal); pub const GL_POST_COLOR_MATRIX_BLUE_BIAS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80BA, .hexadecimal); pub const GL_POST_COLOR_MATRIX_ALPHA_BIAS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80BB, .hexadecimal); pub const GL_HISTOGRAM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8024, .hexadecimal); pub const GL_PROXY_HISTOGRAM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8025, .hexadecimal); pub const GL_HISTOGRAM_WIDTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8026, .hexadecimal); pub const GL_HISTOGRAM_FORMAT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8027, .hexadecimal); pub const GL_HISTOGRAM_RED_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8028, .hexadecimal); pub const GL_HISTOGRAM_GREEN_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8029, .hexadecimal); pub const GL_HISTOGRAM_BLUE_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x802A, .hexadecimal); pub const GL_HISTOGRAM_ALPHA_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x802B, .hexadecimal); pub const GL_HISTOGRAM_LUMINANCE_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x802C, .hexadecimal); pub const GL_HISTOGRAM_SINK = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x802D, .hexadecimal); pub const GL_MINMAX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x802E, .hexadecimal); pub const GL_MINMAX_FORMAT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x802F, .hexadecimal); pub const GL_MINMAX_SINK = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8030, .hexadecimal); pub const GL_TABLE_TOO_LARGE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8031, .hexadecimal); pub const GL_BLEND_EQUATION = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8009, .hexadecimal); pub const GL_MIN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8007, .hexadecimal); pub const GL_MAX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8008, .hexadecimal); pub const GL_FUNC_ADD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8006, .hexadecimal); pub const GL_FUNC_SUBTRACT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x800A, .hexadecimal); pub const GL_FUNC_REVERSE_SUBTRACT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x800B, .hexadecimal); pub const GL_BLEND_COLOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8005, .hexadecimal); pub const GL_TEXTURE0 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84C0, .hexadecimal); pub const GL_TEXTURE1 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84C1, .hexadecimal); pub const GL_TEXTURE2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84C2, .hexadecimal); pub const GL_TEXTURE3 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84C3, .hexadecimal); pub const GL_TEXTURE4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84C4, .hexadecimal); pub const GL_TEXTURE5 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84C5, .hexadecimal); pub const GL_TEXTURE6 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84C6, .hexadecimal); pub const GL_TEXTURE7 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84C7, .hexadecimal); pub const GL_TEXTURE8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84C8, .hexadecimal); pub const GL_TEXTURE9 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84C9, .hexadecimal); pub const GL_TEXTURE10 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84CA, .hexadecimal); pub const GL_TEXTURE11 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84CB, .hexadecimal); pub const GL_TEXTURE12 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84CC, .hexadecimal); pub const GL_TEXTURE13 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84CD, .hexadecimal); pub const GL_TEXTURE14 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84CE, .hexadecimal); pub const GL_TEXTURE15 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84CF, .hexadecimal); pub const GL_TEXTURE16 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84D0, .hexadecimal); pub const GL_TEXTURE17 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84D1, .hexadecimal); pub const GL_TEXTURE18 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84D2, .hexadecimal); pub const GL_TEXTURE19 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84D3, .hexadecimal); pub const GL_TEXTURE20 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84D4, .hexadecimal); pub const GL_TEXTURE21 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84D5, .hexadecimal); pub const GL_TEXTURE22 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84D6, .hexadecimal); pub const GL_TEXTURE23 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84D7, .hexadecimal); pub const GL_TEXTURE24 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84D8, .hexadecimal); pub const GL_TEXTURE25 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84D9, .hexadecimal); pub const GL_TEXTURE26 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84DA, .hexadecimal); pub const GL_TEXTURE27 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84DB, .hexadecimal); pub const GL_TEXTURE28 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84DC, .hexadecimal); pub const GL_TEXTURE29 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84DD, .hexadecimal); pub const GL_TEXTURE30 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84DE, .hexadecimal); pub const GL_TEXTURE31 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84DF, .hexadecimal); pub const GL_ACTIVE_TEXTURE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E0, .hexadecimal); pub const GL_CLIENT_ACTIVE_TEXTURE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E1, .hexadecimal); pub const GL_MAX_TEXTURE_UNITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E2, .hexadecimal); pub const GL_NORMAL_MAP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8511, .hexadecimal); pub const GL_REFLECTION_MAP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8512, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8513, .hexadecimal); pub const GL_TEXTURE_BINDING_CUBE_MAP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8514, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_POSITIVE_X = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8515, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_X = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8516, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_POSITIVE_Y = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8517, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8518, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_POSITIVE_Z = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8519, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x851A, .hexadecimal); pub const GL_PROXY_TEXTURE_CUBE_MAP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x851B, .hexadecimal); pub const GL_MAX_CUBE_MAP_TEXTURE_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x851C, .hexadecimal); pub const GL_COMPRESSED_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E9, .hexadecimal); pub const GL_COMPRESSED_LUMINANCE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84EA, .hexadecimal); pub const GL_COMPRESSED_LUMINANCE_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84EB, .hexadecimal); pub const GL_COMPRESSED_INTENSITY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84EC, .hexadecimal); pub const GL_COMPRESSED_RGB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84ED, .hexadecimal); pub const GL_COMPRESSED_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84EE, .hexadecimal); pub const GL_TEXTURE_COMPRESSION_HINT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84EF, .hexadecimal); pub const GL_TEXTURE_COMPRESSED_IMAGE_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86A0, .hexadecimal); pub const GL_TEXTURE_COMPRESSED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86A1, .hexadecimal); pub const GL_NUM_COMPRESSED_TEXTURE_FORMATS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86A2, .hexadecimal); pub const GL_COMPRESSED_TEXTURE_FORMATS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86A3, .hexadecimal); pub const GL_MULTISAMPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x809D, .hexadecimal); pub const GL_SAMPLE_ALPHA_TO_COVERAGE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x809E, .hexadecimal); pub const GL_SAMPLE_ALPHA_TO_ONE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x809F, .hexadecimal); pub const GL_SAMPLE_COVERAGE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A0, .hexadecimal); pub const GL_SAMPLE_BUFFERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A8, .hexadecimal); pub const GL_SAMPLES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A9, .hexadecimal); pub const GL_SAMPLE_COVERAGE_VALUE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80AA, .hexadecimal); pub const GL_SAMPLE_COVERAGE_INVERT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80AB, .hexadecimal); pub const GL_MULTISAMPLE_BIT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x20000000, .hexadecimal); pub const GL_TRANSPOSE_MODELVIEW_MATRIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E3, .hexadecimal); pub const GL_TRANSPOSE_PROJECTION_MATRIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E4, .hexadecimal); pub const GL_TRANSPOSE_TEXTURE_MATRIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E5, .hexadecimal); pub const GL_TRANSPOSE_COLOR_MATRIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E6, .hexadecimal); pub const GL_COMBINE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8570, .hexadecimal); pub const GL_COMBINE_RGB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8571, .hexadecimal); pub const GL_COMBINE_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8572, .hexadecimal); pub const GL_SOURCE0_RGB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8580, .hexadecimal); pub const GL_SOURCE1_RGB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8581, .hexadecimal); pub const GL_SOURCE2_RGB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8582, .hexadecimal); pub const GL_SOURCE0_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8588, .hexadecimal); pub const GL_SOURCE1_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8589, .hexadecimal); pub const GL_SOURCE2_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x858A, .hexadecimal); pub const GL_OPERAND0_RGB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8590, .hexadecimal); pub const GL_OPERAND1_RGB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8591, .hexadecimal); pub const GL_OPERAND2_RGB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8592, .hexadecimal); pub const GL_OPERAND0_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8598, .hexadecimal); pub const GL_OPERAND1_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8599, .hexadecimal); pub const GL_OPERAND2_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x859A, .hexadecimal); pub const GL_RGB_SCALE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8573, .hexadecimal); pub const GL_ADD_SIGNED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8574, .hexadecimal); pub const GL_INTERPOLATE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8575, .hexadecimal); pub const GL_SUBTRACT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E7, .hexadecimal); pub const GL_CONSTANT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8576, .hexadecimal); pub const GL_PRIMARY_COLOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8577, .hexadecimal); pub const GL_PREVIOUS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8578, .hexadecimal); pub const GL_DOT3_RGB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86AE, .hexadecimal); pub const GL_DOT3_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86AF, .hexadecimal); pub const GL_CLAMP_TO_BORDER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x812D, .hexadecimal); pub const GL_ARB_multitexture = @as(c_int, 1); pub const GL_TEXTURE0_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84C0, .hexadecimal); pub const GL_TEXTURE1_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84C1, .hexadecimal); pub const GL_TEXTURE2_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84C2, .hexadecimal); pub const GL_TEXTURE3_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84C3, .hexadecimal); pub const GL_TEXTURE4_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84C4, .hexadecimal); pub const GL_TEXTURE5_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84C5, .hexadecimal); pub const GL_TEXTURE6_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84C6, .hexadecimal); pub const GL_TEXTURE7_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84C7, .hexadecimal); pub const GL_TEXTURE8_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84C8, .hexadecimal); pub const GL_TEXTURE9_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84C9, .hexadecimal); pub const GL_TEXTURE10_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84CA, .hexadecimal); pub const GL_TEXTURE11_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84CB, .hexadecimal); pub const GL_TEXTURE12_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84CC, .hexadecimal); pub const GL_TEXTURE13_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84CD, .hexadecimal); pub const GL_TEXTURE14_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84CE, .hexadecimal); pub const GL_TEXTURE15_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84CF, .hexadecimal); pub const GL_TEXTURE16_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84D0, .hexadecimal); pub const GL_TEXTURE17_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84D1, .hexadecimal); pub const GL_TEXTURE18_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84D2, .hexadecimal); pub const GL_TEXTURE19_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84D3, .hexadecimal); pub const GL_TEXTURE20_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84D4, .hexadecimal); pub const GL_TEXTURE21_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84D5, .hexadecimal); pub const GL_TEXTURE22_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84D6, .hexadecimal); pub const GL_TEXTURE23_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84D7, .hexadecimal); pub const GL_TEXTURE24_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84D8, .hexadecimal); pub const GL_TEXTURE25_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84D9, .hexadecimal); pub const GL_TEXTURE26_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84DA, .hexadecimal); pub const GL_TEXTURE27_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84DB, .hexadecimal); pub const GL_TEXTURE28_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84DC, .hexadecimal); pub const GL_TEXTURE29_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84DD, .hexadecimal); pub const GL_TEXTURE30_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84DE, .hexadecimal); pub const GL_TEXTURE31_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84DF, .hexadecimal); pub const GL_ACTIVE_TEXTURE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E0, .hexadecimal); pub const GL_CLIENT_ACTIVE_TEXTURE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E1, .hexadecimal); pub const GL_MAX_TEXTURE_UNITS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E2, .hexadecimal); pub const __gl_glext_h_ = @as(c_int, 1); pub const GL_GLEXT_VERSION = @import("std").zig.c_translation.promoteIntLiteral(c_int, 20190805, .decimal); pub const GL_VERSION_1_4 = @as(c_int, 1); pub const GL_BLEND_DST_RGB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80C8, .hexadecimal); pub const GL_BLEND_SRC_RGB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80C9, .hexadecimal); pub const GL_BLEND_DST_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80CA, .hexadecimal); pub const GL_BLEND_SRC_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80CB, .hexadecimal); pub const GL_POINT_FADE_THRESHOLD_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8128, .hexadecimal); pub const GL_DEPTH_COMPONENT16 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81A5, .hexadecimal); pub const GL_DEPTH_COMPONENT24 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81A6, .hexadecimal); pub const GL_DEPTH_COMPONENT32 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81A7, .hexadecimal); pub const GL_MIRRORED_REPEAT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8370, .hexadecimal); pub const GL_MAX_TEXTURE_LOD_BIAS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84FD, .hexadecimal); pub const GL_TEXTURE_LOD_BIAS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8501, .hexadecimal); pub const GL_INCR_WRAP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8507, .hexadecimal); pub const GL_DECR_WRAP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8508, .hexadecimal); pub const GL_TEXTURE_DEPTH_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x884A, .hexadecimal); pub const GL_TEXTURE_COMPARE_MODE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x884C, .hexadecimal); pub const GL_TEXTURE_COMPARE_FUNC = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x884D, .hexadecimal); pub const GL_POINT_SIZE_MIN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8126, .hexadecimal); pub const GL_POINT_SIZE_MAX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8127, .hexadecimal); pub const GL_POINT_DISTANCE_ATTENUATION = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8129, .hexadecimal); pub const GL_GENERATE_MIPMAP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8191, .hexadecimal); pub const GL_GENERATE_MIPMAP_HINT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8192, .hexadecimal); pub const GL_FOG_COORDINATE_SOURCE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8450, .hexadecimal); pub const GL_FOG_COORDINATE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8451, .hexadecimal); pub const GL_FRAGMENT_DEPTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8452, .hexadecimal); pub const GL_CURRENT_FOG_COORDINATE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8453, .hexadecimal); pub const GL_FOG_COORDINATE_ARRAY_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8454, .hexadecimal); pub const GL_FOG_COORDINATE_ARRAY_STRIDE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8455, .hexadecimal); pub const GL_FOG_COORDINATE_ARRAY_POINTER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8456, .hexadecimal); pub const GL_FOG_COORDINATE_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8457, .hexadecimal); pub const GL_COLOR_SUM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8458, .hexadecimal); pub const GL_CURRENT_SECONDARY_COLOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8459, .hexadecimal); pub const GL_SECONDARY_COLOR_ARRAY_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x845A, .hexadecimal); pub const GL_SECONDARY_COLOR_ARRAY_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x845B, .hexadecimal); pub const GL_SECONDARY_COLOR_ARRAY_STRIDE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x845C, .hexadecimal); pub const GL_SECONDARY_COLOR_ARRAY_POINTER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x845D, .hexadecimal); pub const GL_SECONDARY_COLOR_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x845E, .hexadecimal); pub const GL_TEXTURE_FILTER_CONTROL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8500, .hexadecimal); pub const GL_DEPTH_TEXTURE_MODE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x884B, .hexadecimal); pub const GL_COMPARE_R_TO_TEXTURE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x884E, .hexadecimal); pub const GL_VERSION_1_5 = @as(c_int, 1); pub const GL_BUFFER_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8764, .hexadecimal); pub const GL_BUFFER_USAGE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8765, .hexadecimal); pub const GL_QUERY_COUNTER_BITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8864, .hexadecimal); pub const GL_CURRENT_QUERY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8865, .hexadecimal); pub const GL_QUERY_RESULT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8866, .hexadecimal); pub const GL_QUERY_RESULT_AVAILABLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8867, .hexadecimal); pub const GL_ARRAY_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8892, .hexadecimal); pub const GL_ELEMENT_ARRAY_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8893, .hexadecimal); pub const GL_ARRAY_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8894, .hexadecimal); pub const GL_ELEMENT_ARRAY_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8895, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x889F, .hexadecimal); pub const GL_READ_ONLY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88B8, .hexadecimal); pub const GL_WRITE_ONLY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88B9, .hexadecimal); pub const GL_READ_WRITE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88BA, .hexadecimal); pub const GL_BUFFER_ACCESS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88BB, .hexadecimal); pub const GL_BUFFER_MAPPED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88BC, .hexadecimal); pub const GL_BUFFER_MAP_POINTER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88BD, .hexadecimal); pub const GL_STREAM_DRAW = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88E0, .hexadecimal); pub const GL_STREAM_READ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88E1, .hexadecimal); pub const GL_STREAM_COPY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88E2, .hexadecimal); pub const GL_STATIC_DRAW = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88E4, .hexadecimal); pub const GL_STATIC_READ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88E5, .hexadecimal); pub const GL_STATIC_COPY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88E6, .hexadecimal); pub const GL_DYNAMIC_DRAW = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88E8, .hexadecimal); pub const GL_DYNAMIC_READ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88E9, .hexadecimal); pub const GL_DYNAMIC_COPY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88EA, .hexadecimal); pub const GL_SAMPLES_PASSED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8914, .hexadecimal); pub const GL_SRC1_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8589, .hexadecimal); pub const GL_VERTEX_ARRAY_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8896, .hexadecimal); pub const GL_NORMAL_ARRAY_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8897, .hexadecimal); pub const GL_COLOR_ARRAY_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8898, .hexadecimal); pub const GL_INDEX_ARRAY_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8899, .hexadecimal); pub const GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x889A, .hexadecimal); pub const GL_EDGE_FLAG_ARRAY_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x889B, .hexadecimal); pub const GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x889C, .hexadecimal); pub const GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x889D, .hexadecimal); pub const GL_WEIGHT_ARRAY_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x889E, .hexadecimal); pub const GL_FOG_COORD_SRC = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8450, .hexadecimal); pub const GL_FOG_COORD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8451, .hexadecimal); pub const GL_CURRENT_FOG_COORD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8453, .hexadecimal); pub const GL_FOG_COORD_ARRAY_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8454, .hexadecimal); pub const GL_FOG_COORD_ARRAY_STRIDE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8455, .hexadecimal); pub const GL_FOG_COORD_ARRAY_POINTER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8456, .hexadecimal); pub const GL_FOG_COORD_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8457, .hexadecimal); pub const GL_FOG_COORD_ARRAY_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x889D, .hexadecimal); pub const GL_SRC0_RGB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8580, .hexadecimal); pub const GL_SRC1_RGB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8581, .hexadecimal); pub const GL_SRC2_RGB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8582, .hexadecimal); pub const GL_SRC0_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8588, .hexadecimal); pub const GL_SRC2_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x858A, .hexadecimal); pub const GL_VERSION_2_0 = @as(c_int, 1); pub const GL_BLEND_EQUATION_RGB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8009, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY_ENABLED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8622, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8623, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY_STRIDE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8624, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8625, .hexadecimal); pub const GL_CURRENT_VERTEX_ATTRIB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8626, .hexadecimal); pub const GL_VERTEX_PROGRAM_POINT_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8642, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY_POINTER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8645, .hexadecimal); pub const GL_STENCIL_BACK_FUNC = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8800, .hexadecimal); pub const GL_STENCIL_BACK_FAIL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8801, .hexadecimal); pub const GL_STENCIL_BACK_PASS_DEPTH_FAIL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8802, .hexadecimal); pub const GL_STENCIL_BACK_PASS_DEPTH_PASS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8803, .hexadecimal); pub const GL_MAX_DRAW_BUFFERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8824, .hexadecimal); pub const GL_DRAW_BUFFER0 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8825, .hexadecimal); pub const GL_DRAW_BUFFER1 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8826, .hexadecimal); pub const GL_DRAW_BUFFER2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8827, .hexadecimal); pub const GL_DRAW_BUFFER3 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8828, .hexadecimal); pub const GL_DRAW_BUFFER4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8829, .hexadecimal); pub const GL_DRAW_BUFFER5 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x882A, .hexadecimal); pub const GL_DRAW_BUFFER6 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x882B, .hexadecimal); pub const GL_DRAW_BUFFER7 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x882C, .hexadecimal); pub const GL_DRAW_BUFFER8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x882D, .hexadecimal); pub const GL_DRAW_BUFFER9 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x882E, .hexadecimal); pub const GL_DRAW_BUFFER10 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x882F, .hexadecimal); pub const GL_DRAW_BUFFER11 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8830, .hexadecimal); pub const GL_DRAW_BUFFER12 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8831, .hexadecimal); pub const GL_DRAW_BUFFER13 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8832, .hexadecimal); pub const GL_DRAW_BUFFER14 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8833, .hexadecimal); pub const GL_DRAW_BUFFER15 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8834, .hexadecimal); pub const GL_BLEND_EQUATION_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x883D, .hexadecimal); pub const GL_MAX_VERTEX_ATTRIBS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8869, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x886A, .hexadecimal); pub const GL_MAX_TEXTURE_IMAGE_UNITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8872, .hexadecimal); pub const GL_FRAGMENT_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B30, .hexadecimal); pub const GL_VERTEX_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B31, .hexadecimal); pub const GL_MAX_FRAGMENT_UNIFORM_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B49, .hexadecimal); pub const GL_MAX_VERTEX_UNIFORM_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B4A, .hexadecimal); pub const GL_MAX_VARYING_FLOATS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B4B, .hexadecimal); pub const GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B4C, .hexadecimal); pub const GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B4D, .hexadecimal); pub const GL_SHADER_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B4F, .hexadecimal); pub const GL_FLOAT_VEC2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B50, .hexadecimal); pub const GL_FLOAT_VEC3 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B51, .hexadecimal); pub const GL_FLOAT_VEC4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B52, .hexadecimal); pub const GL_INT_VEC2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B53, .hexadecimal); pub const GL_INT_VEC3 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B54, .hexadecimal); pub const GL_INT_VEC4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B55, .hexadecimal); pub const GL_BOOL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B56, .hexadecimal); pub const GL_BOOL_VEC2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B57, .hexadecimal); pub const GL_BOOL_VEC3 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B58, .hexadecimal); pub const GL_BOOL_VEC4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B59, .hexadecimal); pub const GL_FLOAT_MAT2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B5A, .hexadecimal); pub const GL_FLOAT_MAT3 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B5B, .hexadecimal); pub const GL_FLOAT_MAT4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B5C, .hexadecimal); pub const GL_SAMPLER_1D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B5D, .hexadecimal); pub const GL_SAMPLER_2D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B5E, .hexadecimal); pub const GL_SAMPLER_3D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B5F, .hexadecimal); pub const GL_SAMPLER_CUBE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B60, .hexadecimal); pub const GL_SAMPLER_1D_SHADOW = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B61, .hexadecimal); pub const GL_SAMPLER_2D_SHADOW = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B62, .hexadecimal); pub const GL_DELETE_STATUS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B80, .hexadecimal); pub const GL_COMPILE_STATUS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B81, .hexadecimal); pub const GL_LINK_STATUS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B82, .hexadecimal); pub const GL_VALIDATE_STATUS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B83, .hexadecimal); pub const GL_INFO_LOG_LENGTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B84, .hexadecimal); pub const GL_ATTACHED_SHADERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B85, .hexadecimal); pub const GL_ACTIVE_UNIFORMS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B86, .hexadecimal); pub const GL_ACTIVE_UNIFORM_MAX_LENGTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B87, .hexadecimal); pub const GL_SHADER_SOURCE_LENGTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B88, .hexadecimal); pub const GL_ACTIVE_ATTRIBUTES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B89, .hexadecimal); pub const GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B8A, .hexadecimal); pub const GL_FRAGMENT_SHADER_DERIVATIVE_HINT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B8B, .hexadecimal); pub const GL_SHADING_LANGUAGE_VERSION = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B8C, .hexadecimal); pub const GL_CURRENT_PROGRAM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B8D, .hexadecimal); pub const GL_POINT_SPRITE_COORD_ORIGIN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CA0, .hexadecimal); pub const GL_LOWER_LEFT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CA1, .hexadecimal); pub const GL_UPPER_LEFT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CA2, .hexadecimal); pub const GL_STENCIL_BACK_REF = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CA3, .hexadecimal); pub const GL_STENCIL_BACK_VALUE_MASK = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CA4, .hexadecimal); pub const GL_STENCIL_BACK_WRITEMASK = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CA5, .hexadecimal); pub const GL_VERTEX_PROGRAM_TWO_SIDE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8643, .hexadecimal); pub const GL_POINT_SPRITE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8861, .hexadecimal); pub const GL_COORD_REPLACE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8862, .hexadecimal); pub const GL_MAX_TEXTURE_COORDS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8871, .hexadecimal); pub const GL_VERSION_2_1 = @as(c_int, 1); pub const GL_PIXEL_PACK_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88EB, .hexadecimal); pub const GL_PIXEL_UNPACK_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88EC, .hexadecimal); pub const GL_PIXEL_PACK_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88ED, .hexadecimal); pub const GL_PIXEL_UNPACK_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88EF, .hexadecimal); pub const GL_FLOAT_MAT2x3 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B65, .hexadecimal); pub const GL_FLOAT_MAT2x4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B66, .hexadecimal); pub const GL_FLOAT_MAT3x2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B67, .hexadecimal); pub const GL_FLOAT_MAT3x4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B68, .hexadecimal); pub const GL_FLOAT_MAT4x2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B69, .hexadecimal); pub const GL_FLOAT_MAT4x3 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B6A, .hexadecimal); pub const GL_SRGB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C40, .hexadecimal); pub const GL_SRGB8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C41, .hexadecimal); pub const GL_SRGB_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C42, .hexadecimal); pub const GL_SRGB8_ALPHA8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C43, .hexadecimal); pub const GL_COMPRESSED_SRGB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C48, .hexadecimal); pub const GL_COMPRESSED_SRGB_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C49, .hexadecimal); pub const GL_CURRENT_RASTER_SECONDARY_COLOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x845F, .hexadecimal); pub const GL_SLUMINANCE_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C44, .hexadecimal); pub const GL_SLUMINANCE8_ALPHA8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C45, .hexadecimal); pub const GL_SLUMINANCE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C46, .hexadecimal); pub const GL_SLUMINANCE8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C47, .hexadecimal); pub const GL_COMPRESSED_SLUMINANCE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C4A, .hexadecimal); pub const GL_COMPRESSED_SLUMINANCE_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C4B, .hexadecimal); pub const GL_VERSION_3_0 = @as(c_int, 1); pub const GL_COMPARE_REF_TO_TEXTURE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x884E, .hexadecimal); pub const GL_CLIP_DISTANCE0 = @as(c_int, 0x3000); pub const GL_CLIP_DISTANCE1 = @as(c_int, 0x3001); pub const GL_CLIP_DISTANCE2 = @as(c_int, 0x3002); pub const GL_CLIP_DISTANCE3 = @as(c_int, 0x3003); pub const GL_CLIP_DISTANCE4 = @as(c_int, 0x3004); pub const GL_CLIP_DISTANCE5 = @as(c_int, 0x3005); pub const GL_CLIP_DISTANCE6 = @as(c_int, 0x3006); pub const GL_CLIP_DISTANCE7 = @as(c_int, 0x3007); pub const GL_MAX_CLIP_DISTANCES = @as(c_int, 0x0D32); pub const GL_MAJOR_VERSION = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x821B, .hexadecimal); pub const GL_MINOR_VERSION = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x821C, .hexadecimal); pub const GL_NUM_EXTENSIONS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x821D, .hexadecimal); pub const GL_CONTEXT_FLAGS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x821E, .hexadecimal); pub const GL_COMPRESSED_RED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8225, .hexadecimal); pub const GL_COMPRESSED_RG = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8226, .hexadecimal); pub const GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = @as(c_int, 0x00000001); pub const GL_RGBA32F = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8814, .hexadecimal); pub const GL_RGB32F = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8815, .hexadecimal); pub const GL_RGBA16F = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x881A, .hexadecimal); pub const GL_RGB16F = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x881B, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY_INTEGER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88FD, .hexadecimal); pub const GL_MAX_ARRAY_TEXTURE_LAYERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88FF, .hexadecimal); pub const GL_MIN_PROGRAM_TEXEL_OFFSET = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8904, .hexadecimal); pub const GL_MAX_PROGRAM_TEXEL_OFFSET = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8905, .hexadecimal); pub const GL_CLAMP_READ_COLOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x891C, .hexadecimal); pub const GL_FIXED_ONLY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x891D, .hexadecimal); pub const GL_MAX_VARYING_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B4B, .hexadecimal); pub const GL_TEXTURE_1D_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C18, .hexadecimal); pub const GL_PROXY_TEXTURE_1D_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C19, .hexadecimal); pub const GL_TEXTURE_2D_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C1A, .hexadecimal); pub const GL_PROXY_TEXTURE_2D_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C1B, .hexadecimal); pub const GL_TEXTURE_BINDING_1D_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C1C, .hexadecimal); pub const GL_TEXTURE_BINDING_2D_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C1D, .hexadecimal); pub const GL_R11F_G11F_B10F = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C3A, .hexadecimal); pub const GL_UNSIGNED_INT_10F_11F_11F_REV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C3B, .hexadecimal); pub const GL_RGB9_E5 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C3D, .hexadecimal); pub const GL_UNSIGNED_INT_5_9_9_9_REV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C3E, .hexadecimal); pub const GL_TEXTURE_SHARED_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C3F, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C76, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BUFFER_MODE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C7F, .hexadecimal); pub const GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C80, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_VARYINGS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C83, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BUFFER_START = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C84, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BUFFER_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C85, .hexadecimal); pub const GL_PRIMITIVES_GENERATED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C87, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C88, .hexadecimal); pub const GL_RASTERIZER_DISCARD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C89, .hexadecimal); pub const GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C8A, .hexadecimal); pub const GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C8B, .hexadecimal); pub const GL_INTERLEAVED_ATTRIBS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C8C, .hexadecimal); pub const GL_SEPARATE_ATTRIBS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C8D, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C8E, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C8F, .hexadecimal); pub const GL_RGBA32UI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D70, .hexadecimal); pub const GL_RGB32UI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D71, .hexadecimal); pub const GL_RGBA16UI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D76, .hexadecimal); pub const GL_RGB16UI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D77, .hexadecimal); pub const GL_RGBA8UI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D7C, .hexadecimal); pub const GL_RGB8UI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D7D, .hexadecimal); pub const GL_RGBA32I = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D82, .hexadecimal); pub const GL_RGB32I = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D83, .hexadecimal); pub const GL_RGBA16I = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D88, .hexadecimal); pub const GL_RGB16I = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D89, .hexadecimal); pub const GL_RGBA8I = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D8E, .hexadecimal); pub const GL_RGB8I = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D8F, .hexadecimal); pub const GL_RED_INTEGER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D94, .hexadecimal); pub const GL_GREEN_INTEGER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D95, .hexadecimal); pub const GL_BLUE_INTEGER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D96, .hexadecimal); pub const GL_RGB_INTEGER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D98, .hexadecimal); pub const GL_RGBA_INTEGER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D99, .hexadecimal); pub const GL_BGR_INTEGER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D9A, .hexadecimal); pub const GL_BGRA_INTEGER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D9B, .hexadecimal); pub const GL_SAMPLER_1D_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DC0, .hexadecimal); pub const GL_SAMPLER_2D_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DC1, .hexadecimal); pub const GL_SAMPLER_1D_ARRAY_SHADOW = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DC3, .hexadecimal); pub const GL_SAMPLER_2D_ARRAY_SHADOW = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DC4, .hexadecimal); pub const GL_SAMPLER_CUBE_SHADOW = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DC5, .hexadecimal); pub const GL_UNSIGNED_INT_VEC2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DC6, .hexadecimal); pub const GL_UNSIGNED_INT_VEC3 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DC7, .hexadecimal); pub const GL_UNSIGNED_INT_VEC4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DC8, .hexadecimal); pub const GL_INT_SAMPLER_1D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DC9, .hexadecimal); pub const GL_INT_SAMPLER_2D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DCA, .hexadecimal); pub const GL_INT_SAMPLER_3D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DCB, .hexadecimal); pub const GL_INT_SAMPLER_CUBE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DCC, .hexadecimal); pub const GL_INT_SAMPLER_1D_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DCE, .hexadecimal); pub const GL_INT_SAMPLER_2D_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DCF, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_1D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DD1, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_2D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DD2, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_3D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DD3, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_CUBE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DD4, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_1D_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DD6, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_2D_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DD7, .hexadecimal); pub const GL_QUERY_WAIT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E13, .hexadecimal); pub const GL_QUERY_NO_WAIT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E14, .hexadecimal); pub const GL_QUERY_BY_REGION_WAIT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E15, .hexadecimal); pub const GL_QUERY_BY_REGION_NO_WAIT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E16, .hexadecimal); pub const GL_BUFFER_ACCESS_FLAGS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x911F, .hexadecimal); pub const GL_BUFFER_MAP_LENGTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9120, .hexadecimal); pub const GL_BUFFER_MAP_OFFSET = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9121, .hexadecimal); pub const GL_DEPTH_COMPONENT32F = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CAC, .hexadecimal); pub const GL_DEPTH32F_STENCIL8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CAD, .hexadecimal); pub const GL_FLOAT_32_UNSIGNED_INT_24_8_REV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DAD, .hexadecimal); pub const GL_INVALID_FRAMEBUFFER_OPERATION = @as(c_int, 0x0506); pub const GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8210, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8211, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8212, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8213, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8214, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8215, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8216, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8217, .hexadecimal); pub const GL_FRAMEBUFFER_DEFAULT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8218, .hexadecimal); pub const GL_FRAMEBUFFER_UNDEFINED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8219, .hexadecimal); pub const GL_DEPTH_STENCIL_ATTACHMENT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x821A, .hexadecimal); pub const GL_MAX_RENDERBUFFER_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E8, .hexadecimal); pub const GL_DEPTH_STENCIL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84F9, .hexadecimal); pub const GL_UNSIGNED_INT_24_8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84FA, .hexadecimal); pub const GL_DEPTH24_STENCIL8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88F0, .hexadecimal); pub const GL_TEXTURE_STENCIL_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88F1, .hexadecimal); pub const GL_TEXTURE_RED_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C10, .hexadecimal); pub const GL_TEXTURE_GREEN_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C11, .hexadecimal); pub const GL_TEXTURE_BLUE_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C12, .hexadecimal); pub const GL_TEXTURE_ALPHA_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C13, .hexadecimal); pub const GL_TEXTURE_DEPTH_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C16, .hexadecimal); pub const GL_UNSIGNED_NORMALIZED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C17, .hexadecimal); pub const GL_FRAMEBUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CA6, .hexadecimal); pub const GL_DRAW_FRAMEBUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CA6, .hexadecimal); pub const GL_RENDERBUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CA7, .hexadecimal); pub const GL_READ_FRAMEBUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CA8, .hexadecimal); pub const GL_DRAW_FRAMEBUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CA9, .hexadecimal); pub const GL_READ_FRAMEBUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CAA, .hexadecimal); pub const GL_RENDERBUFFER_SAMPLES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CAB, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CD0, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CD1, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CD2, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CD3, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CD4, .hexadecimal); pub const GL_FRAMEBUFFER_COMPLETE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CD5, .hexadecimal); pub const GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CD6, .hexadecimal); pub const GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CD7, .hexadecimal); pub const GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CDB, .hexadecimal); pub const GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CDC, .hexadecimal); pub const GL_FRAMEBUFFER_UNSUPPORTED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CDD, .hexadecimal); pub const GL_MAX_COLOR_ATTACHMENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CDF, .hexadecimal); pub const GL_COLOR_ATTACHMENT0 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CE0, .hexadecimal); pub const GL_COLOR_ATTACHMENT1 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CE1, .hexadecimal); pub const GL_COLOR_ATTACHMENT2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CE2, .hexadecimal); pub const GL_COLOR_ATTACHMENT3 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CE3, .hexadecimal); pub const GL_COLOR_ATTACHMENT4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CE4, .hexadecimal); pub const GL_COLOR_ATTACHMENT5 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CE5, .hexadecimal); pub const GL_COLOR_ATTACHMENT6 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CE6, .hexadecimal); pub const GL_COLOR_ATTACHMENT7 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CE7, .hexadecimal); pub const GL_COLOR_ATTACHMENT8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CE8, .hexadecimal); pub const GL_COLOR_ATTACHMENT9 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CE9, .hexadecimal); pub const GL_COLOR_ATTACHMENT10 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CEA, .hexadecimal); pub const GL_COLOR_ATTACHMENT11 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CEB, .hexadecimal); pub const GL_COLOR_ATTACHMENT12 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CEC, .hexadecimal); pub const GL_COLOR_ATTACHMENT13 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CED, .hexadecimal); pub const GL_COLOR_ATTACHMENT14 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CEE, .hexadecimal); pub const GL_COLOR_ATTACHMENT15 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CEF, .hexadecimal); pub const GL_COLOR_ATTACHMENT16 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CF0, .hexadecimal); pub const GL_COLOR_ATTACHMENT17 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CF1, .hexadecimal); pub const GL_COLOR_ATTACHMENT18 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CF2, .hexadecimal); pub const GL_COLOR_ATTACHMENT19 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CF3, .hexadecimal); pub const GL_COLOR_ATTACHMENT20 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CF4, .hexadecimal); pub const GL_COLOR_ATTACHMENT21 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CF5, .hexadecimal); pub const GL_COLOR_ATTACHMENT22 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CF6, .hexadecimal); pub const GL_COLOR_ATTACHMENT23 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CF7, .hexadecimal); pub const GL_COLOR_ATTACHMENT24 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CF8, .hexadecimal); pub const GL_COLOR_ATTACHMENT25 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CF9, .hexadecimal); pub const GL_COLOR_ATTACHMENT26 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CFA, .hexadecimal); pub const GL_COLOR_ATTACHMENT27 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CFB, .hexadecimal); pub const GL_COLOR_ATTACHMENT28 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CFC, .hexadecimal); pub const GL_COLOR_ATTACHMENT29 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CFD, .hexadecimal); pub const GL_COLOR_ATTACHMENT30 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CFE, .hexadecimal); pub const GL_COLOR_ATTACHMENT31 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CFF, .hexadecimal); pub const GL_DEPTH_ATTACHMENT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D00, .hexadecimal); pub const GL_STENCIL_ATTACHMENT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D20, .hexadecimal); pub const GL_FRAMEBUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D40, .hexadecimal); pub const GL_RENDERBUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D41, .hexadecimal); pub const GL_RENDERBUFFER_WIDTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D42, .hexadecimal); pub const GL_RENDERBUFFER_HEIGHT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D43, .hexadecimal); pub const GL_RENDERBUFFER_INTERNAL_FORMAT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D44, .hexadecimal); pub const GL_STENCIL_INDEX1 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D46, .hexadecimal); pub const GL_STENCIL_INDEX4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D47, .hexadecimal); pub const GL_STENCIL_INDEX8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D48, .hexadecimal); pub const GL_STENCIL_INDEX16 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D49, .hexadecimal); pub const GL_RENDERBUFFER_RED_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D50, .hexadecimal); pub const GL_RENDERBUFFER_GREEN_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D51, .hexadecimal); pub const GL_RENDERBUFFER_BLUE_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D52, .hexadecimal); pub const GL_RENDERBUFFER_ALPHA_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D53, .hexadecimal); pub const GL_RENDERBUFFER_DEPTH_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D54, .hexadecimal); pub const GL_RENDERBUFFER_STENCIL_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D55, .hexadecimal); pub const GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D56, .hexadecimal); pub const GL_MAX_SAMPLES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D57, .hexadecimal); pub const GL_INDEX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8222, .hexadecimal); pub const GL_TEXTURE_LUMINANCE_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C14, .hexadecimal); pub const GL_TEXTURE_INTENSITY_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C15, .hexadecimal); pub const GL_FRAMEBUFFER_SRGB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DB9, .hexadecimal); pub const GL_HALF_FLOAT = @as(c_int, 0x140B); pub const GL_MAP_READ_BIT = @as(c_int, 0x0001); pub const GL_MAP_WRITE_BIT = @as(c_int, 0x0002); pub const GL_MAP_INVALIDATE_RANGE_BIT = @as(c_int, 0x0004); pub const GL_MAP_INVALIDATE_BUFFER_BIT = @as(c_int, 0x0008); pub const GL_MAP_FLUSH_EXPLICIT_BIT = @as(c_int, 0x0010); pub const GL_MAP_UNSYNCHRONIZED_BIT = @as(c_int, 0x0020); pub const GL_COMPRESSED_RED_RGTC1 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DBB, .hexadecimal); pub const GL_COMPRESSED_SIGNED_RED_RGTC1 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DBC, .hexadecimal); pub const GL_COMPRESSED_RG_RGTC2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DBD, .hexadecimal); pub const GL_COMPRESSED_SIGNED_RG_RGTC2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DBE, .hexadecimal); pub const GL_RG = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8227, .hexadecimal); pub const GL_RG_INTEGER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8228, .hexadecimal); pub const GL_R8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8229, .hexadecimal); pub const GL_R16 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x822A, .hexadecimal); pub const GL_RG8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x822B, .hexadecimal); pub const GL_RG16 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x822C, .hexadecimal); pub const GL_R16F = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x822D, .hexadecimal); pub const GL_R32F = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x822E, .hexadecimal); pub const GL_RG16F = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x822F, .hexadecimal); pub const GL_RG32F = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8230, .hexadecimal); pub const GL_R8I = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8231, .hexadecimal); pub const GL_R8UI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8232, .hexadecimal); pub const GL_R16I = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8233, .hexadecimal); pub const GL_R16UI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8234, .hexadecimal); pub const GL_R32I = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8235, .hexadecimal); pub const GL_R32UI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8236, .hexadecimal); pub const GL_RG8I = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8237, .hexadecimal); pub const GL_RG8UI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8238, .hexadecimal); pub const GL_RG16I = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8239, .hexadecimal); pub const GL_RG16UI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x823A, .hexadecimal); pub const GL_RG32I = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x823B, .hexadecimal); pub const GL_RG32UI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x823C, .hexadecimal); pub const GL_VERTEX_ARRAY_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85B5, .hexadecimal); pub const GL_CLAMP_VERTEX_COLOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x891A, .hexadecimal); pub const GL_CLAMP_FRAGMENT_COLOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x891B, .hexadecimal); pub const GL_ALPHA_INTEGER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D97, .hexadecimal); pub const GL_VERSION_3_1 = @as(c_int, 1); pub const GL_SAMPLER_2D_RECT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B63, .hexadecimal); pub const GL_SAMPLER_2D_RECT_SHADOW = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B64, .hexadecimal); pub const GL_SAMPLER_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DC2, .hexadecimal); pub const GL_INT_SAMPLER_2D_RECT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DCD, .hexadecimal); pub const GL_INT_SAMPLER_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DD0, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_2D_RECT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DD5, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DD8, .hexadecimal); pub const GL_TEXTURE_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C2A, .hexadecimal); pub const GL_MAX_TEXTURE_BUFFER_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C2B, .hexadecimal); pub const GL_TEXTURE_BINDING_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C2C, .hexadecimal); pub const GL_TEXTURE_BUFFER_DATA_STORE_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C2D, .hexadecimal); pub const GL_TEXTURE_RECTANGLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84F5, .hexadecimal); pub const GL_TEXTURE_BINDING_RECTANGLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84F6, .hexadecimal); pub const GL_PROXY_TEXTURE_RECTANGLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84F7, .hexadecimal); pub const GL_MAX_RECTANGLE_TEXTURE_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84F8, .hexadecimal); pub const GL_R8_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F94, .hexadecimal); pub const GL_RG8_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F95, .hexadecimal); pub const GL_RGB8_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F96, .hexadecimal); pub const GL_RGBA8_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F97, .hexadecimal); pub const GL_R16_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F98, .hexadecimal); pub const GL_RG16_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F99, .hexadecimal); pub const GL_RGB16_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F9A, .hexadecimal); pub const GL_RGBA16_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F9B, .hexadecimal); pub const GL_SIGNED_NORMALIZED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F9C, .hexadecimal); pub const GL_PRIMITIVE_RESTART = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F9D, .hexadecimal); pub const GL_PRIMITIVE_RESTART_INDEX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F9E, .hexadecimal); pub const GL_COPY_READ_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F36, .hexadecimal); pub const GL_COPY_WRITE_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F37, .hexadecimal); pub const GL_UNIFORM_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A11, .hexadecimal); pub const GL_UNIFORM_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A28, .hexadecimal); pub const GL_UNIFORM_BUFFER_START = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A29, .hexadecimal); pub const GL_UNIFORM_BUFFER_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A2A, .hexadecimal); pub const GL_MAX_VERTEX_UNIFORM_BLOCKS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A2B, .hexadecimal); pub const GL_MAX_GEOMETRY_UNIFORM_BLOCKS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A2C, .hexadecimal); pub const GL_MAX_FRAGMENT_UNIFORM_BLOCKS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A2D, .hexadecimal); pub const GL_MAX_COMBINED_UNIFORM_BLOCKS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A2E, .hexadecimal); pub const GL_MAX_UNIFORM_BUFFER_BINDINGS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A2F, .hexadecimal); pub const GL_MAX_UNIFORM_BLOCK_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A30, .hexadecimal); pub const GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A31, .hexadecimal); pub const GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A32, .hexadecimal); pub const GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A33, .hexadecimal); pub const GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A34, .hexadecimal); pub const GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A35, .hexadecimal); pub const GL_ACTIVE_UNIFORM_BLOCKS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A36, .hexadecimal); pub const GL_UNIFORM_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A37, .hexadecimal); pub const GL_UNIFORM_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A38, .hexadecimal); pub const GL_UNIFORM_NAME_LENGTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A39, .hexadecimal); pub const GL_UNIFORM_BLOCK_INDEX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A3A, .hexadecimal); pub const GL_UNIFORM_OFFSET = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A3B, .hexadecimal); pub const GL_UNIFORM_ARRAY_STRIDE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A3C, .hexadecimal); pub const GL_UNIFORM_MATRIX_STRIDE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A3D, .hexadecimal); pub const GL_UNIFORM_IS_ROW_MAJOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A3E, .hexadecimal); pub const GL_UNIFORM_BLOCK_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A3F, .hexadecimal); pub const GL_UNIFORM_BLOCK_DATA_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A40, .hexadecimal); pub const GL_UNIFORM_BLOCK_NAME_LENGTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A41, .hexadecimal); pub const GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A42, .hexadecimal); pub const GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A43, .hexadecimal); pub const GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A44, .hexadecimal); pub const GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A45, .hexadecimal); pub const GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A46, .hexadecimal); pub const GL_INVALID_INDEX = @import("std").zig.c_translation.promoteIntLiteral(c_uint, 0xFFFFFFFF, .hexadecimal); pub const GL_VERSION_3_2 = @as(c_int, 1); pub const GL_CONTEXT_CORE_PROFILE_BIT = @as(c_int, 0x00000001); pub const GL_CONTEXT_COMPATIBILITY_PROFILE_BIT = @as(c_int, 0x00000002); pub const GL_LINES_ADJACENCY = @as(c_int, 0x000A); pub const GL_LINE_STRIP_ADJACENCY = @as(c_int, 0x000B); pub const GL_TRIANGLES_ADJACENCY = @as(c_int, 0x000C); pub const GL_TRIANGLE_STRIP_ADJACENCY = @as(c_int, 0x000D); pub const GL_PROGRAM_POINT_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8642, .hexadecimal); pub const GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C29, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_LAYERED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DA7, .hexadecimal); pub const GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DA8, .hexadecimal); pub const GL_GEOMETRY_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DD9, .hexadecimal); pub const GL_GEOMETRY_VERTICES_OUT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8916, .hexadecimal); pub const GL_GEOMETRY_INPUT_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8917, .hexadecimal); pub const GL_GEOMETRY_OUTPUT_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8918, .hexadecimal); pub const GL_MAX_GEOMETRY_UNIFORM_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DDF, .hexadecimal); pub const GL_MAX_GEOMETRY_OUTPUT_VERTICES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DE0, .hexadecimal); pub const GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DE1, .hexadecimal); pub const GL_MAX_VERTEX_OUTPUT_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9122, .hexadecimal); pub const GL_MAX_GEOMETRY_INPUT_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9123, .hexadecimal); pub const GL_MAX_GEOMETRY_OUTPUT_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9124, .hexadecimal); pub const GL_MAX_FRAGMENT_INPUT_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9125, .hexadecimal); pub const GL_CONTEXT_PROFILE_MASK = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9126, .hexadecimal); pub const GL_DEPTH_CLAMP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x864F, .hexadecimal); pub const GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E4C, .hexadecimal); pub const GL_FIRST_VERTEX_CONVENTION = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E4D, .hexadecimal); pub const GL_LAST_VERTEX_CONVENTION = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E4E, .hexadecimal); pub const GL_PROVOKING_VERTEX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E4F, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_SEAMLESS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x884F, .hexadecimal); pub const GL_MAX_SERVER_WAIT_TIMEOUT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9111, .hexadecimal); pub const GL_OBJECT_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9112, .hexadecimal); pub const GL_SYNC_CONDITION = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9113, .hexadecimal); pub const GL_SYNC_STATUS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9114, .hexadecimal); pub const GL_SYNC_FLAGS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9115, .hexadecimal); pub const GL_SYNC_FENCE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9116, .hexadecimal); pub const GL_SYNC_GPU_COMMANDS_COMPLETE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9117, .hexadecimal); pub const GL_UNSIGNALED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9118, .hexadecimal); pub const GL_SIGNALED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9119, .hexadecimal); pub const GL_ALREADY_SIGNALED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x911A, .hexadecimal); pub const GL_TIMEOUT_EXPIRED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x911B, .hexadecimal); pub const GL_CONDITION_SATISFIED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x911C, .hexadecimal); pub const GL_WAIT_FAILED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x911D, .hexadecimal); pub const GL_TIMEOUT_IGNORED = @as(c_ulonglong, 0xFFFFFFFFFFFFFFFF); pub const GL_SYNC_FLUSH_COMMANDS_BIT = @as(c_int, 0x00000001); pub const GL_SAMPLE_POSITION = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E50, .hexadecimal); pub const GL_SAMPLE_MASK = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E51, .hexadecimal); pub const GL_SAMPLE_MASK_VALUE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E52, .hexadecimal); pub const GL_MAX_SAMPLE_MASK_WORDS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E59, .hexadecimal); pub const GL_TEXTURE_2D_MULTISAMPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9100, .hexadecimal); pub const GL_PROXY_TEXTURE_2D_MULTISAMPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9101, .hexadecimal); pub const GL_TEXTURE_2D_MULTISAMPLE_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9102, .hexadecimal); pub const GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9103, .hexadecimal); pub const GL_TEXTURE_BINDING_2D_MULTISAMPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9104, .hexadecimal); pub const GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9105, .hexadecimal); pub const GL_TEXTURE_SAMPLES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9106, .hexadecimal); pub const GL_TEXTURE_FIXED_SAMPLE_LOCATIONS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9107, .hexadecimal); pub const GL_SAMPLER_2D_MULTISAMPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9108, .hexadecimal); pub const GL_INT_SAMPLER_2D_MULTISAMPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9109, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x910A, .hexadecimal); pub const GL_SAMPLER_2D_MULTISAMPLE_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x910B, .hexadecimal); pub const GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x910C, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x910D, .hexadecimal); pub const GL_MAX_COLOR_TEXTURE_SAMPLES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x910E, .hexadecimal); pub const GL_MAX_DEPTH_TEXTURE_SAMPLES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x910F, .hexadecimal); pub const GL_MAX_INTEGER_SAMPLES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9110, .hexadecimal); pub const GL_VERSION_3_3 = @as(c_int, 1); pub const GL_VERTEX_ATTRIB_ARRAY_DIVISOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88FE, .hexadecimal); pub const GL_SRC1_COLOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88F9, .hexadecimal); pub const GL_ONE_MINUS_SRC1_COLOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88FA, .hexadecimal); pub const GL_ONE_MINUS_SRC1_ALPHA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88FB, .hexadecimal); pub const GL_MAX_DUAL_SOURCE_DRAW_BUFFERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88FC, .hexadecimal); pub const GL_ANY_SAMPLES_PASSED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C2F, .hexadecimal); pub const GL_SAMPLER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8919, .hexadecimal); pub const GL_RGB10_A2UI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x906F, .hexadecimal); pub const GL_TEXTURE_SWIZZLE_R = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E42, .hexadecimal); pub const GL_TEXTURE_SWIZZLE_G = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E43, .hexadecimal); pub const GL_TEXTURE_SWIZZLE_B = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E44, .hexadecimal); pub const GL_TEXTURE_SWIZZLE_A = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E45, .hexadecimal); pub const GL_TEXTURE_SWIZZLE_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E46, .hexadecimal); pub const GL_TIME_ELAPSED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88BF, .hexadecimal); pub const GL_TIMESTAMP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E28, .hexadecimal); pub const GL_INT_2_10_10_10_REV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D9F, .hexadecimal); pub const GL_VERSION_4_0 = @as(c_int, 1); pub const GL_SAMPLE_SHADING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C36, .hexadecimal); pub const GL_MIN_SAMPLE_SHADING_VALUE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C37, .hexadecimal); pub const GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E5E, .hexadecimal); pub const GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E5F, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9009, .hexadecimal); pub const GL_TEXTURE_BINDING_CUBE_MAP_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x900A, .hexadecimal); pub const GL_PROXY_TEXTURE_CUBE_MAP_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x900B, .hexadecimal); pub const GL_SAMPLER_CUBE_MAP_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x900C, .hexadecimal); pub const GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x900D, .hexadecimal); pub const GL_INT_SAMPLER_CUBE_MAP_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x900E, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x900F, .hexadecimal); pub const GL_DRAW_INDIRECT_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F3F, .hexadecimal); pub const GL_DRAW_INDIRECT_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F43, .hexadecimal); pub const GL_GEOMETRY_SHADER_INVOCATIONS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x887F, .hexadecimal); pub const GL_MAX_GEOMETRY_SHADER_INVOCATIONS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E5A, .hexadecimal); pub const GL_MIN_FRAGMENT_INTERPOLATION_OFFSET = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E5B, .hexadecimal); pub const GL_MAX_FRAGMENT_INTERPOLATION_OFFSET = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E5C, .hexadecimal); pub const GL_FRAGMENT_INTERPOLATION_OFFSET_BITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E5D, .hexadecimal); pub const GL_MAX_VERTEX_STREAMS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E71, .hexadecimal); pub const GL_DOUBLE_VEC2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FFC, .hexadecimal); pub const GL_DOUBLE_VEC3 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FFD, .hexadecimal); pub const GL_DOUBLE_VEC4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FFE, .hexadecimal); pub const GL_DOUBLE_MAT2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F46, .hexadecimal); pub const GL_DOUBLE_MAT3 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F47, .hexadecimal); pub const GL_DOUBLE_MAT4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F48, .hexadecimal); pub const GL_DOUBLE_MAT2x3 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F49, .hexadecimal); pub const GL_DOUBLE_MAT2x4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F4A, .hexadecimal); pub const GL_DOUBLE_MAT3x2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F4B, .hexadecimal); pub const GL_DOUBLE_MAT3x4 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F4C, .hexadecimal); pub const GL_DOUBLE_MAT4x2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F4D, .hexadecimal); pub const GL_DOUBLE_MAT4x3 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F4E, .hexadecimal); pub const GL_ACTIVE_SUBROUTINES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DE5, .hexadecimal); pub const GL_ACTIVE_SUBROUTINE_UNIFORMS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DE6, .hexadecimal); pub const GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E47, .hexadecimal); pub const GL_ACTIVE_SUBROUTINE_MAX_LENGTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E48, .hexadecimal); pub const GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E49, .hexadecimal); pub const GL_MAX_SUBROUTINES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DE7, .hexadecimal); pub const GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DE8, .hexadecimal); pub const GL_NUM_COMPATIBLE_SUBROUTINES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E4A, .hexadecimal); pub const GL_COMPATIBLE_SUBROUTINES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E4B, .hexadecimal); pub const GL_PATCHES = @as(c_int, 0x000E); pub const GL_PATCH_VERTICES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E72, .hexadecimal); pub const GL_PATCH_DEFAULT_INNER_LEVEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E73, .hexadecimal); pub const GL_PATCH_DEFAULT_OUTER_LEVEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E74, .hexadecimal); pub const GL_TESS_CONTROL_OUTPUT_VERTICES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E75, .hexadecimal); pub const GL_TESS_GEN_MODE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E76, .hexadecimal); pub const GL_TESS_GEN_SPACING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E77, .hexadecimal); pub const GL_TESS_GEN_VERTEX_ORDER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E78, .hexadecimal); pub const GL_TESS_GEN_POINT_MODE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E79, .hexadecimal); pub const GL_ISOLINES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E7A, .hexadecimal); pub const GL_FRACTIONAL_ODD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E7B, .hexadecimal); pub const GL_FRACTIONAL_EVEN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E7C, .hexadecimal); pub const GL_MAX_PATCH_VERTICES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E7D, .hexadecimal); pub const GL_MAX_TESS_GEN_LEVEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E7E, .hexadecimal); pub const GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E7F, .hexadecimal); pub const GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E80, .hexadecimal); pub const GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E81, .hexadecimal); pub const GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E82, .hexadecimal); pub const GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E83, .hexadecimal); pub const GL_MAX_TESS_PATCH_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E84, .hexadecimal); pub const GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E85, .hexadecimal); pub const GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E86, .hexadecimal); pub const GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E89, .hexadecimal); pub const GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E8A, .hexadecimal); pub const GL_MAX_TESS_CONTROL_INPUT_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x886C, .hexadecimal); pub const GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x886D, .hexadecimal); pub const GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E1E, .hexadecimal); pub const GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E1F, .hexadecimal); pub const GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84F0, .hexadecimal); pub const GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84F1, .hexadecimal); pub const GL_TESS_EVALUATION_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E87, .hexadecimal); pub const GL_TESS_CONTROL_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E88, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E22, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E23, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E24, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E25, .hexadecimal); pub const GL_MAX_TRANSFORM_FEEDBACK_BUFFERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E70, .hexadecimal); pub const GL_VERSION_4_1 = @as(c_int, 1); pub const GL_FIXED = @as(c_int, 0x140C); pub const GL_IMPLEMENTATION_COLOR_READ_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B9A, .hexadecimal); pub const GL_IMPLEMENTATION_COLOR_READ_FORMAT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B9B, .hexadecimal); pub const GL_LOW_FLOAT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DF0, .hexadecimal); pub const GL_MEDIUM_FLOAT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DF1, .hexadecimal); pub const GL_HIGH_FLOAT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DF2, .hexadecimal); pub const GL_LOW_INT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DF3, .hexadecimal); pub const GL_MEDIUM_INT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DF4, .hexadecimal); pub const GL_HIGH_INT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DF5, .hexadecimal); pub const GL_SHADER_COMPILER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DFA, .hexadecimal); pub const GL_SHADER_BINARY_FORMATS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DF8, .hexadecimal); pub const GL_NUM_SHADER_BINARY_FORMATS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DF9, .hexadecimal); pub const GL_MAX_VERTEX_UNIFORM_VECTORS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DFB, .hexadecimal); pub const GL_MAX_VARYING_VECTORS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DFC, .hexadecimal); pub const GL_MAX_FRAGMENT_UNIFORM_VECTORS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DFD, .hexadecimal); pub const GL_RGB565 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D62, .hexadecimal); pub const GL_PROGRAM_BINARY_RETRIEVABLE_HINT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8257, .hexadecimal); pub const GL_PROGRAM_BINARY_LENGTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8741, .hexadecimal); pub const GL_NUM_PROGRAM_BINARY_FORMATS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87FE, .hexadecimal); pub const GL_PROGRAM_BINARY_FORMATS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87FF, .hexadecimal); pub const GL_VERTEX_SHADER_BIT = @as(c_int, 0x00000001); pub const GL_FRAGMENT_SHADER_BIT = @as(c_int, 0x00000002); pub const GL_GEOMETRY_SHADER_BIT = @as(c_int, 0x00000004); pub const GL_TESS_CONTROL_SHADER_BIT = @as(c_int, 0x00000008); pub const GL_TESS_EVALUATION_SHADER_BIT = @as(c_int, 0x00000010); pub const GL_ALL_SHADER_BITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0xFFFFFFFF, .hexadecimal); pub const GL_PROGRAM_SEPARABLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8258, .hexadecimal); pub const GL_ACTIVE_PROGRAM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8259, .hexadecimal); pub const GL_PROGRAM_PIPELINE_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x825A, .hexadecimal); pub const GL_MAX_VIEWPORTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x825B, .hexadecimal); pub const GL_VIEWPORT_SUBPIXEL_BITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x825C, .hexadecimal); pub const GL_VIEWPORT_BOUNDS_RANGE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x825D, .hexadecimal); pub const GL_LAYER_PROVOKING_VERTEX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x825E, .hexadecimal); pub const GL_VIEWPORT_INDEX_PROVOKING_VERTEX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x825F, .hexadecimal); pub const GL_UNDEFINED_VERTEX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8260, .hexadecimal); pub const GL_VERSION_4_2 = @as(c_int, 1); pub const GL_COPY_READ_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F36, .hexadecimal); pub const GL_COPY_WRITE_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F37, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_ACTIVE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E24, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_PAUSED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E23, .hexadecimal); pub const GL_UNPACK_COMPRESSED_BLOCK_WIDTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9127, .hexadecimal); pub const GL_UNPACK_COMPRESSED_BLOCK_HEIGHT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9128, .hexadecimal); pub const GL_UNPACK_COMPRESSED_BLOCK_DEPTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9129, .hexadecimal); pub const GL_UNPACK_COMPRESSED_BLOCK_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x912A, .hexadecimal); pub const GL_PACK_COMPRESSED_BLOCK_WIDTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x912B, .hexadecimal); pub const GL_PACK_COMPRESSED_BLOCK_HEIGHT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x912C, .hexadecimal); pub const GL_PACK_COMPRESSED_BLOCK_DEPTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x912D, .hexadecimal); pub const GL_PACK_COMPRESSED_BLOCK_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x912E, .hexadecimal); pub const GL_NUM_SAMPLE_COUNTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9380, .hexadecimal); pub const GL_MIN_MAP_BUFFER_ALIGNMENT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90BC, .hexadecimal); pub const GL_ATOMIC_COUNTER_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92C0, .hexadecimal); pub const GL_ATOMIC_COUNTER_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92C1, .hexadecimal); pub const GL_ATOMIC_COUNTER_BUFFER_START = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92C2, .hexadecimal); pub const GL_ATOMIC_COUNTER_BUFFER_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92C3, .hexadecimal); pub const GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92C4, .hexadecimal); pub const GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92C5, .hexadecimal); pub const GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92C6, .hexadecimal); pub const GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92C7, .hexadecimal); pub const GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92C8, .hexadecimal); pub const GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92C9, .hexadecimal); pub const GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92CA, .hexadecimal); pub const GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92CB, .hexadecimal); pub const GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92CC, .hexadecimal); pub const GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92CD, .hexadecimal); pub const GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92CE, .hexadecimal); pub const GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92CF, .hexadecimal); pub const GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92D0, .hexadecimal); pub const GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92D1, .hexadecimal); pub const GL_MAX_VERTEX_ATOMIC_COUNTERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92D2, .hexadecimal); pub const GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92D3, .hexadecimal); pub const GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92D4, .hexadecimal); pub const GL_MAX_GEOMETRY_ATOMIC_COUNTERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92D5, .hexadecimal); pub const GL_MAX_FRAGMENT_ATOMIC_COUNTERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92D6, .hexadecimal); pub const GL_MAX_COMBINED_ATOMIC_COUNTERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92D7, .hexadecimal); pub const GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92D8, .hexadecimal); pub const GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92DC, .hexadecimal); pub const GL_ACTIVE_ATOMIC_COUNTER_BUFFERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92D9, .hexadecimal); pub const GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92DA, .hexadecimal); pub const GL_UNSIGNED_INT_ATOMIC_COUNTER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92DB, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT = @as(c_int, 0x00000001); pub const GL_ELEMENT_ARRAY_BARRIER_BIT = @as(c_int, 0x00000002); pub const GL_UNIFORM_BARRIER_BIT = @as(c_int, 0x00000004); pub const GL_TEXTURE_FETCH_BARRIER_BIT = @as(c_int, 0x00000008); pub const GL_SHADER_IMAGE_ACCESS_BARRIER_BIT = @as(c_int, 0x00000020); pub const GL_COMMAND_BARRIER_BIT = @as(c_int, 0x00000040); pub const GL_PIXEL_BUFFER_BARRIER_BIT = @as(c_int, 0x00000080); pub const GL_TEXTURE_UPDATE_BARRIER_BIT = @as(c_int, 0x00000100); pub const GL_BUFFER_UPDATE_BARRIER_BIT = @as(c_int, 0x00000200); pub const GL_FRAMEBUFFER_BARRIER_BIT = @as(c_int, 0x00000400); pub const GL_TRANSFORM_FEEDBACK_BARRIER_BIT = @as(c_int, 0x00000800); pub const GL_ATOMIC_COUNTER_BARRIER_BIT = @as(c_int, 0x00001000); pub const GL_ALL_BARRIER_BITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0xFFFFFFFF, .hexadecimal); pub const GL_MAX_IMAGE_UNITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F38, .hexadecimal); pub const GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F39, .hexadecimal); pub const GL_IMAGE_BINDING_NAME = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F3A, .hexadecimal); pub const GL_IMAGE_BINDING_LEVEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F3B, .hexadecimal); pub const GL_IMAGE_BINDING_LAYERED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F3C, .hexadecimal); pub const GL_IMAGE_BINDING_LAYER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F3D, .hexadecimal); pub const GL_IMAGE_BINDING_ACCESS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F3E, .hexadecimal); pub const GL_IMAGE_1D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x904C, .hexadecimal); pub const GL_IMAGE_2D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x904D, .hexadecimal); pub const GL_IMAGE_3D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x904E, .hexadecimal); pub const GL_IMAGE_2D_RECT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x904F, .hexadecimal); pub const GL_IMAGE_CUBE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9050, .hexadecimal); pub const GL_IMAGE_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9051, .hexadecimal); pub const GL_IMAGE_1D_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9052, .hexadecimal); pub const GL_IMAGE_2D_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9053, .hexadecimal); pub const GL_IMAGE_CUBE_MAP_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9054, .hexadecimal); pub const GL_IMAGE_2D_MULTISAMPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9055, .hexadecimal); pub const GL_IMAGE_2D_MULTISAMPLE_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9056, .hexadecimal); pub const GL_INT_IMAGE_1D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9057, .hexadecimal); pub const GL_INT_IMAGE_2D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9058, .hexadecimal); pub const GL_INT_IMAGE_3D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9059, .hexadecimal); pub const GL_INT_IMAGE_2D_RECT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x905A, .hexadecimal); pub const GL_INT_IMAGE_CUBE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x905B, .hexadecimal); pub const GL_INT_IMAGE_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x905C, .hexadecimal); pub const GL_INT_IMAGE_1D_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x905D, .hexadecimal); pub const GL_INT_IMAGE_2D_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x905E, .hexadecimal); pub const GL_INT_IMAGE_CUBE_MAP_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x905F, .hexadecimal); pub const GL_INT_IMAGE_2D_MULTISAMPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9060, .hexadecimal); pub const GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9061, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_1D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9062, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_2D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9063, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_3D = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9064, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_2D_RECT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9065, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_CUBE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9066, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9067, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_1D_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9068, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_2D_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9069, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x906A, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x906B, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x906C, .hexadecimal); pub const GL_MAX_IMAGE_SAMPLES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x906D, .hexadecimal); pub const GL_IMAGE_BINDING_FORMAT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x906E, .hexadecimal); pub const GL_IMAGE_FORMAT_COMPATIBILITY_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90C7, .hexadecimal); pub const GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90C8, .hexadecimal); pub const GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90C9, .hexadecimal); pub const GL_MAX_VERTEX_IMAGE_UNIFORMS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90CA, .hexadecimal); pub const GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90CB, .hexadecimal); pub const GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90CC, .hexadecimal); pub const GL_MAX_GEOMETRY_IMAGE_UNIFORMS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90CD, .hexadecimal); pub const GL_MAX_FRAGMENT_IMAGE_UNIFORMS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90CE, .hexadecimal); pub const GL_MAX_COMBINED_IMAGE_UNIFORMS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90CF, .hexadecimal); pub const GL_COMPRESSED_RGBA_BPTC_UNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E8C, .hexadecimal); pub const GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E8D, .hexadecimal); pub const GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E8E, .hexadecimal); pub const GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E8F, .hexadecimal); pub const GL_TEXTURE_IMMUTABLE_FORMAT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x912F, .hexadecimal); pub const GL_VERSION_4_3 = @as(c_int, 1); pub const GL_NUM_SHADING_LANGUAGE_VERSIONS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82E9, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY_LONG = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x874E, .hexadecimal); pub const GL_COMPRESSED_RGB8_ETC2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9274, .hexadecimal); pub const GL_COMPRESSED_SRGB8_ETC2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9275, .hexadecimal); pub const GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9276, .hexadecimal); pub const GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9277, .hexadecimal); pub const GL_COMPRESSED_RGBA8_ETC2_EAC = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9278, .hexadecimal); pub const GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9279, .hexadecimal); pub const GL_COMPRESSED_R11_EAC = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9270, .hexadecimal); pub const GL_COMPRESSED_SIGNED_R11_EAC = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9271, .hexadecimal); pub const GL_COMPRESSED_RG11_EAC = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9272, .hexadecimal); pub const GL_COMPRESSED_SIGNED_RG11_EAC = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9273, .hexadecimal); pub const GL_PRIMITIVE_RESTART_FIXED_INDEX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D69, .hexadecimal); pub const GL_ANY_SAMPLES_PASSED_CONSERVATIVE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D6A, .hexadecimal); pub const GL_MAX_ELEMENT_INDEX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D6B, .hexadecimal); pub const GL_COMPUTE_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91B9, .hexadecimal); pub const GL_MAX_COMPUTE_UNIFORM_BLOCKS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91BB, .hexadecimal); pub const GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91BC, .hexadecimal); pub const GL_MAX_COMPUTE_IMAGE_UNIFORMS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91BD, .hexadecimal); pub const GL_MAX_COMPUTE_SHARED_MEMORY_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8262, .hexadecimal); pub const GL_MAX_COMPUTE_UNIFORM_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8263, .hexadecimal); pub const GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8264, .hexadecimal); pub const GL_MAX_COMPUTE_ATOMIC_COUNTERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8265, .hexadecimal); pub const GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8266, .hexadecimal); pub const GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90EB, .hexadecimal); pub const GL_MAX_COMPUTE_WORK_GROUP_COUNT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91BE, .hexadecimal); pub const GL_MAX_COMPUTE_WORK_GROUP_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91BF, .hexadecimal); pub const GL_COMPUTE_WORK_GROUP_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8267, .hexadecimal); pub const GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90EC, .hexadecimal); pub const GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90ED, .hexadecimal); pub const GL_DISPATCH_INDIRECT_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90EE, .hexadecimal); pub const GL_DISPATCH_INDIRECT_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90EF, .hexadecimal); pub const GL_COMPUTE_SHADER_BIT = @as(c_int, 0x00000020); pub const GL_DEBUG_OUTPUT_SYNCHRONOUS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8242, .hexadecimal); pub const GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8243, .hexadecimal); pub const GL_DEBUG_CALLBACK_FUNCTION = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8244, .hexadecimal); pub const GL_DEBUG_CALLBACK_USER_PARAM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8245, .hexadecimal); pub const GL_DEBUG_SOURCE_API = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8246, .hexadecimal); pub const GL_DEBUG_SOURCE_WINDOW_SYSTEM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8247, .hexadecimal); pub const GL_DEBUG_SOURCE_SHADER_COMPILER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8248, .hexadecimal); pub const GL_DEBUG_SOURCE_THIRD_PARTY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8249, .hexadecimal); pub const GL_DEBUG_SOURCE_APPLICATION = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x824A, .hexadecimal); pub const GL_DEBUG_SOURCE_OTHER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x824B, .hexadecimal); pub const GL_DEBUG_TYPE_ERROR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x824C, .hexadecimal); pub const GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x824D, .hexadecimal); pub const GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x824E, .hexadecimal); pub const GL_DEBUG_TYPE_PORTABILITY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x824F, .hexadecimal); pub const GL_DEBUG_TYPE_PERFORMANCE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8250, .hexadecimal); pub const GL_DEBUG_TYPE_OTHER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8251, .hexadecimal); pub const GL_MAX_DEBUG_MESSAGE_LENGTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9143, .hexadecimal); pub const GL_MAX_DEBUG_LOGGED_MESSAGES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9144, .hexadecimal); pub const GL_DEBUG_LOGGED_MESSAGES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9145, .hexadecimal); pub const GL_DEBUG_SEVERITY_HIGH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9146, .hexadecimal); pub const GL_DEBUG_SEVERITY_MEDIUM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9147, .hexadecimal); pub const GL_DEBUG_SEVERITY_LOW = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9148, .hexadecimal); pub const GL_DEBUG_TYPE_MARKER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8268, .hexadecimal); pub const GL_DEBUG_TYPE_PUSH_GROUP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8269, .hexadecimal); pub const GL_DEBUG_TYPE_POP_GROUP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x826A, .hexadecimal); pub const GL_DEBUG_SEVERITY_NOTIFICATION = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x826B, .hexadecimal); pub const GL_MAX_DEBUG_GROUP_STACK_DEPTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x826C, .hexadecimal); pub const GL_DEBUG_GROUP_STACK_DEPTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x826D, .hexadecimal); pub const GL_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82E0, .hexadecimal); pub const GL_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82E1, .hexadecimal); pub const GL_PROGRAM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82E2, .hexadecimal); pub const GL_QUERY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82E3, .hexadecimal); pub const GL_PROGRAM_PIPELINE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82E4, .hexadecimal); pub const GL_SAMPLER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82E6, .hexadecimal); pub const GL_MAX_LABEL_LENGTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82E8, .hexadecimal); pub const GL_DEBUG_OUTPUT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92E0, .hexadecimal); pub const GL_CONTEXT_FLAG_DEBUG_BIT = @as(c_int, 0x00000002); pub const GL_MAX_UNIFORM_LOCATIONS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x826E, .hexadecimal); pub const GL_FRAMEBUFFER_DEFAULT_WIDTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9310, .hexadecimal); pub const GL_FRAMEBUFFER_DEFAULT_HEIGHT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9311, .hexadecimal); pub const GL_FRAMEBUFFER_DEFAULT_LAYERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9312, .hexadecimal); pub const GL_FRAMEBUFFER_DEFAULT_SAMPLES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9313, .hexadecimal); pub const GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9314, .hexadecimal); pub const GL_MAX_FRAMEBUFFER_WIDTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9315, .hexadecimal); pub const GL_MAX_FRAMEBUFFER_HEIGHT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9316, .hexadecimal); pub const GL_MAX_FRAMEBUFFER_LAYERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9317, .hexadecimal); pub const GL_MAX_FRAMEBUFFER_SAMPLES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9318, .hexadecimal); pub const GL_INTERNALFORMAT_SUPPORTED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x826F, .hexadecimal); pub const GL_INTERNALFORMAT_PREFERRED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8270, .hexadecimal); pub const GL_INTERNALFORMAT_RED_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8271, .hexadecimal); pub const GL_INTERNALFORMAT_GREEN_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8272, .hexadecimal); pub const GL_INTERNALFORMAT_BLUE_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8273, .hexadecimal); pub const GL_INTERNALFORMAT_ALPHA_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8274, .hexadecimal); pub const GL_INTERNALFORMAT_DEPTH_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8275, .hexadecimal); pub const GL_INTERNALFORMAT_STENCIL_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8276, .hexadecimal); pub const GL_INTERNALFORMAT_SHARED_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8277, .hexadecimal); pub const GL_INTERNALFORMAT_RED_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8278, .hexadecimal); pub const GL_INTERNALFORMAT_GREEN_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8279, .hexadecimal); pub const GL_INTERNALFORMAT_BLUE_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x827A, .hexadecimal); pub const GL_INTERNALFORMAT_ALPHA_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x827B, .hexadecimal); pub const GL_INTERNALFORMAT_DEPTH_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x827C, .hexadecimal); pub const GL_INTERNALFORMAT_STENCIL_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x827D, .hexadecimal); pub const GL_MAX_WIDTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x827E, .hexadecimal); pub const GL_MAX_HEIGHT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x827F, .hexadecimal); pub const GL_MAX_DEPTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8280, .hexadecimal); pub const GL_MAX_LAYERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8281, .hexadecimal); pub const GL_MAX_COMBINED_DIMENSIONS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8282, .hexadecimal); pub const GL_COLOR_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8283, .hexadecimal); pub const GL_DEPTH_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8284, .hexadecimal); pub const GL_STENCIL_COMPONENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8285, .hexadecimal); pub const GL_COLOR_RENDERABLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8286, .hexadecimal); pub const GL_DEPTH_RENDERABLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8287, .hexadecimal); pub const GL_STENCIL_RENDERABLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8288, .hexadecimal); pub const GL_FRAMEBUFFER_RENDERABLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8289, .hexadecimal); pub const GL_FRAMEBUFFER_RENDERABLE_LAYERED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x828A, .hexadecimal); pub const GL_FRAMEBUFFER_BLEND = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x828B, .hexadecimal); pub const GL_READ_PIXELS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x828C, .hexadecimal); pub const GL_READ_PIXELS_FORMAT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x828D, .hexadecimal); pub const GL_READ_PIXELS_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x828E, .hexadecimal); pub const GL_TEXTURE_IMAGE_FORMAT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x828F, .hexadecimal); pub const GL_TEXTURE_IMAGE_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8290, .hexadecimal); pub const GL_GET_TEXTURE_IMAGE_FORMAT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8291, .hexadecimal); pub const GL_GET_TEXTURE_IMAGE_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8292, .hexadecimal); pub const GL_MIPMAP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8293, .hexadecimal); pub const GL_MANUAL_GENERATE_MIPMAP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8294, .hexadecimal); pub const GL_AUTO_GENERATE_MIPMAP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8295, .hexadecimal); pub const GL_COLOR_ENCODING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8296, .hexadecimal); pub const GL_SRGB_READ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8297, .hexadecimal); pub const GL_SRGB_WRITE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8298, .hexadecimal); pub const GL_FILTER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x829A, .hexadecimal); pub const GL_VERTEX_TEXTURE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x829B, .hexadecimal); pub const GL_TESS_CONTROL_TEXTURE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x829C, .hexadecimal); pub const GL_TESS_EVALUATION_TEXTURE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x829D, .hexadecimal); pub const GL_GEOMETRY_TEXTURE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x829E, .hexadecimal); pub const GL_FRAGMENT_TEXTURE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x829F, .hexadecimal); pub const GL_COMPUTE_TEXTURE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82A0, .hexadecimal); pub const GL_TEXTURE_SHADOW = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82A1, .hexadecimal); pub const GL_TEXTURE_GATHER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82A2, .hexadecimal); pub const GL_TEXTURE_GATHER_SHADOW = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82A3, .hexadecimal); pub const GL_SHADER_IMAGE_LOAD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82A4, .hexadecimal); pub const GL_SHADER_IMAGE_STORE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82A5, .hexadecimal); pub const GL_SHADER_IMAGE_ATOMIC = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82A6, .hexadecimal); pub const GL_IMAGE_TEXEL_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82A7, .hexadecimal); pub const GL_IMAGE_COMPATIBILITY_CLASS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82A8, .hexadecimal); pub const GL_IMAGE_PIXEL_FORMAT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82A9, .hexadecimal); pub const GL_IMAGE_PIXEL_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82AA, .hexadecimal); pub const GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82AC, .hexadecimal); pub const GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82AD, .hexadecimal); pub const GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82AE, .hexadecimal); pub const GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82AF, .hexadecimal); pub const GL_TEXTURE_COMPRESSED_BLOCK_WIDTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82B1, .hexadecimal); pub const GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82B2, .hexadecimal); pub const GL_TEXTURE_COMPRESSED_BLOCK_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82B3, .hexadecimal); pub const GL_CLEAR_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82B4, .hexadecimal); pub const GL_TEXTURE_VIEW = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82B5, .hexadecimal); pub const GL_VIEW_COMPATIBILITY_CLASS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82B6, .hexadecimal); pub const GL_FULL_SUPPORT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82B7, .hexadecimal); pub const GL_CAVEAT_SUPPORT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82B8, .hexadecimal); pub const GL_IMAGE_CLASS_4_X_32 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82B9, .hexadecimal); pub const GL_IMAGE_CLASS_2_X_32 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82BA, .hexadecimal); pub const GL_IMAGE_CLASS_1_X_32 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82BB, .hexadecimal); pub const GL_IMAGE_CLASS_4_X_16 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82BC, .hexadecimal); pub const GL_IMAGE_CLASS_2_X_16 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82BD, .hexadecimal); pub const GL_IMAGE_CLASS_1_X_16 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82BE, .hexadecimal); pub const GL_IMAGE_CLASS_4_X_8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82BF, .hexadecimal); pub const GL_IMAGE_CLASS_2_X_8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82C0, .hexadecimal); pub const GL_IMAGE_CLASS_1_X_8 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82C1, .hexadecimal); pub const GL_IMAGE_CLASS_11_11_10 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82C2, .hexadecimal); pub const GL_IMAGE_CLASS_10_10_10_2 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82C3, .hexadecimal); pub const GL_VIEW_CLASS_128_BITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82C4, .hexadecimal); pub const GL_VIEW_CLASS_96_BITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82C5, .hexadecimal); pub const GL_VIEW_CLASS_64_BITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82C6, .hexadecimal); pub const GL_VIEW_CLASS_48_BITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82C7, .hexadecimal); pub const GL_VIEW_CLASS_32_BITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82C8, .hexadecimal); pub const GL_VIEW_CLASS_24_BITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82C9, .hexadecimal); pub const GL_VIEW_CLASS_16_BITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82CA, .hexadecimal); pub const GL_VIEW_CLASS_8_BITS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82CB, .hexadecimal); pub const GL_VIEW_CLASS_S3TC_DXT1_RGB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82CC, .hexadecimal); pub const GL_VIEW_CLASS_S3TC_DXT1_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82CD, .hexadecimal); pub const GL_VIEW_CLASS_S3TC_DXT3_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82CE, .hexadecimal); pub const GL_VIEW_CLASS_S3TC_DXT5_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82CF, .hexadecimal); pub const GL_VIEW_CLASS_RGTC1_RED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82D0, .hexadecimal); pub const GL_VIEW_CLASS_RGTC2_RG = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82D1, .hexadecimal); pub const GL_VIEW_CLASS_BPTC_UNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82D2, .hexadecimal); pub const GL_VIEW_CLASS_BPTC_FLOAT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82D3, .hexadecimal); pub const GL_UNIFORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92E1, .hexadecimal); pub const GL_UNIFORM_BLOCK = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92E2, .hexadecimal); pub const GL_PROGRAM_INPUT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92E3, .hexadecimal); pub const GL_PROGRAM_OUTPUT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92E4, .hexadecimal); pub const GL_BUFFER_VARIABLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92E5, .hexadecimal); pub const GL_SHADER_STORAGE_BLOCK = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92E6, .hexadecimal); pub const GL_VERTEX_SUBROUTINE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92E8, .hexadecimal); pub const GL_TESS_CONTROL_SUBROUTINE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92E9, .hexadecimal); pub const GL_TESS_EVALUATION_SUBROUTINE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92EA, .hexadecimal); pub const GL_GEOMETRY_SUBROUTINE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92EB, .hexadecimal); pub const GL_FRAGMENT_SUBROUTINE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92EC, .hexadecimal); pub const GL_COMPUTE_SUBROUTINE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92ED, .hexadecimal); pub const GL_VERTEX_SUBROUTINE_UNIFORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92EE, .hexadecimal); pub const GL_TESS_CONTROL_SUBROUTINE_UNIFORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92EF, .hexadecimal); pub const GL_TESS_EVALUATION_SUBROUTINE_UNIFORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92F0, .hexadecimal); pub const GL_GEOMETRY_SUBROUTINE_UNIFORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92F1, .hexadecimal); pub const GL_FRAGMENT_SUBROUTINE_UNIFORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92F2, .hexadecimal); pub const GL_COMPUTE_SUBROUTINE_UNIFORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92F3, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_VARYING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92F4, .hexadecimal); pub const GL_ACTIVE_RESOURCES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92F5, .hexadecimal); pub const GL_MAX_NAME_LENGTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92F6, .hexadecimal); pub const GL_MAX_NUM_ACTIVE_VARIABLES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92F7, .hexadecimal); pub const GL_MAX_NUM_COMPATIBLE_SUBROUTINES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92F8, .hexadecimal); pub const GL_NAME_LENGTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92F9, .hexadecimal); pub const GL_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92FA, .hexadecimal); pub const GL_ARRAY_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92FB, .hexadecimal); pub const GL_OFFSET = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92FC, .hexadecimal); pub const GL_BLOCK_INDEX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92FD, .hexadecimal); pub const GL_ARRAY_STRIDE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92FE, .hexadecimal); pub const GL_MATRIX_STRIDE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92FF, .hexadecimal); pub const GL_IS_ROW_MAJOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9300, .hexadecimal); pub const GL_ATOMIC_COUNTER_BUFFER_INDEX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9301, .hexadecimal); pub const GL_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9302, .hexadecimal); pub const GL_BUFFER_DATA_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9303, .hexadecimal); pub const GL_NUM_ACTIVE_VARIABLES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9304, .hexadecimal); pub const GL_ACTIVE_VARIABLES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9305, .hexadecimal); pub const GL_REFERENCED_BY_VERTEX_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9306, .hexadecimal); pub const GL_REFERENCED_BY_TESS_CONTROL_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9307, .hexadecimal); pub const GL_REFERENCED_BY_TESS_EVALUATION_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9308, .hexadecimal); pub const GL_REFERENCED_BY_GEOMETRY_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9309, .hexadecimal); pub const GL_REFERENCED_BY_FRAGMENT_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x930A, .hexadecimal); pub const GL_REFERENCED_BY_COMPUTE_SHADER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x930B, .hexadecimal); pub const GL_TOP_LEVEL_ARRAY_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x930C, .hexadecimal); pub const GL_TOP_LEVEL_ARRAY_STRIDE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x930D, .hexadecimal); pub const GL_LOCATION = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x930E, .hexadecimal); pub const GL_LOCATION_INDEX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x930F, .hexadecimal); pub const GL_IS_PER_PATCH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92E7, .hexadecimal); pub const GL_SHADER_STORAGE_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90D2, .hexadecimal); pub const GL_SHADER_STORAGE_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90D3, .hexadecimal); pub const GL_SHADER_STORAGE_BUFFER_START = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90D4, .hexadecimal); pub const GL_SHADER_STORAGE_BUFFER_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90D5, .hexadecimal); pub const GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90D6, .hexadecimal); pub const GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90D7, .hexadecimal); pub const GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90D8, .hexadecimal); pub const GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90D9, .hexadecimal); pub const GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90DA, .hexadecimal); pub const GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90DB, .hexadecimal); pub const GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90DC, .hexadecimal); pub const GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90DD, .hexadecimal); pub const GL_MAX_SHADER_STORAGE_BLOCK_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90DE, .hexadecimal); pub const GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90DF, .hexadecimal); pub const GL_SHADER_STORAGE_BARRIER_BIT = @as(c_int, 0x00002000); pub const GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F39, .hexadecimal); pub const GL_DEPTH_STENCIL_TEXTURE_MODE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90EA, .hexadecimal); pub const GL_TEXTURE_BUFFER_OFFSET = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x919D, .hexadecimal); pub const GL_TEXTURE_BUFFER_SIZE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x919E, .hexadecimal); pub const GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x919F, .hexadecimal); pub const GL_TEXTURE_VIEW_MIN_LEVEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82DB, .hexadecimal); pub const GL_TEXTURE_VIEW_NUM_LEVELS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82DC, .hexadecimal); pub const GL_TEXTURE_VIEW_MIN_LAYER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82DD, .hexadecimal); pub const GL_TEXTURE_VIEW_NUM_LAYERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82DE, .hexadecimal); pub const GL_TEXTURE_IMMUTABLE_LEVELS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82DF, .hexadecimal); pub const GL_VERTEX_ATTRIB_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82D4, .hexadecimal); pub const GL_VERTEX_ATTRIB_RELATIVE_OFFSET = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82D5, .hexadecimal); pub const GL_VERTEX_BINDING_DIVISOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82D6, .hexadecimal); pub const GL_VERTEX_BINDING_OFFSET = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82D7, .hexadecimal); pub const GL_VERTEX_BINDING_STRIDE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82D8, .hexadecimal); pub const GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82D9, .hexadecimal); pub const GL_MAX_VERTEX_ATTRIB_BINDINGS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82DA, .hexadecimal); pub const GL_VERTEX_BINDING_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F4F, .hexadecimal); pub const GL_DISPLAY_LIST = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82E7, .hexadecimal); pub const GL_VERSION_4_4 = @as(c_int, 1); pub const GL_MAX_VERTEX_ATTRIB_STRIDE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82E5, .hexadecimal); pub const GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8221, .hexadecimal); pub const GL_TEXTURE_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C2A, .hexadecimal); pub const GL_MAP_PERSISTENT_BIT = @as(c_int, 0x0040); pub const GL_MAP_COHERENT_BIT = @as(c_int, 0x0080); pub const GL_DYNAMIC_STORAGE_BIT = @as(c_int, 0x0100); pub const GL_CLIENT_STORAGE_BIT = @as(c_int, 0x0200); pub const GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT = @as(c_int, 0x00004000); pub const GL_BUFFER_IMMUTABLE_STORAGE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x821F, .hexadecimal); pub const GL_BUFFER_STORAGE_FLAGS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8220, .hexadecimal); pub const GL_CLEAR_TEXTURE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9365, .hexadecimal); pub const GL_LOCATION_COMPONENT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x934A, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BUFFER_INDEX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x934B, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x934C, .hexadecimal); pub const GL_QUERY_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9192, .hexadecimal); pub const GL_QUERY_BUFFER_BARRIER_BIT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00008000, .hexadecimal); pub const GL_QUERY_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9193, .hexadecimal); pub const GL_QUERY_RESULT_NO_WAIT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9194, .hexadecimal); pub const GL_MIRROR_CLAMP_TO_EDGE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8743, .hexadecimal); pub const GL_VERSION_4_5 = @as(c_int, 1); pub const GL_CONTEXT_LOST = @as(c_int, 0x0507); pub const GL_NEGATIVE_ONE_TO_ONE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x935E, .hexadecimal); pub const GL_ZERO_TO_ONE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x935F, .hexadecimal); pub const GL_CLIP_ORIGIN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x935C, .hexadecimal); pub const GL_CLIP_DEPTH_MODE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x935D, .hexadecimal); pub const GL_QUERY_WAIT_INVERTED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E17, .hexadecimal); pub const GL_QUERY_NO_WAIT_INVERTED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E18, .hexadecimal); pub const GL_QUERY_BY_REGION_WAIT_INVERTED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E19, .hexadecimal); pub const GL_QUERY_BY_REGION_NO_WAIT_INVERTED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E1A, .hexadecimal); pub const GL_MAX_CULL_DISTANCES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82F9, .hexadecimal); pub const GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82FA, .hexadecimal); pub const GL_TEXTURE_TARGET = @as(c_int, 0x1006); pub const GL_QUERY_TARGET = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82EA, .hexadecimal); pub const GL_GUILTY_CONTEXT_RESET = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8253, .hexadecimal); pub const GL_INNOCENT_CONTEXT_RESET = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8254, .hexadecimal); pub const GL_UNKNOWN_CONTEXT_RESET = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8255, .hexadecimal); pub const GL_RESET_NOTIFICATION_STRATEGY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8256, .hexadecimal); pub const GL_LOSE_CONTEXT_ON_RESET = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8252, .hexadecimal); pub const GL_NO_RESET_NOTIFICATION = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8261, .hexadecimal); pub const GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT = @as(c_int, 0x00000004); pub const GL_CONTEXT_RELEASE_BEHAVIOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82FB, .hexadecimal); pub const GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82FC, .hexadecimal); pub const GL_VERSION_4_6 = @as(c_int, 1); pub const GL_SHADER_BINARY_FORMAT_SPIR_V = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9551, .hexadecimal); pub const GL_SPIR_V_BINARY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9552, .hexadecimal); pub const GL_PARAMETER_BUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80EE, .hexadecimal); pub const GL_PARAMETER_BUFFER_BINDING = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80EF, .hexadecimal); pub const GL_CONTEXT_FLAG_NO_ERROR_BIT = @as(c_int, 0x00000008); pub const GL_VERTICES_SUBMITTED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82EE, .hexadecimal); pub const GL_PRIMITIVES_SUBMITTED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82EF, .hexadecimal); pub const GL_VERTEX_SHADER_INVOCATIONS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82F0, .hexadecimal); pub const GL_TESS_CONTROL_SHADER_PATCHES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82F1, .hexadecimal); pub const GL_TESS_EVALUATION_SHADER_INVOCATIONS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82F2, .hexadecimal); pub const GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82F3, .hexadecimal); pub const GL_FRAGMENT_SHADER_INVOCATIONS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82F4, .hexadecimal); pub const GL_COMPUTE_SHADER_INVOCATIONS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82F5, .hexadecimal); pub const GL_CLIPPING_INPUT_PRIMITIVES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82F6, .hexadecimal); pub const GL_CLIPPING_OUTPUT_PRIMITIVES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82F7, .hexadecimal); pub const GL_POLYGON_OFFSET_CLAMP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E1B, .hexadecimal); pub const GL_SPIR_V_EXTENSIONS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9553, .hexadecimal); pub const GL_NUM_SPIR_V_EXTENSIONS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9554, .hexadecimal); pub const GL_TEXTURE_MAX_ANISOTROPY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84FE, .hexadecimal); pub const GL_MAX_TEXTURE_MAX_ANISOTROPY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84FF, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_OVERFLOW = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82EC, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82ED, .hexadecimal); pub const GL_ARB_ES2_compatibility = @as(c_int, 1); pub const GL_ARB_ES3_1_compatibility = @as(c_int, 1); pub const GL_ARB_ES3_2_compatibility = @as(c_int, 1); pub const GL_PRIMITIVE_BOUNDING_BOX_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92BE, .hexadecimal); pub const GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9381, .hexadecimal); pub const GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9382, .hexadecimal); pub const GL_ARB_ES3_compatibility = @as(c_int, 1); pub const GL_ARB_arrays_of_arrays = @as(c_int, 1); pub const GL_ARB_base_instance = @as(c_int, 1); pub const GL_ARB_bindless_texture = @as(c_int, 1); pub const GL_UNSIGNED_INT64_ARB = @as(c_int, 0x140F); pub const GL_ARB_blend_func_extended = @as(c_int, 1); pub const GL_ARB_buffer_storage = @as(c_int, 1); pub const GL_ARB_cl_event = @as(c_int, 1); pub const GL_SYNC_CL_EVENT_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8240, .hexadecimal); pub const GL_SYNC_CL_EVENT_COMPLETE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8241, .hexadecimal); pub const GL_ARB_clear_buffer_object = @as(c_int, 1); pub const GL_ARB_clear_texture = @as(c_int, 1); pub const GL_ARB_clip_control = @as(c_int, 1); pub const GL_ARB_color_buffer_float = @as(c_int, 1); pub const GL_RGBA_FLOAT_MODE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8820, .hexadecimal); pub const GL_CLAMP_VERTEX_COLOR_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x891A, .hexadecimal); pub const GL_CLAMP_FRAGMENT_COLOR_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x891B, .hexadecimal); pub const GL_CLAMP_READ_COLOR_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x891C, .hexadecimal); pub const GL_FIXED_ONLY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x891D, .hexadecimal); pub const GL_ARB_compatibility = @as(c_int, 1); pub const GL_ARB_compressed_texture_pixel_storage = @as(c_int, 1); pub const GL_ARB_compute_shader = @as(c_int, 1); pub const GL_ARB_compute_variable_group_size = @as(c_int, 1); pub const GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9344, .hexadecimal); pub const GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90EB, .hexadecimal); pub const GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9345, .hexadecimal); pub const GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91BF, .hexadecimal); pub const GL_ARB_conditional_render_inverted = @as(c_int, 1); pub const GL_ARB_conservative_depth = @as(c_int, 1); pub const GL_ARB_copy_buffer = @as(c_int, 1); pub const GL_ARB_copy_image = @as(c_int, 1); pub const GL_ARB_cull_distance = @as(c_int, 1); pub const GL_ARB_debug_output = @as(c_int, 1); pub const GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8242, .hexadecimal); pub const GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8243, .hexadecimal); pub const GL_DEBUG_CALLBACK_FUNCTION_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8244, .hexadecimal); pub const GL_DEBUG_CALLBACK_USER_PARAM_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8245, .hexadecimal); pub const GL_DEBUG_SOURCE_API_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8246, .hexadecimal); pub const GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8247, .hexadecimal); pub const GL_DEBUG_SOURCE_SHADER_COMPILER_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8248, .hexadecimal); pub const GL_DEBUG_SOURCE_THIRD_PARTY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8249, .hexadecimal); pub const GL_DEBUG_SOURCE_APPLICATION_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x824A, .hexadecimal); pub const GL_DEBUG_SOURCE_OTHER_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x824B, .hexadecimal); pub const GL_DEBUG_TYPE_ERROR_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x824C, .hexadecimal); pub const GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x824D, .hexadecimal); pub const GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x824E, .hexadecimal); pub const GL_DEBUG_TYPE_PORTABILITY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x824F, .hexadecimal); pub const GL_DEBUG_TYPE_PERFORMANCE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8250, .hexadecimal); pub const GL_DEBUG_TYPE_OTHER_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8251, .hexadecimal); pub const GL_MAX_DEBUG_MESSAGE_LENGTH_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9143, .hexadecimal); pub const GL_MAX_DEBUG_LOGGED_MESSAGES_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9144, .hexadecimal); pub const GL_DEBUG_LOGGED_MESSAGES_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9145, .hexadecimal); pub const GL_DEBUG_SEVERITY_HIGH_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9146, .hexadecimal); pub const GL_DEBUG_SEVERITY_MEDIUM_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9147, .hexadecimal); pub const GL_DEBUG_SEVERITY_LOW_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9148, .hexadecimal); pub const GL_ARB_depth_buffer_float = @as(c_int, 1); pub const GL_ARB_depth_clamp = @as(c_int, 1); pub const GL_ARB_depth_texture = @as(c_int, 1); pub const GL_DEPTH_COMPONENT16_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81A5, .hexadecimal); pub const GL_DEPTH_COMPONENT24_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81A6, .hexadecimal); pub const GL_DEPTH_COMPONENT32_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81A7, .hexadecimal); pub const GL_TEXTURE_DEPTH_SIZE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x884A, .hexadecimal); pub const GL_DEPTH_TEXTURE_MODE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x884B, .hexadecimal); pub const GL_ARB_derivative_control = @as(c_int, 1); pub const GL_ARB_direct_state_access = @as(c_int, 1); pub const GL_ARB_draw_buffers = @as(c_int, 1); pub const GL_MAX_DRAW_BUFFERS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8824, .hexadecimal); pub const GL_DRAW_BUFFER0_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8825, .hexadecimal); pub const GL_DRAW_BUFFER1_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8826, .hexadecimal); pub const GL_DRAW_BUFFER2_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8827, .hexadecimal); pub const GL_DRAW_BUFFER3_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8828, .hexadecimal); pub const GL_DRAW_BUFFER4_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8829, .hexadecimal); pub const GL_DRAW_BUFFER5_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x882A, .hexadecimal); pub const GL_DRAW_BUFFER6_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x882B, .hexadecimal); pub const GL_DRAW_BUFFER7_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x882C, .hexadecimal); pub const GL_DRAW_BUFFER8_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x882D, .hexadecimal); pub const GL_DRAW_BUFFER9_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x882E, .hexadecimal); pub const GL_DRAW_BUFFER10_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x882F, .hexadecimal); pub const GL_DRAW_BUFFER11_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8830, .hexadecimal); pub const GL_DRAW_BUFFER12_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8831, .hexadecimal); pub const GL_DRAW_BUFFER13_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8832, .hexadecimal); pub const GL_DRAW_BUFFER14_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8833, .hexadecimal); pub const GL_DRAW_BUFFER15_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8834, .hexadecimal); pub const GL_ARB_draw_buffers_blend = @as(c_int, 1); pub const GL_ARB_draw_elements_base_vertex = @as(c_int, 1); pub const GL_ARB_draw_indirect = @as(c_int, 1); pub const GL_ARB_draw_instanced = @as(c_int, 1); pub const GL_ARB_enhanced_layouts = @as(c_int, 1); pub const GL_ARB_explicit_attrib_location = @as(c_int, 1); pub const GL_ARB_explicit_uniform_location = @as(c_int, 1); pub const GL_ARB_fragment_coord_conventions = @as(c_int, 1); pub const GL_ARB_fragment_layer_viewport = @as(c_int, 1); pub const GL_ARB_fragment_program = @as(c_int, 1); pub const GL_FRAGMENT_PROGRAM_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8804, .hexadecimal); pub const GL_PROGRAM_FORMAT_ASCII_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8875, .hexadecimal); pub const GL_PROGRAM_LENGTH_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8627, .hexadecimal); pub const GL_PROGRAM_FORMAT_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8876, .hexadecimal); pub const GL_PROGRAM_BINDING_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8677, .hexadecimal); pub const GL_PROGRAM_INSTRUCTIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88A0, .hexadecimal); pub const GL_MAX_PROGRAM_INSTRUCTIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88A1, .hexadecimal); pub const GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88A2, .hexadecimal); pub const GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88A3, .hexadecimal); pub const GL_PROGRAM_TEMPORARIES_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88A4, .hexadecimal); pub const GL_MAX_PROGRAM_TEMPORARIES_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88A5, .hexadecimal); pub const GL_PROGRAM_NATIVE_TEMPORARIES_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88A6, .hexadecimal); pub const GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88A7, .hexadecimal); pub const GL_PROGRAM_PARAMETERS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88A8, .hexadecimal); pub const GL_MAX_PROGRAM_PARAMETERS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88A9, .hexadecimal); pub const GL_PROGRAM_NATIVE_PARAMETERS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88AA, .hexadecimal); pub const GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88AB, .hexadecimal); pub const GL_PROGRAM_ATTRIBS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88AC, .hexadecimal); pub const GL_MAX_PROGRAM_ATTRIBS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88AD, .hexadecimal); pub const GL_PROGRAM_NATIVE_ATTRIBS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88AE, .hexadecimal); pub const GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88AF, .hexadecimal); pub const GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88B4, .hexadecimal); pub const GL_MAX_PROGRAM_ENV_PARAMETERS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88B5, .hexadecimal); pub const GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88B6, .hexadecimal); pub const GL_PROGRAM_ALU_INSTRUCTIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8805, .hexadecimal); pub const GL_PROGRAM_TEX_INSTRUCTIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8806, .hexadecimal); pub const GL_PROGRAM_TEX_INDIRECTIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8807, .hexadecimal); pub const GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8808, .hexadecimal); pub const GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8809, .hexadecimal); pub const GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x880A, .hexadecimal); pub const GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x880B, .hexadecimal); pub const GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x880C, .hexadecimal); pub const GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x880D, .hexadecimal); pub const GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x880E, .hexadecimal); pub const GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x880F, .hexadecimal); pub const GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8810, .hexadecimal); pub const GL_PROGRAM_STRING_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8628, .hexadecimal); pub const GL_PROGRAM_ERROR_POSITION_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x864B, .hexadecimal); pub const GL_CURRENT_MATRIX_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8641, .hexadecimal); pub const GL_TRANSPOSE_CURRENT_MATRIX_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88B7, .hexadecimal); pub const GL_CURRENT_MATRIX_STACK_DEPTH_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8640, .hexadecimal); pub const GL_MAX_PROGRAM_MATRICES_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x862F, .hexadecimal); pub const GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x862E, .hexadecimal); pub const GL_MAX_TEXTURE_COORDS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8871, .hexadecimal); pub const GL_MAX_TEXTURE_IMAGE_UNITS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8872, .hexadecimal); pub const GL_PROGRAM_ERROR_STRING_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8874, .hexadecimal); pub const GL_MATRIX0_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88C0, .hexadecimal); pub const GL_MATRIX1_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88C1, .hexadecimal); pub const GL_MATRIX2_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88C2, .hexadecimal); pub const GL_MATRIX3_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88C3, .hexadecimal); pub const GL_MATRIX4_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88C4, .hexadecimal); pub const GL_MATRIX5_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88C5, .hexadecimal); pub const GL_MATRIX6_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88C6, .hexadecimal); pub const GL_MATRIX7_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88C7, .hexadecimal); pub const GL_MATRIX8_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88C8, .hexadecimal); pub const GL_MATRIX9_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88C9, .hexadecimal); pub const GL_MATRIX10_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88CA, .hexadecimal); pub const GL_MATRIX11_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88CB, .hexadecimal); pub const GL_MATRIX12_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88CC, .hexadecimal); pub const GL_MATRIX13_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88CD, .hexadecimal); pub const GL_MATRIX14_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88CE, .hexadecimal); pub const GL_MATRIX15_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88CF, .hexadecimal); pub const GL_MATRIX16_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88D0, .hexadecimal); pub const GL_MATRIX17_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88D1, .hexadecimal); pub const GL_MATRIX18_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88D2, .hexadecimal); pub const GL_MATRIX19_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88D3, .hexadecimal); pub const GL_MATRIX20_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88D4, .hexadecimal); pub const GL_MATRIX21_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88D5, .hexadecimal); pub const GL_MATRIX22_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88D6, .hexadecimal); pub const GL_MATRIX23_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88D7, .hexadecimal); pub const GL_MATRIX24_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88D8, .hexadecimal); pub const GL_MATRIX25_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88D9, .hexadecimal); pub const GL_MATRIX26_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88DA, .hexadecimal); pub const GL_MATRIX27_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88DB, .hexadecimal); pub const GL_MATRIX28_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88DC, .hexadecimal); pub const GL_MATRIX29_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88DD, .hexadecimal); pub const GL_MATRIX30_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88DE, .hexadecimal); pub const GL_MATRIX31_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88DF, .hexadecimal); pub const GL_ARB_fragment_program_shadow = @as(c_int, 1); pub const GL_ARB_fragment_shader = @as(c_int, 1); pub const GL_FRAGMENT_SHADER_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B30, .hexadecimal); pub const GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B49, .hexadecimal); pub const GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B8B, .hexadecimal); pub const GL_ARB_fragment_shader_interlock = @as(c_int, 1); pub const GL_ARB_framebuffer_no_attachments = @as(c_int, 1); pub const GL_ARB_framebuffer_object = @as(c_int, 1); pub const GL_ARB_framebuffer_sRGB = @as(c_int, 1); pub const GL_ARB_geometry_shader4 = @as(c_int, 1); pub const GL_LINES_ADJACENCY_ARB = @as(c_int, 0x000A); pub const GL_LINE_STRIP_ADJACENCY_ARB = @as(c_int, 0x000B); pub const GL_TRIANGLES_ADJACENCY_ARB = @as(c_int, 0x000C); pub const GL_TRIANGLE_STRIP_ADJACENCY_ARB = @as(c_int, 0x000D); pub const GL_PROGRAM_POINT_SIZE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8642, .hexadecimal); pub const GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C29, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DA7, .hexadecimal); pub const GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DA8, .hexadecimal); pub const GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DA9, .hexadecimal); pub const GL_GEOMETRY_SHADER_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DD9, .hexadecimal); pub const GL_GEOMETRY_VERTICES_OUT_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DDA, .hexadecimal); pub const GL_GEOMETRY_INPUT_TYPE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DDB, .hexadecimal); pub const GL_GEOMETRY_OUTPUT_TYPE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DDC, .hexadecimal); pub const GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DDD, .hexadecimal); pub const GL_MAX_VERTEX_VARYING_COMPONENTS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DDE, .hexadecimal); pub const GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DDF, .hexadecimal); pub const GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DE0, .hexadecimal); pub const GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DE1, .hexadecimal); pub const GL_ARB_get_program_binary = @as(c_int, 1); pub const GL_ARB_get_texture_sub_image = @as(c_int, 1); pub const GL_ARB_gl_spirv = @as(c_int, 1); pub const GL_SHADER_BINARY_FORMAT_SPIR_V_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9551, .hexadecimal); pub const GL_SPIR_V_BINARY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9552, .hexadecimal); pub const GL_ARB_gpu_shader5 = @as(c_int, 1); pub const GL_ARB_gpu_shader_fp64 = @as(c_int, 1); pub const GL_ARB_gpu_shader_int64 = @as(c_int, 1); pub const GL_INT64_ARB = @as(c_int, 0x140E); pub const GL_INT64_VEC2_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FE9, .hexadecimal); pub const GL_INT64_VEC3_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FEA, .hexadecimal); pub const GL_INT64_VEC4_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FEB, .hexadecimal); pub const GL_UNSIGNED_INT64_VEC2_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FF5, .hexadecimal); pub const GL_UNSIGNED_INT64_VEC3_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FF6, .hexadecimal); pub const GL_UNSIGNED_INT64_VEC4_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FF7, .hexadecimal); pub const GL_ARB_half_float_pixel = @as(c_int, 1); pub const GL_HALF_FLOAT_ARB = @as(c_int, 0x140B); pub const GL_ARB_half_float_vertex = @as(c_int, 1); pub const GL_ARB_indirect_parameters = @as(c_int, 1); pub const GL_PARAMETER_BUFFER_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80EE, .hexadecimal); pub const GL_PARAMETER_BUFFER_BINDING_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80EF, .hexadecimal); pub const GL_ARB_instanced_arrays = @as(c_int, 1); pub const GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88FE, .hexadecimal); pub const GL_ARB_internalformat_query = @as(c_int, 1); pub const GL_ARB_internalformat_query2 = @as(c_int, 1); pub const GL_SRGB_DECODE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8299, .hexadecimal); pub const GL_VIEW_CLASS_EAC_R11 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9383, .hexadecimal); pub const GL_VIEW_CLASS_EAC_RG11 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9384, .hexadecimal); pub const GL_VIEW_CLASS_ETC2_RGB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9385, .hexadecimal); pub const GL_VIEW_CLASS_ETC2_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9386, .hexadecimal); pub const GL_VIEW_CLASS_ETC2_EAC_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9387, .hexadecimal); pub const GL_VIEW_CLASS_ASTC_4x4_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9388, .hexadecimal); pub const GL_VIEW_CLASS_ASTC_5x4_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9389, .hexadecimal); pub const GL_VIEW_CLASS_ASTC_5x5_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x938A, .hexadecimal); pub const GL_VIEW_CLASS_ASTC_6x5_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x938B, .hexadecimal); pub const GL_VIEW_CLASS_ASTC_6x6_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x938C, .hexadecimal); pub const GL_VIEW_CLASS_ASTC_8x5_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x938D, .hexadecimal); pub const GL_VIEW_CLASS_ASTC_8x6_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x938E, .hexadecimal); pub const GL_VIEW_CLASS_ASTC_8x8_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x938F, .hexadecimal); pub const GL_VIEW_CLASS_ASTC_10x5_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9390, .hexadecimal); pub const GL_VIEW_CLASS_ASTC_10x6_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9391, .hexadecimal); pub const GL_VIEW_CLASS_ASTC_10x8_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9392, .hexadecimal); pub const GL_VIEW_CLASS_ASTC_10x10_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9393, .hexadecimal); pub const GL_VIEW_CLASS_ASTC_12x10_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9394, .hexadecimal); pub const GL_VIEW_CLASS_ASTC_12x12_RGBA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9395, .hexadecimal); pub const GL_ARB_invalidate_subdata = @as(c_int, 1); pub const GL_ARB_map_buffer_alignment = @as(c_int, 1); pub const GL_ARB_map_buffer_range = @as(c_int, 1); pub const GL_ARB_matrix_palette = @as(c_int, 1); pub const GL_MATRIX_PALETTE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8840, .hexadecimal); pub const GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8841, .hexadecimal); pub const GL_MAX_PALETTE_MATRICES_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8842, .hexadecimal); pub const GL_CURRENT_PALETTE_MATRIX_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8843, .hexadecimal); pub const GL_MATRIX_INDEX_ARRAY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8844, .hexadecimal); pub const GL_CURRENT_MATRIX_INDEX_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8845, .hexadecimal); pub const GL_MATRIX_INDEX_ARRAY_SIZE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8846, .hexadecimal); pub const GL_MATRIX_INDEX_ARRAY_TYPE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8847, .hexadecimal); pub const GL_MATRIX_INDEX_ARRAY_STRIDE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8848, .hexadecimal); pub const GL_MATRIX_INDEX_ARRAY_POINTER_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8849, .hexadecimal); pub const GL_ARB_multi_bind = @as(c_int, 1); pub const GL_ARB_multi_draw_indirect = @as(c_int, 1); pub const GL_ARB_multisample = @as(c_int, 1); pub const GL_MULTISAMPLE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x809D, .hexadecimal); pub const GL_SAMPLE_ALPHA_TO_COVERAGE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x809E, .hexadecimal); pub const GL_SAMPLE_ALPHA_TO_ONE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x809F, .hexadecimal); pub const GL_SAMPLE_COVERAGE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A0, .hexadecimal); pub const GL_SAMPLE_BUFFERS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A8, .hexadecimal); pub const GL_SAMPLES_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A9, .hexadecimal); pub const GL_SAMPLE_COVERAGE_VALUE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80AA, .hexadecimal); pub const GL_SAMPLE_COVERAGE_INVERT_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80AB, .hexadecimal); pub const GL_MULTISAMPLE_BIT_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x20000000, .hexadecimal); pub const GL_ARB_occlusion_query = @as(c_int, 1); pub const GL_QUERY_COUNTER_BITS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8864, .hexadecimal); pub const GL_CURRENT_QUERY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8865, .hexadecimal); pub const GL_QUERY_RESULT_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8866, .hexadecimal); pub const GL_QUERY_RESULT_AVAILABLE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8867, .hexadecimal); pub const GL_SAMPLES_PASSED_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8914, .hexadecimal); pub const GL_ARB_occlusion_query2 = @as(c_int, 1); pub const GL_ARB_parallel_shader_compile = @as(c_int, 1); pub const GL_MAX_SHADER_COMPILER_THREADS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91B0, .hexadecimal); pub const GL_COMPLETION_STATUS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91B1, .hexadecimal); pub const GL_ARB_pipeline_statistics_query = @as(c_int, 1); pub const GL_VERTICES_SUBMITTED_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82EE, .hexadecimal); pub const GL_PRIMITIVES_SUBMITTED_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82EF, .hexadecimal); pub const GL_VERTEX_SHADER_INVOCATIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82F0, .hexadecimal); pub const GL_TESS_CONTROL_SHADER_PATCHES_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82F1, .hexadecimal); pub const GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82F2, .hexadecimal); pub const GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82F3, .hexadecimal); pub const GL_FRAGMENT_SHADER_INVOCATIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82F4, .hexadecimal); pub const GL_COMPUTE_SHADER_INVOCATIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82F5, .hexadecimal); pub const GL_CLIPPING_INPUT_PRIMITIVES_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82F6, .hexadecimal); pub const GL_CLIPPING_OUTPUT_PRIMITIVES_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82F7, .hexadecimal); pub const GL_ARB_pixel_buffer_object = @as(c_int, 1); pub const GL_PIXEL_PACK_BUFFER_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88EB, .hexadecimal); pub const GL_PIXEL_UNPACK_BUFFER_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88EC, .hexadecimal); pub const GL_PIXEL_PACK_BUFFER_BINDING_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88ED, .hexadecimal); pub const GL_PIXEL_UNPACK_BUFFER_BINDING_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88EF, .hexadecimal); pub const GL_ARB_point_parameters = @as(c_int, 1); pub const GL_POINT_SIZE_MIN_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8126, .hexadecimal); pub const GL_POINT_SIZE_MAX_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8127, .hexadecimal); pub const GL_POINT_FADE_THRESHOLD_SIZE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8128, .hexadecimal); pub const GL_POINT_DISTANCE_ATTENUATION_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8129, .hexadecimal); pub const GL_ARB_point_sprite = @as(c_int, 1); pub const GL_POINT_SPRITE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8861, .hexadecimal); pub const GL_COORD_REPLACE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8862, .hexadecimal); pub const GL_ARB_polygon_offset_clamp = @as(c_int, 1); pub const GL_ARB_post_depth_coverage = @as(c_int, 1); pub const GL_ARB_program_interface_query = @as(c_int, 1); pub const GL_ARB_provoking_vertex = @as(c_int, 1); pub const GL_ARB_query_buffer_object = @as(c_int, 1); pub const GL_ARB_robust_buffer_access_behavior = @as(c_int, 1); pub const GL_ARB_robustness = @as(c_int, 1); pub const GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB = @as(c_int, 0x00000004); pub const GL_LOSE_CONTEXT_ON_RESET_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8252, .hexadecimal); pub const GL_GUILTY_CONTEXT_RESET_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8253, .hexadecimal); pub const GL_INNOCENT_CONTEXT_RESET_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8254, .hexadecimal); pub const GL_UNKNOWN_CONTEXT_RESET_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8255, .hexadecimal); pub const GL_RESET_NOTIFICATION_STRATEGY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8256, .hexadecimal); pub const GL_NO_RESET_NOTIFICATION_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8261, .hexadecimal); pub const GL_ARB_robustness_isolation = @as(c_int, 1); pub const GL_ARB_sample_locations = @as(c_int, 1); pub const GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x933D, .hexadecimal); pub const GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x933E, .hexadecimal); pub const GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x933F, .hexadecimal); pub const GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9340, .hexadecimal); pub const GL_SAMPLE_LOCATION_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E50, .hexadecimal); pub const GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9341, .hexadecimal); pub const GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9342, .hexadecimal); pub const GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9343, .hexadecimal); pub const GL_ARB_sample_shading = @as(c_int, 1); pub const GL_SAMPLE_SHADING_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C36, .hexadecimal); pub const GL_MIN_SAMPLE_SHADING_VALUE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C37, .hexadecimal); pub const GL_ARB_sampler_objects = @as(c_int, 1); pub const GL_ARB_seamless_cube_map = @as(c_int, 1); pub const GL_ARB_seamless_cubemap_per_texture = @as(c_int, 1); pub const GL_ARB_separate_shader_objects = @as(c_int, 1); pub const GL_ARB_shader_atomic_counter_ops = @as(c_int, 1); pub const GL_ARB_shader_atomic_counters = @as(c_int, 1); pub const GL_ARB_shader_ballot = @as(c_int, 1); pub const GL_ARB_shader_bit_encoding = @as(c_int, 1); pub const GL_ARB_shader_clock = @as(c_int, 1); pub const GL_ARB_shader_draw_parameters = @as(c_int, 1); pub const GL_ARB_shader_group_vote = @as(c_int, 1); pub const GL_ARB_shader_image_load_store = @as(c_int, 1); pub const GL_ARB_shader_image_size = @as(c_int, 1); pub const GL_ARB_shader_objects = @as(c_int, 1); pub const GL_PROGRAM_OBJECT_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B40, .hexadecimal); pub const GL_SHADER_OBJECT_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B48, .hexadecimal); pub const GL_OBJECT_TYPE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B4E, .hexadecimal); pub const GL_OBJECT_SUBTYPE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B4F, .hexadecimal); pub const GL_FLOAT_VEC2_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B50, .hexadecimal); pub const GL_FLOAT_VEC3_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B51, .hexadecimal); pub const GL_FLOAT_VEC4_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B52, .hexadecimal); pub const GL_INT_VEC2_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B53, .hexadecimal); pub const GL_INT_VEC3_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B54, .hexadecimal); pub const GL_INT_VEC4_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B55, .hexadecimal); pub const GL_BOOL_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B56, .hexadecimal); pub const GL_BOOL_VEC2_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B57, .hexadecimal); pub const GL_BOOL_VEC3_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B58, .hexadecimal); pub const GL_BOOL_VEC4_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B59, .hexadecimal); pub const GL_FLOAT_MAT2_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B5A, .hexadecimal); pub const GL_FLOAT_MAT3_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B5B, .hexadecimal); pub const GL_FLOAT_MAT4_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B5C, .hexadecimal); pub const GL_SAMPLER_1D_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B5D, .hexadecimal); pub const GL_SAMPLER_2D_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B5E, .hexadecimal); pub const GL_SAMPLER_3D_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B5F, .hexadecimal); pub const GL_SAMPLER_CUBE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B60, .hexadecimal); pub const GL_SAMPLER_1D_SHADOW_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B61, .hexadecimal); pub const GL_SAMPLER_2D_SHADOW_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B62, .hexadecimal); pub const GL_SAMPLER_2D_RECT_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B63, .hexadecimal); pub const GL_SAMPLER_2D_RECT_SHADOW_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B64, .hexadecimal); pub const GL_OBJECT_DELETE_STATUS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B80, .hexadecimal); pub const GL_OBJECT_COMPILE_STATUS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B81, .hexadecimal); pub const GL_OBJECT_LINK_STATUS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B82, .hexadecimal); pub const GL_OBJECT_VALIDATE_STATUS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B83, .hexadecimal); pub const GL_OBJECT_INFO_LOG_LENGTH_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B84, .hexadecimal); pub const GL_OBJECT_ATTACHED_OBJECTS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B85, .hexadecimal); pub const GL_OBJECT_ACTIVE_UNIFORMS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B86, .hexadecimal); pub const GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B87, .hexadecimal); pub const GL_OBJECT_SHADER_SOURCE_LENGTH_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B88, .hexadecimal); pub const GL_ARB_shader_precision = @as(c_int, 1); pub const GL_ARB_shader_stencil_export = @as(c_int, 1); pub const GL_ARB_shader_storage_buffer_object = @as(c_int, 1); pub const GL_ARB_shader_subroutine = @as(c_int, 1); pub const GL_ARB_shader_texture_image_samples = @as(c_int, 1); pub const GL_ARB_shader_texture_lod = @as(c_int, 1); pub const GL_ARB_shader_viewport_layer_array = @as(c_int, 1); pub const GL_ARB_shading_language_100 = @as(c_int, 1); pub const GL_SHADING_LANGUAGE_VERSION_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B8C, .hexadecimal); pub const GL_ARB_shading_language_420pack = @as(c_int, 1); pub const GL_ARB_shading_language_include = @as(c_int, 1); pub const GL_SHADER_INCLUDE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DAE, .hexadecimal); pub const GL_NAMED_STRING_LENGTH_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DE9, .hexadecimal); pub const GL_NAMED_STRING_TYPE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DEA, .hexadecimal); pub const GL_ARB_shading_language_packing = @as(c_int, 1); pub const GL_ARB_shadow = @as(c_int, 1); pub const GL_TEXTURE_COMPARE_MODE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x884C, .hexadecimal); pub const GL_TEXTURE_COMPARE_FUNC_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x884D, .hexadecimal); pub const GL_COMPARE_R_TO_TEXTURE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x884E, .hexadecimal); pub const GL_ARB_shadow_ambient = @as(c_int, 1); pub const GL_TEXTURE_COMPARE_FAIL_VALUE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80BF, .hexadecimal); pub const GL_ARB_sparse_buffer = @as(c_int, 1); pub const GL_SPARSE_STORAGE_BIT_ARB = @as(c_int, 0x0400); pub const GL_SPARSE_BUFFER_PAGE_SIZE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82F8, .hexadecimal); pub const GL_ARB_sparse_texture = @as(c_int, 1); pub const GL_TEXTURE_SPARSE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91A6, .hexadecimal); pub const GL_VIRTUAL_PAGE_SIZE_INDEX_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91A7, .hexadecimal); pub const GL_NUM_SPARSE_LEVELS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91AA, .hexadecimal); pub const GL_NUM_VIRTUAL_PAGE_SIZES_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91A8, .hexadecimal); pub const GL_VIRTUAL_PAGE_SIZE_X_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9195, .hexadecimal); pub const GL_VIRTUAL_PAGE_SIZE_Y_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9196, .hexadecimal); pub const GL_VIRTUAL_PAGE_SIZE_Z_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9197, .hexadecimal); pub const GL_MAX_SPARSE_TEXTURE_SIZE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9198, .hexadecimal); pub const GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9199, .hexadecimal); pub const GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x919A, .hexadecimal); pub const GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91A9, .hexadecimal); pub const GL_ARB_sparse_texture2 = @as(c_int, 1); pub const GL_ARB_sparse_texture_clamp = @as(c_int, 1); pub const GL_ARB_spirv_extensions = @as(c_int, 1); pub const GL_ARB_stencil_texturing = @as(c_int, 1); pub const GL_ARB_sync = @as(c_int, 1); pub const GL_ARB_tessellation_shader = @as(c_int, 1); pub const GL_ARB_texture_barrier = @as(c_int, 1); pub const GL_ARB_texture_border_clamp = @as(c_int, 1); pub const GL_CLAMP_TO_BORDER_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x812D, .hexadecimal); pub const GL_ARB_texture_buffer_object = @as(c_int, 1); pub const GL_TEXTURE_BUFFER_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C2A, .hexadecimal); pub const GL_MAX_TEXTURE_BUFFER_SIZE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C2B, .hexadecimal); pub const GL_TEXTURE_BINDING_BUFFER_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C2C, .hexadecimal); pub const GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C2D, .hexadecimal); pub const GL_TEXTURE_BUFFER_FORMAT_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C2E, .hexadecimal); pub const GL_ARB_texture_buffer_object_rgb32 = @as(c_int, 1); pub const GL_ARB_texture_buffer_range = @as(c_int, 1); pub const GL_ARB_texture_compression = @as(c_int, 1); pub const GL_COMPRESSED_ALPHA_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E9, .hexadecimal); pub const GL_COMPRESSED_LUMINANCE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84EA, .hexadecimal); pub const GL_COMPRESSED_LUMINANCE_ALPHA_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84EB, .hexadecimal); pub const GL_COMPRESSED_INTENSITY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84EC, .hexadecimal); pub const GL_COMPRESSED_RGB_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84ED, .hexadecimal); pub const GL_COMPRESSED_RGBA_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84EE, .hexadecimal); pub const GL_TEXTURE_COMPRESSION_HINT_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84EF, .hexadecimal); pub const GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86A0, .hexadecimal); pub const GL_TEXTURE_COMPRESSED_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86A1, .hexadecimal); pub const GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86A2, .hexadecimal); pub const GL_COMPRESSED_TEXTURE_FORMATS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86A3, .hexadecimal); pub const GL_ARB_texture_compression_bptc = @as(c_int, 1); pub const GL_COMPRESSED_RGBA_BPTC_UNORM_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E8C, .hexadecimal); pub const GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E8D, .hexadecimal); pub const GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E8E, .hexadecimal); pub const GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E8F, .hexadecimal); pub const GL_ARB_texture_compression_rgtc = @as(c_int, 1); pub const GL_ARB_texture_cube_map = @as(c_int, 1); pub const GL_NORMAL_MAP_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8511, .hexadecimal); pub const GL_REFLECTION_MAP_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8512, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8513, .hexadecimal); pub const GL_TEXTURE_BINDING_CUBE_MAP_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8514, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8515, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8516, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8517, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8518, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8519, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x851A, .hexadecimal); pub const GL_PROXY_TEXTURE_CUBE_MAP_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x851B, .hexadecimal); pub const GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x851C, .hexadecimal); pub const GL_ARB_texture_cube_map_array = @as(c_int, 1); pub const GL_TEXTURE_CUBE_MAP_ARRAY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9009, .hexadecimal); pub const GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x900A, .hexadecimal); pub const GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x900B, .hexadecimal); pub const GL_SAMPLER_CUBE_MAP_ARRAY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x900C, .hexadecimal); pub const GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x900D, .hexadecimal); pub const GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x900E, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x900F, .hexadecimal); pub const GL_ARB_texture_env_add = @as(c_int, 1); pub const GL_ARB_texture_env_combine = @as(c_int, 1); pub const GL_COMBINE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8570, .hexadecimal); pub const GL_COMBINE_RGB_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8571, .hexadecimal); pub const GL_COMBINE_ALPHA_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8572, .hexadecimal); pub const GL_SOURCE0_RGB_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8580, .hexadecimal); pub const GL_SOURCE1_RGB_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8581, .hexadecimal); pub const GL_SOURCE2_RGB_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8582, .hexadecimal); pub const GL_SOURCE0_ALPHA_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8588, .hexadecimal); pub const GL_SOURCE1_ALPHA_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8589, .hexadecimal); pub const GL_SOURCE2_ALPHA_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x858A, .hexadecimal); pub const GL_OPERAND0_RGB_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8590, .hexadecimal); pub const GL_OPERAND1_RGB_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8591, .hexadecimal); pub const GL_OPERAND2_RGB_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8592, .hexadecimal); pub const GL_OPERAND0_ALPHA_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8598, .hexadecimal); pub const GL_OPERAND1_ALPHA_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8599, .hexadecimal); pub const GL_OPERAND2_ALPHA_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x859A, .hexadecimal); pub const GL_RGB_SCALE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8573, .hexadecimal); pub const GL_ADD_SIGNED_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8574, .hexadecimal); pub const GL_INTERPOLATE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8575, .hexadecimal); pub const GL_SUBTRACT_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E7, .hexadecimal); pub const GL_CONSTANT_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8576, .hexadecimal); pub const GL_PRIMARY_COLOR_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8577, .hexadecimal); pub const GL_PREVIOUS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8578, .hexadecimal); pub const GL_ARB_texture_env_crossbar = @as(c_int, 1); pub const GL_ARB_texture_env_dot3 = @as(c_int, 1); pub const GL_DOT3_RGB_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86AE, .hexadecimal); pub const GL_DOT3_RGBA_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86AF, .hexadecimal); pub const GL_ARB_texture_filter_anisotropic = @as(c_int, 1); pub const GL_ARB_texture_filter_minmax = @as(c_int, 1); pub const GL_TEXTURE_REDUCTION_MODE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9366, .hexadecimal); pub const GL_WEIGHTED_AVERAGE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9367, .hexadecimal); pub const GL_ARB_texture_float = @as(c_int, 1); pub const GL_TEXTURE_RED_TYPE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C10, .hexadecimal); pub const GL_TEXTURE_GREEN_TYPE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C11, .hexadecimal); pub const GL_TEXTURE_BLUE_TYPE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C12, .hexadecimal); pub const GL_TEXTURE_ALPHA_TYPE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C13, .hexadecimal); pub const GL_TEXTURE_LUMINANCE_TYPE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C14, .hexadecimal); pub const GL_TEXTURE_INTENSITY_TYPE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C15, .hexadecimal); pub const GL_TEXTURE_DEPTH_TYPE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C16, .hexadecimal); pub const GL_UNSIGNED_NORMALIZED_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C17, .hexadecimal); pub const GL_RGBA32F_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8814, .hexadecimal); pub const GL_RGB32F_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8815, .hexadecimal); pub const GL_ALPHA32F_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8816, .hexadecimal); pub const GL_INTENSITY32F_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8817, .hexadecimal); pub const GL_LUMINANCE32F_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8818, .hexadecimal); pub const GL_LUMINANCE_ALPHA32F_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8819, .hexadecimal); pub const GL_RGBA16F_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x881A, .hexadecimal); pub const GL_RGB16F_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x881B, .hexadecimal); pub const GL_ALPHA16F_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x881C, .hexadecimal); pub const GL_INTENSITY16F_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x881D, .hexadecimal); pub const GL_LUMINANCE16F_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x881E, .hexadecimal); pub const GL_LUMINANCE_ALPHA16F_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x881F, .hexadecimal); pub const GL_ARB_texture_gather = @as(c_int, 1); pub const GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E5E, .hexadecimal); pub const GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E5F, .hexadecimal); pub const GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F9F, .hexadecimal); pub const GL_ARB_texture_mirror_clamp_to_edge = @as(c_int, 1); pub const GL_ARB_texture_mirrored_repeat = @as(c_int, 1); pub const GL_MIRRORED_REPEAT_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8370, .hexadecimal); pub const GL_ARB_texture_multisample = @as(c_int, 1); pub const GL_ARB_texture_non_power_of_two = @as(c_int, 1); pub const GL_ARB_texture_query_levels = @as(c_int, 1); pub const GL_ARB_texture_query_lod = @as(c_int, 1); pub const GL_ARB_texture_rectangle = @as(c_int, 1); pub const GL_TEXTURE_RECTANGLE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84F5, .hexadecimal); pub const GL_TEXTURE_BINDING_RECTANGLE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84F6, .hexadecimal); pub const GL_PROXY_TEXTURE_RECTANGLE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84F7, .hexadecimal); pub const GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84F8, .hexadecimal); pub const GL_ARB_texture_rg = @as(c_int, 1); pub const GL_ARB_texture_rgb10_a2ui = @as(c_int, 1); pub const GL_ARB_texture_stencil8 = @as(c_int, 1); pub const GL_ARB_texture_storage = @as(c_int, 1); pub const GL_ARB_texture_storage_multisample = @as(c_int, 1); pub const GL_ARB_texture_swizzle = @as(c_int, 1); pub const GL_ARB_texture_view = @as(c_int, 1); pub const GL_ARB_timer_query = @as(c_int, 1); pub const GL_ARB_transform_feedback2 = @as(c_int, 1); pub const GL_ARB_transform_feedback3 = @as(c_int, 1); pub const GL_ARB_transform_feedback_instanced = @as(c_int, 1); pub const GL_ARB_transform_feedback_overflow_query = @as(c_int, 1); pub const GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82EC, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x82ED, .hexadecimal); pub const GL_ARB_transpose_matrix = @as(c_int, 1); pub const GL_TRANSPOSE_MODELVIEW_MATRIX_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E3, .hexadecimal); pub const GL_TRANSPOSE_PROJECTION_MATRIX_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E4, .hexadecimal); pub const GL_TRANSPOSE_TEXTURE_MATRIX_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E5, .hexadecimal); pub const GL_TRANSPOSE_COLOR_MATRIX_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E6, .hexadecimal); pub const GL_ARB_uniform_buffer_object = @as(c_int, 1); pub const GL_ARB_vertex_array_bgra = @as(c_int, 1); pub const GL_ARB_vertex_array_object = @as(c_int, 1); pub const GL_ARB_vertex_attrib_64bit = @as(c_int, 1); pub const GL_ARB_vertex_attrib_binding = @as(c_int, 1); pub const GL_ARB_vertex_blend = @as(c_int, 1); pub const GL_MAX_VERTEX_UNITS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86A4, .hexadecimal); pub const GL_ACTIVE_VERTEX_UNITS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86A5, .hexadecimal); pub const GL_WEIGHT_SUM_UNITY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86A6, .hexadecimal); pub const GL_VERTEX_BLEND_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86A7, .hexadecimal); pub const GL_CURRENT_WEIGHT_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86A8, .hexadecimal); pub const GL_WEIGHT_ARRAY_TYPE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86A9, .hexadecimal); pub const GL_WEIGHT_ARRAY_STRIDE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86AA, .hexadecimal); pub const GL_WEIGHT_ARRAY_SIZE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86AB, .hexadecimal); pub const GL_WEIGHT_ARRAY_POINTER_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86AC, .hexadecimal); pub const GL_WEIGHT_ARRAY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86AD, .hexadecimal); pub const GL_MODELVIEW0_ARB = @as(c_int, 0x1700); pub const GL_MODELVIEW1_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x850A, .hexadecimal); pub const GL_MODELVIEW2_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8722, .hexadecimal); pub const GL_MODELVIEW3_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8723, .hexadecimal); pub const GL_MODELVIEW4_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8724, .hexadecimal); pub const GL_MODELVIEW5_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8725, .hexadecimal); pub const GL_MODELVIEW6_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8726, .hexadecimal); pub const GL_MODELVIEW7_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8727, .hexadecimal); pub const GL_MODELVIEW8_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8728, .hexadecimal); pub const GL_MODELVIEW9_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8729, .hexadecimal); pub const GL_MODELVIEW10_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x872A, .hexadecimal); pub const GL_MODELVIEW11_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x872B, .hexadecimal); pub const GL_MODELVIEW12_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x872C, .hexadecimal); pub const GL_MODELVIEW13_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x872D, .hexadecimal); pub const GL_MODELVIEW14_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x872E, .hexadecimal); pub const GL_MODELVIEW15_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x872F, .hexadecimal); pub const GL_MODELVIEW16_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8730, .hexadecimal); pub const GL_MODELVIEW17_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8731, .hexadecimal); pub const GL_MODELVIEW18_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8732, .hexadecimal); pub const GL_MODELVIEW19_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8733, .hexadecimal); pub const GL_MODELVIEW20_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8734, .hexadecimal); pub const GL_MODELVIEW21_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8735, .hexadecimal); pub const GL_MODELVIEW22_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8736, .hexadecimal); pub const GL_MODELVIEW23_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8737, .hexadecimal); pub const GL_MODELVIEW24_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8738, .hexadecimal); pub const GL_MODELVIEW25_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8739, .hexadecimal); pub const GL_MODELVIEW26_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x873A, .hexadecimal); pub const GL_MODELVIEW27_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x873B, .hexadecimal); pub const GL_MODELVIEW28_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x873C, .hexadecimal); pub const GL_MODELVIEW29_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x873D, .hexadecimal); pub const GL_MODELVIEW30_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x873E, .hexadecimal); pub const GL_MODELVIEW31_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x873F, .hexadecimal); pub const GL_ARB_vertex_buffer_object = @as(c_int, 1); pub const GL_BUFFER_SIZE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8764, .hexadecimal); pub const GL_BUFFER_USAGE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8765, .hexadecimal); pub const GL_ARRAY_BUFFER_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8892, .hexadecimal); pub const GL_ELEMENT_ARRAY_BUFFER_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8893, .hexadecimal); pub const GL_ARRAY_BUFFER_BINDING_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8894, .hexadecimal); pub const GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8895, .hexadecimal); pub const GL_VERTEX_ARRAY_BUFFER_BINDING_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8896, .hexadecimal); pub const GL_NORMAL_ARRAY_BUFFER_BINDING_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8897, .hexadecimal); pub const GL_COLOR_ARRAY_BUFFER_BINDING_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8898, .hexadecimal); pub const GL_INDEX_ARRAY_BUFFER_BINDING_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8899, .hexadecimal); pub const GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x889A, .hexadecimal); pub const GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x889B, .hexadecimal); pub const GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x889C, .hexadecimal); pub const GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x889D, .hexadecimal); pub const GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x889E, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x889F, .hexadecimal); pub const GL_READ_ONLY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88B8, .hexadecimal); pub const GL_WRITE_ONLY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88B9, .hexadecimal); pub const GL_READ_WRITE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88BA, .hexadecimal); pub const GL_BUFFER_ACCESS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88BB, .hexadecimal); pub const GL_BUFFER_MAPPED_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88BC, .hexadecimal); pub const GL_BUFFER_MAP_POINTER_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88BD, .hexadecimal); pub const GL_STREAM_DRAW_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88E0, .hexadecimal); pub const GL_STREAM_READ_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88E1, .hexadecimal); pub const GL_STREAM_COPY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88E2, .hexadecimal); pub const GL_STATIC_DRAW_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88E4, .hexadecimal); pub const GL_STATIC_READ_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88E5, .hexadecimal); pub const GL_STATIC_COPY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88E6, .hexadecimal); pub const GL_DYNAMIC_DRAW_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88E8, .hexadecimal); pub const GL_DYNAMIC_READ_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88E9, .hexadecimal); pub const GL_DYNAMIC_COPY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88EA, .hexadecimal); pub const GL_ARB_vertex_program = @as(c_int, 1); pub const GL_COLOR_SUM_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8458, .hexadecimal); pub const GL_VERTEX_PROGRAM_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8620, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8622, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8623, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8624, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8625, .hexadecimal); pub const GL_CURRENT_VERTEX_ATTRIB_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8626, .hexadecimal); pub const GL_VERTEX_PROGRAM_POINT_SIZE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8642, .hexadecimal); pub const GL_VERTEX_PROGRAM_TWO_SIDE_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8643, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8645, .hexadecimal); pub const GL_MAX_VERTEX_ATTRIBS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8869, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x886A, .hexadecimal); pub const GL_PROGRAM_ADDRESS_REGISTERS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88B0, .hexadecimal); pub const GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88B1, .hexadecimal); pub const GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88B2, .hexadecimal); pub const GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88B3, .hexadecimal); pub const GL_ARB_vertex_shader = @as(c_int, 1); pub const GL_VERTEX_SHADER_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B31, .hexadecimal); pub const GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B4A, .hexadecimal); pub const GL_MAX_VARYING_FLOATS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B4B, .hexadecimal); pub const GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B4C, .hexadecimal); pub const GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B4D, .hexadecimal); pub const GL_OBJECT_ACTIVE_ATTRIBUTES_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B89, .hexadecimal); pub const GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B8A, .hexadecimal); pub const GL_ARB_vertex_type_10f_11f_11f_rev = @as(c_int, 1); pub const GL_ARB_vertex_type_2_10_10_10_rev = @as(c_int, 1); pub const GL_ARB_viewport_array = @as(c_int, 1); pub const GL_ARB_window_pos = @as(c_int, 1); pub const GL_KHR_blend_equation_advanced = @as(c_int, 1); pub const GL_MULTIPLY_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9294, .hexadecimal); pub const GL_SCREEN_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9295, .hexadecimal); pub const GL_OVERLAY_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9296, .hexadecimal); pub const GL_DARKEN_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9297, .hexadecimal); pub const GL_LIGHTEN_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9298, .hexadecimal); pub const GL_COLORDODGE_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9299, .hexadecimal); pub const GL_COLORBURN_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x929A, .hexadecimal); pub const GL_HARDLIGHT_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x929B, .hexadecimal); pub const GL_SOFTLIGHT_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x929C, .hexadecimal); pub const GL_DIFFERENCE_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x929E, .hexadecimal); pub const GL_EXCLUSION_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92A0, .hexadecimal); pub const GL_HSL_HUE_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92AD, .hexadecimal); pub const GL_HSL_SATURATION_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92AE, .hexadecimal); pub const GL_HSL_COLOR_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92AF, .hexadecimal); pub const GL_HSL_LUMINOSITY_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92B0, .hexadecimal); pub const GL_KHR_blend_equation_advanced_coherent = @as(c_int, 1); pub const GL_BLEND_ADVANCED_COHERENT_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9285, .hexadecimal); pub const GL_KHR_context_flush_control = @as(c_int, 1); pub const GL_KHR_debug = @as(c_int, 1); pub const GL_KHR_no_error = @as(c_int, 1); pub const GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR = @as(c_int, 0x00000008); pub const GL_KHR_parallel_shader_compile = @as(c_int, 1); pub const GL_MAX_SHADER_COMPILER_THREADS_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91B0, .hexadecimal); pub const GL_COMPLETION_STATUS_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91B1, .hexadecimal); pub const GL_KHR_robust_buffer_access_behavior = @as(c_int, 1); pub const GL_KHR_robustness = @as(c_int, 1); pub const GL_CONTEXT_ROBUST_ACCESS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90F3, .hexadecimal); pub const GL_KHR_shader_subgroup = @as(c_int, 1); pub const GL_SUBGROUP_SIZE_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9532, .hexadecimal); pub const GL_SUBGROUP_SUPPORTED_STAGES_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9533, .hexadecimal); pub const GL_SUBGROUP_SUPPORTED_FEATURES_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9534, .hexadecimal); pub const GL_SUBGROUP_QUAD_ALL_STAGES_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9535, .hexadecimal); pub const GL_SUBGROUP_FEATURE_BASIC_BIT_KHR = @as(c_int, 0x00000001); pub const GL_SUBGROUP_FEATURE_VOTE_BIT_KHR = @as(c_int, 0x00000002); pub const GL_SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR = @as(c_int, 0x00000004); pub const GL_SUBGROUP_FEATURE_BALLOT_BIT_KHR = @as(c_int, 0x00000008); pub const GL_SUBGROUP_FEATURE_SHUFFLE_BIT_KHR = @as(c_int, 0x00000010); pub const GL_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR = @as(c_int, 0x00000020); pub const GL_SUBGROUP_FEATURE_CLUSTERED_BIT_KHR = @as(c_int, 0x00000040); pub const GL_SUBGROUP_FEATURE_QUAD_BIT_KHR = @as(c_int, 0x00000080); pub const GL_KHR_texture_compression_astc_hdr = @as(c_int, 1); pub const GL_COMPRESSED_RGBA_ASTC_4x4_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93B0, .hexadecimal); pub const GL_COMPRESSED_RGBA_ASTC_5x4_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93B1, .hexadecimal); pub const GL_COMPRESSED_RGBA_ASTC_5x5_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93B2, .hexadecimal); pub const GL_COMPRESSED_RGBA_ASTC_6x5_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93B3, .hexadecimal); pub const GL_COMPRESSED_RGBA_ASTC_6x6_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93B4, .hexadecimal); pub const GL_COMPRESSED_RGBA_ASTC_8x5_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93B5, .hexadecimal); pub const GL_COMPRESSED_RGBA_ASTC_8x6_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93B6, .hexadecimal); pub const GL_COMPRESSED_RGBA_ASTC_8x8_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93B7, .hexadecimal); pub const GL_COMPRESSED_RGBA_ASTC_10x5_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93B8, .hexadecimal); pub const GL_COMPRESSED_RGBA_ASTC_10x6_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93B9, .hexadecimal); pub const GL_COMPRESSED_RGBA_ASTC_10x8_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93BA, .hexadecimal); pub const GL_COMPRESSED_RGBA_ASTC_10x10_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93BB, .hexadecimal); pub const GL_COMPRESSED_RGBA_ASTC_12x10_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93BC, .hexadecimal); pub const GL_COMPRESSED_RGBA_ASTC_12x12_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93BD, .hexadecimal); pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93D0, .hexadecimal); pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93D1, .hexadecimal); pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93D2, .hexadecimal); pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93D3, .hexadecimal); pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93D4, .hexadecimal); pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93D5, .hexadecimal); pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93D6, .hexadecimal); pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93D7, .hexadecimal); pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93D8, .hexadecimal); pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93D9, .hexadecimal); pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93DA, .hexadecimal); pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93DB, .hexadecimal); pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93DC, .hexadecimal); pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x93DD, .hexadecimal); pub const GL_KHR_texture_compression_astc_ldr = @as(c_int, 1); pub const GL_KHR_texture_compression_astc_sliced_3d = @as(c_int, 1); pub const GL_OES_byte_coordinates = @as(c_int, 1); pub const GL_OES_compressed_paletted_texture = @as(c_int, 1); pub const GL_PALETTE4_RGB8_OES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B90, .hexadecimal); pub const GL_PALETTE4_RGBA8_OES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B91, .hexadecimal); pub const GL_PALETTE4_R5_G6_B5_OES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B92, .hexadecimal); pub const GL_PALETTE4_RGBA4_OES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B93, .hexadecimal); pub const GL_PALETTE4_RGB5_A1_OES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B94, .hexadecimal); pub const GL_PALETTE8_RGB8_OES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B95, .hexadecimal); pub const GL_PALETTE8_RGBA8_OES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B96, .hexadecimal); pub const GL_PALETTE8_R5_G6_B5_OES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B97, .hexadecimal); pub const GL_PALETTE8_RGBA4_OES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B98, .hexadecimal); pub const GL_PALETTE8_RGB5_A1_OES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B99, .hexadecimal); pub const GL_OES_fixed_point = @as(c_int, 1); pub const GL_FIXED_OES = @as(c_int, 0x140C); pub const GL_OES_query_matrix = @as(c_int, 1); pub const GL_OES_read_format = @as(c_int, 1); pub const GL_IMPLEMENTATION_COLOR_READ_TYPE_OES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B9A, .hexadecimal); pub const GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B9B, .hexadecimal); pub const GL_OES_single_precision = @as(c_int, 1); pub const GL_3DFX_multisample = @as(c_int, 1); pub const GL_MULTISAMPLE_3DFX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86B2, .hexadecimal); pub const GL_SAMPLE_BUFFERS_3DFX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86B3, .hexadecimal); pub const GL_SAMPLES_3DFX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86B4, .hexadecimal); pub const GL_MULTISAMPLE_BIT_3DFX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x20000000, .hexadecimal); pub const GL_3DFX_tbuffer = @as(c_int, 1); pub const GL_3DFX_texture_compression_FXT1 = @as(c_int, 1); pub const GL_COMPRESSED_RGB_FXT1_3DFX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86B0, .hexadecimal); pub const GL_COMPRESSED_RGBA_FXT1_3DFX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86B1, .hexadecimal); pub const GL_AMD_blend_minmax_factor = @as(c_int, 1); pub const GL_FACTOR_MIN_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x901C, .hexadecimal); pub const GL_FACTOR_MAX_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x901D, .hexadecimal); pub const GL_AMD_conservative_depth = @as(c_int, 1); pub const GL_AMD_debug_output = @as(c_int, 1); pub const GL_MAX_DEBUG_MESSAGE_LENGTH_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9143, .hexadecimal); pub const GL_MAX_DEBUG_LOGGED_MESSAGES_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9144, .hexadecimal); pub const GL_DEBUG_LOGGED_MESSAGES_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9145, .hexadecimal); pub const GL_DEBUG_SEVERITY_HIGH_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9146, .hexadecimal); pub const GL_DEBUG_SEVERITY_MEDIUM_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9147, .hexadecimal); pub const GL_DEBUG_SEVERITY_LOW_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9148, .hexadecimal); pub const GL_DEBUG_CATEGORY_API_ERROR_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9149, .hexadecimal); pub const GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x914A, .hexadecimal); pub const GL_DEBUG_CATEGORY_DEPRECATION_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x914B, .hexadecimal); pub const GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x914C, .hexadecimal); pub const GL_DEBUG_CATEGORY_PERFORMANCE_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x914D, .hexadecimal); pub const GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x914E, .hexadecimal); pub const GL_DEBUG_CATEGORY_APPLICATION_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x914F, .hexadecimal); pub const GL_DEBUG_CATEGORY_OTHER_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9150, .hexadecimal); pub const GL_AMD_depth_clamp_separate = @as(c_int, 1); pub const GL_DEPTH_CLAMP_NEAR_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x901E, .hexadecimal); pub const GL_DEPTH_CLAMP_FAR_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x901F, .hexadecimal); pub const GL_AMD_draw_buffers_blend = @as(c_int, 1); pub const GL_AMD_framebuffer_multisample_advanced = @as(c_int, 1); pub const GL_RENDERBUFFER_STORAGE_SAMPLES_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91B2, .hexadecimal); pub const GL_MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91B3, .hexadecimal); pub const GL_MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91B4, .hexadecimal); pub const GL_MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91B5, .hexadecimal); pub const GL_NUM_SUPPORTED_MULTISAMPLE_MODES_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91B6, .hexadecimal); pub const GL_SUPPORTED_MULTISAMPLE_MODES_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91B7, .hexadecimal); pub const GL_AMD_framebuffer_sample_positions = @as(c_int, 1); pub const GL_SUBSAMPLE_DISTANCE_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x883F, .hexadecimal); pub const GL_PIXELS_PER_SAMPLE_PATTERN_X_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91AE, .hexadecimal); pub const GL_PIXELS_PER_SAMPLE_PATTERN_Y_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91AF, .hexadecimal); pub const GL_ALL_PIXELS_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0xFFFFFFFF, .hexadecimal); pub const GL_AMD_gcn_shader = @as(c_int, 1); pub const GL_AMD_gpu_shader_half_float = @as(c_int, 1); pub const GL_FLOAT16_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FF8, .hexadecimal); pub const GL_FLOAT16_VEC2_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FF9, .hexadecimal); pub const GL_FLOAT16_VEC3_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FFA, .hexadecimal); pub const GL_FLOAT16_VEC4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FFB, .hexadecimal); pub const GL_FLOAT16_MAT2_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91C5, .hexadecimal); pub const GL_FLOAT16_MAT3_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91C6, .hexadecimal); pub const GL_FLOAT16_MAT4_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91C7, .hexadecimal); pub const GL_FLOAT16_MAT2x3_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91C8, .hexadecimal); pub const GL_FLOAT16_MAT2x4_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91C9, .hexadecimal); pub const GL_FLOAT16_MAT3x2_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91CA, .hexadecimal); pub const GL_FLOAT16_MAT3x4_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91CB, .hexadecimal); pub const GL_FLOAT16_MAT4x2_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91CC, .hexadecimal); pub const GL_FLOAT16_MAT4x3_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91CD, .hexadecimal); pub const GL_AMD_gpu_shader_int16 = @as(c_int, 1); pub const GL_AMD_gpu_shader_int64 = @as(c_int, 1); pub const GL_INT64_NV = @as(c_int, 0x140E); pub const GL_UNSIGNED_INT64_NV = @as(c_int, 0x140F); pub const GL_INT8_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FE0, .hexadecimal); pub const GL_INT8_VEC2_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FE1, .hexadecimal); pub const GL_INT8_VEC3_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FE2, .hexadecimal); pub const GL_INT8_VEC4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FE3, .hexadecimal); pub const GL_INT16_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FE4, .hexadecimal); pub const GL_INT16_VEC2_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FE5, .hexadecimal); pub const GL_INT16_VEC3_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FE6, .hexadecimal); pub const GL_INT16_VEC4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FE7, .hexadecimal); pub const GL_INT64_VEC2_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FE9, .hexadecimal); pub const GL_INT64_VEC3_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FEA, .hexadecimal); pub const GL_INT64_VEC4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FEB, .hexadecimal); pub const GL_UNSIGNED_INT8_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FEC, .hexadecimal); pub const GL_UNSIGNED_INT8_VEC2_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FED, .hexadecimal); pub const GL_UNSIGNED_INT8_VEC3_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FEE, .hexadecimal); pub const GL_UNSIGNED_INT8_VEC4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FEF, .hexadecimal); pub const GL_UNSIGNED_INT16_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FF0, .hexadecimal); pub const GL_UNSIGNED_INT16_VEC2_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FF1, .hexadecimal); pub const GL_UNSIGNED_INT16_VEC3_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FF2, .hexadecimal); pub const GL_UNSIGNED_INT16_VEC4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FF3, .hexadecimal); pub const GL_UNSIGNED_INT64_VEC2_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FF5, .hexadecimal); pub const GL_UNSIGNED_INT64_VEC3_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FF6, .hexadecimal); pub const GL_UNSIGNED_INT64_VEC4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FF7, .hexadecimal); pub const GL_AMD_interleaved_elements = @as(c_int, 1); pub const GL_VERTEX_ELEMENT_SWIZZLE_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91A4, .hexadecimal); pub const GL_VERTEX_ID_SWIZZLE_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91A5, .hexadecimal); pub const GL_AMD_multi_draw_indirect = @as(c_int, 1); pub const GL_AMD_name_gen_delete = @as(c_int, 1); pub const GL_DATA_BUFFER_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9151, .hexadecimal); pub const GL_PERFORMANCE_MONITOR_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9152, .hexadecimal); pub const GL_QUERY_OBJECT_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9153, .hexadecimal); pub const GL_VERTEX_ARRAY_OBJECT_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9154, .hexadecimal); pub const GL_SAMPLER_OBJECT_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9155, .hexadecimal); pub const GL_AMD_occlusion_query_event = @as(c_int, 1); pub const GL_OCCLUSION_QUERY_EVENT_MASK_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x874F, .hexadecimal); pub const GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD = @as(c_int, 0x00000001); pub const GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD = @as(c_int, 0x00000002); pub const GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD = @as(c_int, 0x00000004); pub const GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD = @as(c_int, 0x00000008); pub const GL_QUERY_ALL_EVENT_BITS_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0xFFFFFFFF, .hexadecimal); pub const GL_AMD_performance_monitor = @as(c_int, 1); pub const GL_COUNTER_TYPE_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8BC0, .hexadecimal); pub const GL_COUNTER_RANGE_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8BC1, .hexadecimal); pub const GL_UNSIGNED_INT64_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8BC2, .hexadecimal); pub const GL_PERCENTAGE_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8BC3, .hexadecimal); pub const GL_PERFMON_RESULT_AVAILABLE_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8BC4, .hexadecimal); pub const GL_PERFMON_RESULT_SIZE_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8BC5, .hexadecimal); pub const GL_PERFMON_RESULT_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8BC6, .hexadecimal); pub const GL_AMD_pinned_memory = @as(c_int, 1); pub const GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9160, .hexadecimal); pub const GL_AMD_query_buffer_object = @as(c_int, 1); pub const GL_QUERY_BUFFER_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9192, .hexadecimal); pub const GL_QUERY_BUFFER_BINDING_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9193, .hexadecimal); pub const GL_QUERY_RESULT_NO_WAIT_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9194, .hexadecimal); pub const GL_AMD_sample_positions = @as(c_int, 1); pub const GL_AMD_seamless_cubemap_per_texture = @as(c_int, 1); pub const GL_AMD_shader_atomic_counter_ops = @as(c_int, 1); pub const GL_AMD_shader_ballot = @as(c_int, 1); pub const GL_AMD_shader_explicit_vertex_parameter = @as(c_int, 1); pub const GL_AMD_shader_gpu_shader_half_float_fetch = @as(c_int, 1); pub const GL_AMD_shader_image_load_store_lod = @as(c_int, 1); pub const GL_AMD_shader_stencil_export = @as(c_int, 1); pub const GL_AMD_shader_trinary_minmax = @as(c_int, 1); pub const GL_AMD_sparse_texture = @as(c_int, 1); pub const GL_VIRTUAL_PAGE_SIZE_X_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9195, .hexadecimal); pub const GL_VIRTUAL_PAGE_SIZE_Y_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9196, .hexadecimal); pub const GL_VIRTUAL_PAGE_SIZE_Z_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9197, .hexadecimal); pub const GL_MAX_SPARSE_TEXTURE_SIZE_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9198, .hexadecimal); pub const GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9199, .hexadecimal); pub const GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x919A, .hexadecimal); pub const GL_MIN_SPARSE_LEVEL_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x919B, .hexadecimal); pub const GL_MIN_LOD_WARNING_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x919C, .hexadecimal); pub const GL_TEXTURE_STORAGE_SPARSE_BIT_AMD = @as(c_int, 0x00000001); pub const GL_AMD_stencil_operation_extended = @as(c_int, 1); pub const GL_SET_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x874A, .hexadecimal); pub const GL_REPLACE_VALUE_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x874B, .hexadecimal); pub const GL_STENCIL_OP_VALUE_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x874C, .hexadecimal); pub const GL_STENCIL_BACK_OP_VALUE_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x874D, .hexadecimal); pub const GL_AMD_texture_gather_bias_lod = @as(c_int, 1); pub const GL_AMD_texture_texture4 = @as(c_int, 1); pub const GL_AMD_transform_feedback3_lines_triangles = @as(c_int, 1); pub const GL_AMD_transform_feedback4 = @as(c_int, 1); pub const GL_STREAM_RASTERIZATION_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x91A0, .hexadecimal); pub const GL_AMD_vertex_shader_layer = @as(c_int, 1); pub const GL_AMD_vertex_shader_tessellator = @as(c_int, 1); pub const GL_SAMPLER_BUFFER_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9001, .hexadecimal); pub const GL_INT_SAMPLER_BUFFER_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9002, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9003, .hexadecimal); pub const GL_TESSELLATION_MODE_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9004, .hexadecimal); pub const GL_TESSELLATION_FACTOR_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9005, .hexadecimal); pub const GL_DISCRETE_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9006, .hexadecimal); pub const GL_CONTINUOUS_AMD = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9007, .hexadecimal); pub const GL_AMD_vertex_shader_viewport_index = @as(c_int, 1); pub const GL_APPLE_aux_depth_stencil = @as(c_int, 1); pub const GL_AUX_DEPTH_STENCIL_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A14, .hexadecimal); pub const GL_APPLE_client_storage = @as(c_int, 1); pub const GL_UNPACK_CLIENT_STORAGE_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85B2, .hexadecimal); pub const GL_APPLE_element_array = @as(c_int, 1); pub const GL_ELEMENT_ARRAY_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A0C, .hexadecimal); pub const GL_ELEMENT_ARRAY_TYPE_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A0D, .hexadecimal); pub const GL_ELEMENT_ARRAY_POINTER_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A0E, .hexadecimal); pub const GL_APPLE_fence = @as(c_int, 1); pub const GL_DRAW_PIXELS_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A0A, .hexadecimal); pub const GL_FENCE_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A0B, .hexadecimal); pub const GL_APPLE_float_pixels = @as(c_int, 1); pub const GL_HALF_APPLE = @as(c_int, 0x140B); pub const GL_RGBA_FLOAT32_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8814, .hexadecimal); pub const GL_RGB_FLOAT32_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8815, .hexadecimal); pub const GL_ALPHA_FLOAT32_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8816, .hexadecimal); pub const GL_INTENSITY_FLOAT32_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8817, .hexadecimal); pub const GL_LUMINANCE_FLOAT32_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8818, .hexadecimal); pub const GL_LUMINANCE_ALPHA_FLOAT32_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8819, .hexadecimal); pub const GL_RGBA_FLOAT16_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x881A, .hexadecimal); pub const GL_RGB_FLOAT16_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x881B, .hexadecimal); pub const GL_ALPHA_FLOAT16_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x881C, .hexadecimal); pub const GL_INTENSITY_FLOAT16_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x881D, .hexadecimal); pub const GL_LUMINANCE_FLOAT16_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x881E, .hexadecimal); pub const GL_LUMINANCE_ALPHA_FLOAT16_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x881F, .hexadecimal); pub const GL_COLOR_FLOAT_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A0F, .hexadecimal); pub const GL_APPLE_flush_buffer_range = @as(c_int, 1); pub const GL_BUFFER_SERIALIZED_MODIFY_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A12, .hexadecimal); pub const GL_BUFFER_FLUSHING_UNMAP_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A13, .hexadecimal); pub const GL_APPLE_object_purgeable = @as(c_int, 1); pub const GL_BUFFER_OBJECT_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85B3, .hexadecimal); pub const GL_RELEASED_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A19, .hexadecimal); pub const GL_VOLATILE_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A1A, .hexadecimal); pub const GL_RETAINED_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A1B, .hexadecimal); pub const GL_UNDEFINED_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A1C, .hexadecimal); pub const GL_PURGEABLE_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A1D, .hexadecimal); pub const GL_APPLE_rgb_422 = @as(c_int, 1); pub const GL_RGB_422_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A1F, .hexadecimal); pub const GL_UNSIGNED_SHORT_8_8_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85BA, .hexadecimal); pub const GL_UNSIGNED_SHORT_8_8_REV_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85BB, .hexadecimal); pub const GL_RGB_RAW_422_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A51, .hexadecimal); pub const GL_APPLE_row_bytes = @as(c_int, 1); pub const GL_PACK_ROW_BYTES_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A15, .hexadecimal); pub const GL_UNPACK_ROW_BYTES_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A16, .hexadecimal); pub const GL_APPLE_specular_vector = @as(c_int, 1); pub const GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85B0, .hexadecimal); pub const GL_APPLE_texture_range = @as(c_int, 1); pub const GL_TEXTURE_RANGE_LENGTH_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85B7, .hexadecimal); pub const GL_TEXTURE_RANGE_POINTER_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85B8, .hexadecimal); pub const GL_TEXTURE_STORAGE_HINT_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85BC, .hexadecimal); pub const GL_STORAGE_PRIVATE_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85BD, .hexadecimal); pub const GL_STORAGE_CACHED_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85BE, .hexadecimal); pub const GL_STORAGE_SHARED_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85BF, .hexadecimal); pub const GL_APPLE_transform_hint = @as(c_int, 1); pub const GL_TRANSFORM_HINT_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85B1, .hexadecimal); pub const GL_APPLE_vertex_array_object = @as(c_int, 1); pub const GL_VERTEX_ARRAY_BINDING_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85B5, .hexadecimal); pub const GL_APPLE_vertex_array_range = @as(c_int, 1); pub const GL_VERTEX_ARRAY_RANGE_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x851D, .hexadecimal); pub const GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x851E, .hexadecimal); pub const GL_VERTEX_ARRAY_STORAGE_HINT_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x851F, .hexadecimal); pub const GL_VERTEX_ARRAY_RANGE_POINTER_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8521, .hexadecimal); pub const GL_STORAGE_CLIENT_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85B4, .hexadecimal); pub const GL_APPLE_vertex_program_evaluators = @as(c_int, 1); pub const GL_VERTEX_ATTRIB_MAP1_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A00, .hexadecimal); pub const GL_VERTEX_ATTRIB_MAP2_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A01, .hexadecimal); pub const GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A02, .hexadecimal); pub const GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A03, .hexadecimal); pub const GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A04, .hexadecimal); pub const GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A05, .hexadecimal); pub const GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A06, .hexadecimal); pub const GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A07, .hexadecimal); pub const GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A08, .hexadecimal); pub const GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A09, .hexadecimal); pub const GL_APPLE_ycbcr_422 = @as(c_int, 1); pub const GL_YCBCR_422_APPLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85B9, .hexadecimal); pub const GL_ATI_draw_buffers = @as(c_int, 1); pub const GL_MAX_DRAW_BUFFERS_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8824, .hexadecimal); pub const GL_DRAW_BUFFER0_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8825, .hexadecimal); pub const GL_DRAW_BUFFER1_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8826, .hexadecimal); pub const GL_DRAW_BUFFER2_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8827, .hexadecimal); pub const GL_DRAW_BUFFER3_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8828, .hexadecimal); pub const GL_DRAW_BUFFER4_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8829, .hexadecimal); pub const GL_DRAW_BUFFER5_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x882A, .hexadecimal); pub const GL_DRAW_BUFFER6_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x882B, .hexadecimal); pub const GL_DRAW_BUFFER7_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x882C, .hexadecimal); pub const GL_DRAW_BUFFER8_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x882D, .hexadecimal); pub const GL_DRAW_BUFFER9_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x882E, .hexadecimal); pub const GL_DRAW_BUFFER10_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x882F, .hexadecimal); pub const GL_DRAW_BUFFER11_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8830, .hexadecimal); pub const GL_DRAW_BUFFER12_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8831, .hexadecimal); pub const GL_DRAW_BUFFER13_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8832, .hexadecimal); pub const GL_DRAW_BUFFER14_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8833, .hexadecimal); pub const GL_DRAW_BUFFER15_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8834, .hexadecimal); pub const GL_ATI_element_array = @as(c_int, 1); pub const GL_ELEMENT_ARRAY_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8768, .hexadecimal); pub const GL_ELEMENT_ARRAY_TYPE_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8769, .hexadecimal); pub const GL_ELEMENT_ARRAY_POINTER_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x876A, .hexadecimal); pub const GL_ATI_envmap_bumpmap = @as(c_int, 1); pub const GL_BUMP_ROT_MATRIX_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8775, .hexadecimal); pub const GL_BUMP_ROT_MATRIX_SIZE_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8776, .hexadecimal); pub const GL_BUMP_NUM_TEX_UNITS_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8777, .hexadecimal); pub const GL_BUMP_TEX_UNITS_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8778, .hexadecimal); pub const GL_DUDV_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8779, .hexadecimal); pub const GL_DU8DV8_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x877A, .hexadecimal); pub const GL_BUMP_ENVMAP_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x877B, .hexadecimal); pub const GL_BUMP_TARGET_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x877C, .hexadecimal); pub const GL_ATI_fragment_shader = @as(c_int, 1); pub const GL_FRAGMENT_SHADER_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8920, .hexadecimal); pub const GL_REG_0_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8921, .hexadecimal); pub const GL_REG_1_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8922, .hexadecimal); pub const GL_REG_2_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8923, .hexadecimal); pub const GL_REG_3_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8924, .hexadecimal); pub const GL_REG_4_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8925, .hexadecimal); pub const GL_REG_5_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8926, .hexadecimal); pub const GL_REG_6_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8927, .hexadecimal); pub const GL_REG_7_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8928, .hexadecimal); pub const GL_REG_8_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8929, .hexadecimal); pub const GL_REG_9_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x892A, .hexadecimal); pub const GL_REG_10_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x892B, .hexadecimal); pub const GL_REG_11_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x892C, .hexadecimal); pub const GL_REG_12_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x892D, .hexadecimal); pub const GL_REG_13_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x892E, .hexadecimal); pub const GL_REG_14_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x892F, .hexadecimal); pub const GL_REG_15_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8930, .hexadecimal); pub const GL_REG_16_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8931, .hexadecimal); pub const GL_REG_17_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8932, .hexadecimal); pub const GL_REG_18_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8933, .hexadecimal); pub const GL_REG_19_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8934, .hexadecimal); pub const GL_REG_20_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8935, .hexadecimal); pub const GL_REG_21_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8936, .hexadecimal); pub const GL_REG_22_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8937, .hexadecimal); pub const GL_REG_23_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8938, .hexadecimal); pub const GL_REG_24_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8939, .hexadecimal); pub const GL_REG_25_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x893A, .hexadecimal); pub const GL_REG_26_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x893B, .hexadecimal); pub const GL_REG_27_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x893C, .hexadecimal); pub const GL_REG_28_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x893D, .hexadecimal); pub const GL_REG_29_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x893E, .hexadecimal); pub const GL_REG_30_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x893F, .hexadecimal); pub const GL_REG_31_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8940, .hexadecimal); pub const GL_CON_0_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8941, .hexadecimal); pub const GL_CON_1_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8942, .hexadecimal); pub const GL_CON_2_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8943, .hexadecimal); pub const GL_CON_3_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8944, .hexadecimal); pub const GL_CON_4_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8945, .hexadecimal); pub const GL_CON_5_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8946, .hexadecimal); pub const GL_CON_6_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8947, .hexadecimal); pub const GL_CON_7_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8948, .hexadecimal); pub const GL_CON_8_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8949, .hexadecimal); pub const GL_CON_9_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x894A, .hexadecimal); pub const GL_CON_10_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x894B, .hexadecimal); pub const GL_CON_11_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x894C, .hexadecimal); pub const GL_CON_12_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x894D, .hexadecimal); pub const GL_CON_13_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x894E, .hexadecimal); pub const GL_CON_14_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x894F, .hexadecimal); pub const GL_CON_15_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8950, .hexadecimal); pub const GL_CON_16_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8951, .hexadecimal); pub const GL_CON_17_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8952, .hexadecimal); pub const GL_CON_18_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8953, .hexadecimal); pub const GL_CON_19_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8954, .hexadecimal); pub const GL_CON_20_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8955, .hexadecimal); pub const GL_CON_21_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8956, .hexadecimal); pub const GL_CON_22_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8957, .hexadecimal); pub const GL_CON_23_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8958, .hexadecimal); pub const GL_CON_24_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8959, .hexadecimal); pub const GL_CON_25_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x895A, .hexadecimal); pub const GL_CON_26_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x895B, .hexadecimal); pub const GL_CON_27_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x895C, .hexadecimal); pub const GL_CON_28_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x895D, .hexadecimal); pub const GL_CON_29_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x895E, .hexadecimal); pub const GL_CON_30_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x895F, .hexadecimal); pub const GL_CON_31_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8960, .hexadecimal); pub const GL_MOV_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8961, .hexadecimal); pub const GL_ADD_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8963, .hexadecimal); pub const GL_MUL_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8964, .hexadecimal); pub const GL_SUB_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8965, .hexadecimal); pub const GL_DOT3_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8966, .hexadecimal); pub const GL_DOT4_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8967, .hexadecimal); pub const GL_MAD_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8968, .hexadecimal); pub const GL_LERP_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8969, .hexadecimal); pub const GL_CND_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x896A, .hexadecimal); pub const GL_CND0_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x896B, .hexadecimal); pub const GL_DOT2_ADD_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x896C, .hexadecimal); pub const GL_SECONDARY_INTERPOLATOR_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x896D, .hexadecimal); pub const GL_NUM_FRAGMENT_REGISTERS_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x896E, .hexadecimal); pub const GL_NUM_FRAGMENT_CONSTANTS_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x896F, .hexadecimal); pub const GL_NUM_PASSES_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8970, .hexadecimal); pub const GL_NUM_INSTRUCTIONS_PER_PASS_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8971, .hexadecimal); pub const GL_NUM_INSTRUCTIONS_TOTAL_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8972, .hexadecimal); pub const GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8973, .hexadecimal); pub const GL_NUM_LOOPBACK_COMPONENTS_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8974, .hexadecimal); pub const GL_COLOR_ALPHA_PAIRING_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8975, .hexadecimal); pub const GL_SWIZZLE_STR_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8976, .hexadecimal); pub const GL_SWIZZLE_STQ_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8977, .hexadecimal); pub const GL_SWIZZLE_STR_DR_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8978, .hexadecimal); pub const GL_SWIZZLE_STQ_DQ_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8979, .hexadecimal); pub const GL_SWIZZLE_STRQ_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x897A, .hexadecimal); pub const GL_SWIZZLE_STRQ_DQ_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x897B, .hexadecimal); pub const GL_RED_BIT_ATI = @as(c_int, 0x00000001); pub const GL_GREEN_BIT_ATI = @as(c_int, 0x00000002); pub const GL_BLUE_BIT_ATI = @as(c_int, 0x00000004); pub const GL_2X_BIT_ATI = @as(c_int, 0x00000001); pub const GL_4X_BIT_ATI = @as(c_int, 0x00000002); pub const GL_8X_BIT_ATI = @as(c_int, 0x00000004); pub const GL_HALF_BIT_ATI = @as(c_int, 0x00000008); pub const GL_QUARTER_BIT_ATI = @as(c_int, 0x00000010); pub const GL_EIGHTH_BIT_ATI = @as(c_int, 0x00000020); pub const GL_SATURATE_BIT_ATI = @as(c_int, 0x00000040); pub const GL_COMP_BIT_ATI = @as(c_int, 0x00000002); pub const GL_NEGATE_BIT_ATI = @as(c_int, 0x00000004); pub const GL_BIAS_BIT_ATI = @as(c_int, 0x00000008); pub const GL_ATI_map_object_buffer = @as(c_int, 1); pub const GL_ATI_meminfo = @as(c_int, 1); pub const GL_VBO_FREE_MEMORY_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87FB, .hexadecimal); pub const GL_TEXTURE_FREE_MEMORY_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87FC, .hexadecimal); pub const GL_RENDERBUFFER_FREE_MEMORY_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87FD, .hexadecimal); pub const GL_ATI_pixel_format_float = @as(c_int, 1); pub const GL_RGBA_FLOAT_MODE_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8820, .hexadecimal); pub const GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8835, .hexadecimal); pub const GL_ATI_pn_triangles = @as(c_int, 1); pub const GL_PN_TRIANGLES_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87F0, .hexadecimal); pub const GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87F1, .hexadecimal); pub const GL_PN_TRIANGLES_POINT_MODE_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87F2, .hexadecimal); pub const GL_PN_TRIANGLES_NORMAL_MODE_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87F3, .hexadecimal); pub const GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87F4, .hexadecimal); pub const GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87F5, .hexadecimal); pub const GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87F6, .hexadecimal); pub const GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87F7, .hexadecimal); pub const GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87F8, .hexadecimal); pub const GL_ATI_separate_stencil = @as(c_int, 1); pub const GL_STENCIL_BACK_FUNC_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8800, .hexadecimal); pub const GL_STENCIL_BACK_FAIL_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8801, .hexadecimal); pub const GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8802, .hexadecimal); pub const GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8803, .hexadecimal); pub const GL_ATI_text_fragment_shader = @as(c_int, 1); pub const GL_TEXT_FRAGMENT_SHADER_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8200, .hexadecimal); pub const GL_ATI_texture_env_combine3 = @as(c_int, 1); pub const GL_MODULATE_ADD_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8744, .hexadecimal); pub const GL_MODULATE_SIGNED_ADD_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8745, .hexadecimal); pub const GL_MODULATE_SUBTRACT_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8746, .hexadecimal); pub const GL_ATI_texture_float = @as(c_int, 1); pub const GL_RGBA_FLOAT32_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8814, .hexadecimal); pub const GL_RGB_FLOAT32_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8815, .hexadecimal); pub const GL_ALPHA_FLOAT32_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8816, .hexadecimal); pub const GL_INTENSITY_FLOAT32_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8817, .hexadecimal); pub const GL_LUMINANCE_FLOAT32_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8818, .hexadecimal); pub const GL_LUMINANCE_ALPHA_FLOAT32_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8819, .hexadecimal); pub const GL_RGBA_FLOAT16_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x881A, .hexadecimal); pub const GL_RGB_FLOAT16_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x881B, .hexadecimal); pub const GL_ALPHA_FLOAT16_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x881C, .hexadecimal); pub const GL_INTENSITY_FLOAT16_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x881D, .hexadecimal); pub const GL_LUMINANCE_FLOAT16_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x881E, .hexadecimal); pub const GL_LUMINANCE_ALPHA_FLOAT16_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x881F, .hexadecimal); pub const GL_ATI_texture_mirror_once = @as(c_int, 1); pub const GL_MIRROR_CLAMP_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8742, .hexadecimal); pub const GL_MIRROR_CLAMP_TO_EDGE_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8743, .hexadecimal); pub const GL_ATI_vertex_array_object = @as(c_int, 1); pub const GL_STATIC_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8760, .hexadecimal); pub const GL_DYNAMIC_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8761, .hexadecimal); pub const GL_PRESERVE_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8762, .hexadecimal); pub const GL_DISCARD_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8763, .hexadecimal); pub const GL_OBJECT_BUFFER_SIZE_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8764, .hexadecimal); pub const GL_OBJECT_BUFFER_USAGE_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8765, .hexadecimal); pub const GL_ARRAY_OBJECT_BUFFER_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8766, .hexadecimal); pub const GL_ARRAY_OBJECT_OFFSET_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8767, .hexadecimal); pub const GL_ATI_vertex_attrib_array_object = @as(c_int, 1); pub const GL_ATI_vertex_streams = @as(c_int, 1); pub const GL_MAX_VERTEX_STREAMS_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x876B, .hexadecimal); pub const GL_VERTEX_STREAM0_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x876C, .hexadecimal); pub const GL_VERTEX_STREAM1_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x876D, .hexadecimal); pub const GL_VERTEX_STREAM2_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x876E, .hexadecimal); pub const GL_VERTEX_STREAM3_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x876F, .hexadecimal); pub const GL_VERTEX_STREAM4_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8770, .hexadecimal); pub const GL_VERTEX_STREAM5_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8771, .hexadecimal); pub const GL_VERTEX_STREAM6_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8772, .hexadecimal); pub const GL_VERTEX_STREAM7_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8773, .hexadecimal); pub const GL_VERTEX_SOURCE_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8774, .hexadecimal); pub const GL_EXT_422_pixels = @as(c_int, 1); pub const GL_422_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80CC, .hexadecimal); pub const GL_422_REV_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80CD, .hexadecimal); pub const GL_422_AVERAGE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80CE, .hexadecimal); pub const GL_422_REV_AVERAGE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80CF, .hexadecimal); pub const GL_EXT_EGL_image_storage = @as(c_int, 1); pub const GL_EXT_abgr = @as(c_int, 1); pub const GL_ABGR_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8000, .hexadecimal); pub const GL_EXT_bgra = @as(c_int, 1); pub const GL_BGR_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80E0, .hexadecimal); pub const GL_BGRA_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80E1, .hexadecimal); pub const GL_EXT_bindable_uniform = @as(c_int, 1); pub const GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DE2, .hexadecimal); pub const GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DE3, .hexadecimal); pub const GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DE4, .hexadecimal); pub const GL_MAX_BINDABLE_UNIFORM_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DED, .hexadecimal); pub const GL_UNIFORM_BUFFER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DEE, .hexadecimal); pub const GL_UNIFORM_BUFFER_BINDING_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DEF, .hexadecimal); pub const GL_EXT_blend_color = @as(c_int, 1); pub const GL_CONSTANT_COLOR_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8001, .hexadecimal); pub const GL_ONE_MINUS_CONSTANT_COLOR_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8002, .hexadecimal); pub const GL_CONSTANT_ALPHA_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8003, .hexadecimal); pub const GL_ONE_MINUS_CONSTANT_ALPHA_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8004, .hexadecimal); pub const GL_BLEND_COLOR_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8005, .hexadecimal); pub const GL_EXT_blend_equation_separate = @as(c_int, 1); pub const GL_BLEND_EQUATION_RGB_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8009, .hexadecimal); pub const GL_BLEND_EQUATION_ALPHA_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x883D, .hexadecimal); pub const GL_EXT_blend_func_separate = @as(c_int, 1); pub const GL_BLEND_DST_RGB_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80C8, .hexadecimal); pub const GL_BLEND_SRC_RGB_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80C9, .hexadecimal); pub const GL_BLEND_DST_ALPHA_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80CA, .hexadecimal); pub const GL_BLEND_SRC_ALPHA_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80CB, .hexadecimal); pub const GL_EXT_blend_logic_op = @as(c_int, 1); pub const GL_EXT_blend_minmax = @as(c_int, 1); pub const GL_MIN_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8007, .hexadecimal); pub const GL_MAX_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8008, .hexadecimal); pub const GL_FUNC_ADD_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8006, .hexadecimal); pub const GL_BLEND_EQUATION_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8009, .hexadecimal); pub const GL_EXT_blend_subtract = @as(c_int, 1); pub const GL_FUNC_SUBTRACT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x800A, .hexadecimal); pub const GL_FUNC_REVERSE_SUBTRACT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x800B, .hexadecimal); pub const GL_EXT_clip_volume_hint = @as(c_int, 1); pub const GL_CLIP_VOLUME_CLIPPING_HINT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80F0, .hexadecimal); pub const GL_EXT_cmyka = @as(c_int, 1); pub const GL_CMYK_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x800C, .hexadecimal); pub const GL_CMYKA_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x800D, .hexadecimal); pub const GL_PACK_CMYK_HINT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x800E, .hexadecimal); pub const GL_UNPACK_CMYK_HINT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x800F, .hexadecimal); pub const GL_EXT_color_subtable = @as(c_int, 1); pub const GL_EXT_compiled_vertex_array = @as(c_int, 1); pub const GL_ARRAY_ELEMENT_LOCK_FIRST_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81A8, .hexadecimal); pub const GL_ARRAY_ELEMENT_LOCK_COUNT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81A9, .hexadecimal); pub const GL_EXT_convolution = @as(c_int, 1); pub const GL_CONVOLUTION_1D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8010, .hexadecimal); pub const GL_CONVOLUTION_2D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8011, .hexadecimal); pub const GL_SEPARABLE_2D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8012, .hexadecimal); pub const GL_CONVOLUTION_BORDER_MODE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8013, .hexadecimal); pub const GL_CONVOLUTION_FILTER_SCALE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8014, .hexadecimal); pub const GL_CONVOLUTION_FILTER_BIAS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8015, .hexadecimal); pub const GL_REDUCE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8016, .hexadecimal); pub const GL_CONVOLUTION_FORMAT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8017, .hexadecimal); pub const GL_CONVOLUTION_WIDTH_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8018, .hexadecimal); pub const GL_CONVOLUTION_HEIGHT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8019, .hexadecimal); pub const GL_MAX_CONVOLUTION_WIDTH_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x801A, .hexadecimal); pub const GL_MAX_CONVOLUTION_HEIGHT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x801B, .hexadecimal); pub const GL_POST_CONVOLUTION_RED_SCALE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x801C, .hexadecimal); pub const GL_POST_CONVOLUTION_GREEN_SCALE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x801D, .hexadecimal); pub const GL_POST_CONVOLUTION_BLUE_SCALE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x801E, .hexadecimal); pub const GL_POST_CONVOLUTION_ALPHA_SCALE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x801F, .hexadecimal); pub const GL_POST_CONVOLUTION_RED_BIAS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8020, .hexadecimal); pub const GL_POST_CONVOLUTION_GREEN_BIAS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8021, .hexadecimal); pub const GL_POST_CONVOLUTION_BLUE_BIAS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8022, .hexadecimal); pub const GL_POST_CONVOLUTION_ALPHA_BIAS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8023, .hexadecimal); pub const GL_EXT_coordinate_frame = @as(c_int, 1); pub const GL_TANGENT_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8439, .hexadecimal); pub const GL_BINORMAL_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x843A, .hexadecimal); pub const GL_CURRENT_TANGENT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x843B, .hexadecimal); pub const GL_CURRENT_BINORMAL_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x843C, .hexadecimal); pub const GL_TANGENT_ARRAY_TYPE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x843E, .hexadecimal); pub const GL_TANGENT_ARRAY_STRIDE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x843F, .hexadecimal); pub const GL_BINORMAL_ARRAY_TYPE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8440, .hexadecimal); pub const GL_BINORMAL_ARRAY_STRIDE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8441, .hexadecimal); pub const GL_TANGENT_ARRAY_POINTER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8442, .hexadecimal); pub const GL_BINORMAL_ARRAY_POINTER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8443, .hexadecimal); pub const GL_MAP1_TANGENT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8444, .hexadecimal); pub const GL_MAP2_TANGENT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8445, .hexadecimal); pub const GL_MAP1_BINORMAL_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8446, .hexadecimal); pub const GL_MAP2_BINORMAL_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8447, .hexadecimal); pub const GL_EXT_copy_texture = @as(c_int, 1); pub const GL_EXT_cull_vertex = @as(c_int, 1); pub const GL_CULL_VERTEX_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81AA, .hexadecimal); pub const GL_CULL_VERTEX_EYE_POSITION_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81AB, .hexadecimal); pub const GL_CULL_VERTEX_OBJECT_POSITION_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81AC, .hexadecimal); pub const GL_EXT_debug_label = @as(c_int, 1); pub const GL_PROGRAM_PIPELINE_OBJECT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A4F, .hexadecimal); pub const GL_PROGRAM_OBJECT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B40, .hexadecimal); pub const GL_SHADER_OBJECT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B48, .hexadecimal); pub const GL_BUFFER_OBJECT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9151, .hexadecimal); pub const GL_QUERY_OBJECT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9153, .hexadecimal); pub const GL_VERTEX_ARRAY_OBJECT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9154, .hexadecimal); pub const GL_EXT_debug_marker = @as(c_int, 1); pub const GL_EXT_depth_bounds_test = @as(c_int, 1); pub const GL_DEPTH_BOUNDS_TEST_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8890, .hexadecimal); pub const GL_DEPTH_BOUNDS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8891, .hexadecimal); pub const GL_EXT_direct_state_access = @as(c_int, 1); pub const GL_PROGRAM_MATRIX_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E2D, .hexadecimal); pub const GL_TRANSPOSE_PROGRAM_MATRIX_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E2E, .hexadecimal); pub const GL_PROGRAM_MATRIX_STACK_DEPTH_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E2F, .hexadecimal); pub const GL_EXT_draw_buffers2 = @as(c_int, 1); pub const GL_EXT_draw_instanced = @as(c_int, 1); pub const GL_EXT_draw_range_elements = @as(c_int, 1); pub const GL_MAX_ELEMENTS_VERTICES_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80E8, .hexadecimal); pub const GL_MAX_ELEMENTS_INDICES_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80E9, .hexadecimal); pub const GL_EXT_external_buffer = @as(c_int, 1); pub const GL_EXT_fog_coord = @as(c_int, 1); pub const GL_FOG_COORDINATE_SOURCE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8450, .hexadecimal); pub const GL_FOG_COORDINATE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8451, .hexadecimal); pub const GL_FRAGMENT_DEPTH_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8452, .hexadecimal); pub const GL_CURRENT_FOG_COORDINATE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8453, .hexadecimal); pub const GL_FOG_COORDINATE_ARRAY_TYPE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8454, .hexadecimal); pub const GL_FOG_COORDINATE_ARRAY_STRIDE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8455, .hexadecimal); pub const GL_FOG_COORDINATE_ARRAY_POINTER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8456, .hexadecimal); pub const GL_FOG_COORDINATE_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8457, .hexadecimal); pub const GL_EXT_framebuffer_blit = @as(c_int, 1); pub const GL_READ_FRAMEBUFFER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CA8, .hexadecimal); pub const GL_DRAW_FRAMEBUFFER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CA9, .hexadecimal); pub const GL_DRAW_FRAMEBUFFER_BINDING_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CA6, .hexadecimal); pub const GL_READ_FRAMEBUFFER_BINDING_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CAA, .hexadecimal); pub const GL_EXT_framebuffer_multisample = @as(c_int, 1); pub const GL_RENDERBUFFER_SAMPLES_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CAB, .hexadecimal); pub const GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D56, .hexadecimal); pub const GL_MAX_SAMPLES_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D57, .hexadecimal); pub const GL_EXT_framebuffer_multisample_blit_scaled = @as(c_int, 1); pub const GL_SCALED_RESOLVE_FASTEST_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90BA, .hexadecimal); pub const GL_SCALED_RESOLVE_NICEST_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90BB, .hexadecimal); pub const GL_EXT_framebuffer_object = @as(c_int, 1); pub const GL_INVALID_FRAMEBUFFER_OPERATION_EXT = @as(c_int, 0x0506); pub const GL_MAX_RENDERBUFFER_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E8, .hexadecimal); pub const GL_FRAMEBUFFER_BINDING_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CA6, .hexadecimal); pub const GL_RENDERBUFFER_BINDING_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CA7, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CD0, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CD1, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CD2, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CD3, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CD4, .hexadecimal); pub const GL_FRAMEBUFFER_COMPLETE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CD5, .hexadecimal); pub const GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CD6, .hexadecimal); pub const GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CD7, .hexadecimal); pub const GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CD9, .hexadecimal); pub const GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CDA, .hexadecimal); pub const GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CDB, .hexadecimal); pub const GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CDC, .hexadecimal); pub const GL_FRAMEBUFFER_UNSUPPORTED_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CDD, .hexadecimal); pub const GL_MAX_COLOR_ATTACHMENTS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CDF, .hexadecimal); pub const GL_COLOR_ATTACHMENT0_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CE0, .hexadecimal); pub const GL_COLOR_ATTACHMENT1_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CE1, .hexadecimal); pub const GL_COLOR_ATTACHMENT2_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CE2, .hexadecimal); pub const GL_COLOR_ATTACHMENT3_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CE3, .hexadecimal); pub const GL_COLOR_ATTACHMENT4_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CE4, .hexadecimal); pub const GL_COLOR_ATTACHMENT5_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CE5, .hexadecimal); pub const GL_COLOR_ATTACHMENT6_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CE6, .hexadecimal); pub const GL_COLOR_ATTACHMENT7_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CE7, .hexadecimal); pub const GL_COLOR_ATTACHMENT8_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CE8, .hexadecimal); pub const GL_COLOR_ATTACHMENT9_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CE9, .hexadecimal); pub const GL_COLOR_ATTACHMENT10_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CEA, .hexadecimal); pub const GL_COLOR_ATTACHMENT11_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CEB, .hexadecimal); pub const GL_COLOR_ATTACHMENT12_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CEC, .hexadecimal); pub const GL_COLOR_ATTACHMENT13_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CED, .hexadecimal); pub const GL_COLOR_ATTACHMENT14_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CEE, .hexadecimal); pub const GL_COLOR_ATTACHMENT15_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CEF, .hexadecimal); pub const GL_DEPTH_ATTACHMENT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D00, .hexadecimal); pub const GL_STENCIL_ATTACHMENT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D20, .hexadecimal); pub const GL_FRAMEBUFFER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D40, .hexadecimal); pub const GL_RENDERBUFFER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D41, .hexadecimal); pub const GL_RENDERBUFFER_WIDTH_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D42, .hexadecimal); pub const GL_RENDERBUFFER_HEIGHT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D43, .hexadecimal); pub const GL_RENDERBUFFER_INTERNAL_FORMAT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D44, .hexadecimal); pub const GL_STENCIL_INDEX1_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D46, .hexadecimal); pub const GL_STENCIL_INDEX4_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D47, .hexadecimal); pub const GL_STENCIL_INDEX8_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D48, .hexadecimal); pub const GL_STENCIL_INDEX16_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D49, .hexadecimal); pub const GL_RENDERBUFFER_RED_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D50, .hexadecimal); pub const GL_RENDERBUFFER_GREEN_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D51, .hexadecimal); pub const GL_RENDERBUFFER_BLUE_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D52, .hexadecimal); pub const GL_RENDERBUFFER_ALPHA_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D53, .hexadecimal); pub const GL_RENDERBUFFER_DEPTH_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D54, .hexadecimal); pub const GL_RENDERBUFFER_STENCIL_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D55, .hexadecimal); pub const GL_EXT_framebuffer_sRGB = @as(c_int, 1); pub const GL_FRAMEBUFFER_SRGB_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DB9, .hexadecimal); pub const GL_FRAMEBUFFER_SRGB_CAPABLE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DBA, .hexadecimal); pub const GL_EXT_geometry_shader4 = @as(c_int, 1); pub const GL_GEOMETRY_SHADER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DD9, .hexadecimal); pub const GL_GEOMETRY_VERTICES_OUT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DDA, .hexadecimal); pub const GL_GEOMETRY_INPUT_TYPE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DDB, .hexadecimal); pub const GL_GEOMETRY_OUTPUT_TYPE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DDC, .hexadecimal); pub const GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C29, .hexadecimal); pub const GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DDD, .hexadecimal); pub const GL_MAX_VERTEX_VARYING_COMPONENTS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DDE, .hexadecimal); pub const GL_MAX_VARYING_COMPONENTS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B4B, .hexadecimal); pub const GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DDF, .hexadecimal); pub const GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DE0, .hexadecimal); pub const GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DE1, .hexadecimal); pub const GL_LINES_ADJACENCY_EXT = @as(c_int, 0x000A); pub const GL_LINE_STRIP_ADJACENCY_EXT = @as(c_int, 0x000B); pub const GL_TRIANGLES_ADJACENCY_EXT = @as(c_int, 0x000C); pub const GL_TRIANGLE_STRIP_ADJACENCY_EXT = @as(c_int, 0x000D); pub const GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DA8, .hexadecimal); pub const GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DA9, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DA7, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CD4, .hexadecimal); pub const GL_PROGRAM_POINT_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8642, .hexadecimal); pub const GL_EXT_gpu_program_parameters = @as(c_int, 1); pub const GL_EXT_gpu_shader4 = @as(c_int, 1); pub const GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88FD, .hexadecimal); pub const GL_SAMPLER_1D_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DC0, .hexadecimal); pub const GL_SAMPLER_2D_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DC1, .hexadecimal); pub const GL_SAMPLER_BUFFER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DC2, .hexadecimal); pub const GL_SAMPLER_1D_ARRAY_SHADOW_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DC3, .hexadecimal); pub const GL_SAMPLER_2D_ARRAY_SHADOW_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DC4, .hexadecimal); pub const GL_SAMPLER_CUBE_SHADOW_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DC5, .hexadecimal); pub const GL_UNSIGNED_INT_VEC2_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DC6, .hexadecimal); pub const GL_UNSIGNED_INT_VEC3_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DC7, .hexadecimal); pub const GL_UNSIGNED_INT_VEC4_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DC8, .hexadecimal); pub const GL_INT_SAMPLER_1D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DC9, .hexadecimal); pub const GL_INT_SAMPLER_2D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DCA, .hexadecimal); pub const GL_INT_SAMPLER_3D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DCB, .hexadecimal); pub const GL_INT_SAMPLER_CUBE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DCC, .hexadecimal); pub const GL_INT_SAMPLER_2D_RECT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DCD, .hexadecimal); pub const GL_INT_SAMPLER_1D_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DCE, .hexadecimal); pub const GL_INT_SAMPLER_2D_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DCF, .hexadecimal); pub const GL_INT_SAMPLER_BUFFER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DD0, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_1D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DD1, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_2D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DD2, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_3D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DD3, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_CUBE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DD4, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DD5, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DD6, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DD7, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DD8, .hexadecimal); pub const GL_MIN_PROGRAM_TEXEL_OFFSET_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8904, .hexadecimal); pub const GL_MAX_PROGRAM_TEXEL_OFFSET_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8905, .hexadecimal); pub const GL_EXT_histogram = @as(c_int, 1); pub const GL_HISTOGRAM_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8024, .hexadecimal); pub const GL_PROXY_HISTOGRAM_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8025, .hexadecimal); pub const GL_HISTOGRAM_WIDTH_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8026, .hexadecimal); pub const GL_HISTOGRAM_FORMAT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8027, .hexadecimal); pub const GL_HISTOGRAM_RED_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8028, .hexadecimal); pub const GL_HISTOGRAM_GREEN_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8029, .hexadecimal); pub const GL_HISTOGRAM_BLUE_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x802A, .hexadecimal); pub const GL_HISTOGRAM_ALPHA_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x802B, .hexadecimal); pub const GL_HISTOGRAM_LUMINANCE_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x802C, .hexadecimal); pub const GL_HISTOGRAM_SINK_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x802D, .hexadecimal); pub const GL_MINMAX_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x802E, .hexadecimal); pub const GL_MINMAX_FORMAT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x802F, .hexadecimal); pub const GL_MINMAX_SINK_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8030, .hexadecimal); pub const GL_TABLE_TOO_LARGE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8031, .hexadecimal); pub const GL_EXT_index_array_formats = @as(c_int, 1); pub const GL_IUI_V2F_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81AD, .hexadecimal); pub const GL_IUI_V3F_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81AE, .hexadecimal); pub const GL_IUI_N3F_V2F_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81AF, .hexadecimal); pub const GL_IUI_N3F_V3F_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81B0, .hexadecimal); pub const GL_T2F_IUI_V2F_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81B1, .hexadecimal); pub const GL_T2F_IUI_V3F_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81B2, .hexadecimal); pub const GL_T2F_IUI_N3F_V2F_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81B3, .hexadecimal); pub const GL_T2F_IUI_N3F_V3F_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81B4, .hexadecimal); pub const GL_EXT_index_func = @as(c_int, 1); pub const GL_INDEX_TEST_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81B5, .hexadecimal); pub const GL_INDEX_TEST_FUNC_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81B6, .hexadecimal); pub const GL_INDEX_TEST_REF_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81B7, .hexadecimal); pub const GL_EXT_index_material = @as(c_int, 1); pub const GL_INDEX_MATERIAL_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81B8, .hexadecimal); pub const GL_INDEX_MATERIAL_PARAMETER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81B9, .hexadecimal); pub const GL_INDEX_MATERIAL_FACE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81BA, .hexadecimal); pub const GL_EXT_index_texture = @as(c_int, 1); pub const GL_EXT_light_texture = @as(c_int, 1); pub const GL_FRAGMENT_MATERIAL_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8349, .hexadecimal); pub const GL_FRAGMENT_NORMAL_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x834A, .hexadecimal); pub const GL_FRAGMENT_COLOR_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x834C, .hexadecimal); pub const GL_ATTENUATION_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x834D, .hexadecimal); pub const GL_SHADOW_ATTENUATION_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x834E, .hexadecimal); pub const GL_TEXTURE_APPLICATION_MODE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x834F, .hexadecimal); pub const GL_TEXTURE_LIGHT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8350, .hexadecimal); pub const GL_TEXTURE_MATERIAL_FACE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8351, .hexadecimal); pub const GL_TEXTURE_MATERIAL_PARAMETER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8352, .hexadecimal); pub const GL_EXT_memory_object = @as(c_int, 1); pub const GL_TEXTURE_TILING_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9580, .hexadecimal); pub const GL_DEDICATED_MEMORY_OBJECT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9581, .hexadecimal); pub const GL_PROTECTED_MEMORY_OBJECT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x959B, .hexadecimal); pub const GL_NUM_TILING_TYPES_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9582, .hexadecimal); pub const GL_TILING_TYPES_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9583, .hexadecimal); pub const GL_OPTIMAL_TILING_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9584, .hexadecimal); pub const GL_LINEAR_TILING_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9585, .hexadecimal); pub const GL_NUM_DEVICE_UUIDS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9596, .hexadecimal); pub const GL_DEVICE_UUID_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9597, .hexadecimal); pub const GL_DRIVER_UUID_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9598, .hexadecimal); pub const GL_UUID_SIZE_EXT = @as(c_int, 16); pub const GL_EXT_memory_object_fd = @as(c_int, 1); pub const GL_HANDLE_TYPE_OPAQUE_FD_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9586, .hexadecimal); pub const GL_EXT_memory_object_win32 = @as(c_int, 1); pub const GL_HANDLE_TYPE_OPAQUE_WIN32_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9587, .hexadecimal); pub const GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9588, .hexadecimal); pub const GL_DEVICE_LUID_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9599, .hexadecimal); pub const GL_DEVICE_NODE_MASK_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x959A, .hexadecimal); pub const GL_LUID_SIZE_EXT = @as(c_int, 8); pub const GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9589, .hexadecimal); pub const GL_HANDLE_TYPE_D3D12_RESOURCE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x958A, .hexadecimal); pub const GL_HANDLE_TYPE_D3D11_IMAGE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x958B, .hexadecimal); pub const GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x958C, .hexadecimal); pub const GL_EXT_misc_attribute = @as(c_int, 1); pub const GL_EXT_multi_draw_arrays = @as(c_int, 1); pub const GL_EXT_multisample = @as(c_int, 1); pub const GL_MULTISAMPLE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x809D, .hexadecimal); pub const GL_SAMPLE_ALPHA_TO_MASK_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x809E, .hexadecimal); pub const GL_SAMPLE_ALPHA_TO_ONE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x809F, .hexadecimal); pub const GL_SAMPLE_MASK_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A0, .hexadecimal); pub const GL_1PASS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A1, .hexadecimal); pub const GL_2PASS_0_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A2, .hexadecimal); pub const GL_2PASS_1_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A3, .hexadecimal); pub const GL_4PASS_0_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A4, .hexadecimal); pub const GL_4PASS_1_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A5, .hexadecimal); pub const GL_4PASS_2_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A6, .hexadecimal); pub const GL_4PASS_3_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A7, .hexadecimal); pub const GL_SAMPLE_BUFFERS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A8, .hexadecimal); pub const GL_SAMPLES_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A9, .hexadecimal); pub const GL_SAMPLE_MASK_VALUE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80AA, .hexadecimal); pub const GL_SAMPLE_MASK_INVERT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80AB, .hexadecimal); pub const GL_SAMPLE_PATTERN_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80AC, .hexadecimal); pub const GL_MULTISAMPLE_BIT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x20000000, .hexadecimal); pub const GL_EXT_multiview_tessellation_geometry_shader = @as(c_int, 1); pub const GL_EXT_multiview_texture_multisample = @as(c_int, 1); pub const GL_EXT_multiview_timer_query = @as(c_int, 1); pub const GL_EXT_packed_depth_stencil = @as(c_int, 1); pub const GL_DEPTH_STENCIL_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84F9, .hexadecimal); pub const GL_UNSIGNED_INT_24_8_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84FA, .hexadecimal); pub const GL_DEPTH24_STENCIL8_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88F0, .hexadecimal); pub const GL_TEXTURE_STENCIL_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88F1, .hexadecimal); pub const GL_EXT_packed_float = @as(c_int, 1); pub const GL_R11F_G11F_B10F_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C3A, .hexadecimal); pub const GL_UNSIGNED_INT_10F_11F_11F_REV_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C3B, .hexadecimal); pub const GL_RGBA_SIGNED_COMPONENTS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C3C, .hexadecimal); pub const GL_EXT_packed_pixels = @as(c_int, 1); pub const GL_UNSIGNED_BYTE_3_3_2_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8032, .hexadecimal); pub const GL_UNSIGNED_SHORT_4_4_4_4_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8033, .hexadecimal); pub const GL_UNSIGNED_SHORT_5_5_5_1_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8034, .hexadecimal); pub const GL_UNSIGNED_INT_8_8_8_8_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8035, .hexadecimal); pub const GL_UNSIGNED_INT_10_10_10_2_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8036, .hexadecimal); pub const GL_EXT_paletted_texture = @as(c_int, 1); pub const GL_COLOR_INDEX1_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80E2, .hexadecimal); pub const GL_COLOR_INDEX2_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80E3, .hexadecimal); pub const GL_COLOR_INDEX4_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80E4, .hexadecimal); pub const GL_COLOR_INDEX8_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80E5, .hexadecimal); pub const GL_COLOR_INDEX12_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80E6, .hexadecimal); pub const GL_COLOR_INDEX16_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80E7, .hexadecimal); pub const GL_TEXTURE_INDEX_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80ED, .hexadecimal); pub const GL_EXT_pixel_buffer_object = @as(c_int, 1); pub const GL_PIXEL_PACK_BUFFER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88EB, .hexadecimal); pub const GL_PIXEL_UNPACK_BUFFER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88EC, .hexadecimal); pub const GL_PIXEL_PACK_BUFFER_BINDING_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88ED, .hexadecimal); pub const GL_PIXEL_UNPACK_BUFFER_BINDING_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88EF, .hexadecimal); pub const GL_EXT_pixel_transform = @as(c_int, 1); pub const GL_PIXEL_TRANSFORM_2D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8330, .hexadecimal); pub const GL_PIXEL_MAG_FILTER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8331, .hexadecimal); pub const GL_PIXEL_MIN_FILTER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8332, .hexadecimal); pub const GL_PIXEL_CUBIC_WEIGHT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8333, .hexadecimal); pub const GL_CUBIC_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8334, .hexadecimal); pub const GL_AVERAGE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8335, .hexadecimal); pub const GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8336, .hexadecimal); pub const GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8337, .hexadecimal); pub const GL_PIXEL_TRANSFORM_2D_MATRIX_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8338, .hexadecimal); pub const GL_EXT_pixel_transform_color_table = @as(c_int, 1); pub const GL_EXT_point_parameters = @as(c_int, 1); pub const GL_POINT_SIZE_MIN_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8126, .hexadecimal); pub const GL_POINT_SIZE_MAX_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8127, .hexadecimal); pub const GL_POINT_FADE_THRESHOLD_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8128, .hexadecimal); pub const GL_DISTANCE_ATTENUATION_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8129, .hexadecimal); pub const GL_EXT_polygon_offset = @as(c_int, 1); pub const GL_POLYGON_OFFSET_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8037, .hexadecimal); pub const GL_POLYGON_OFFSET_FACTOR_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8038, .hexadecimal); pub const GL_POLYGON_OFFSET_BIAS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8039, .hexadecimal); pub const GL_EXT_polygon_offset_clamp = @as(c_int, 1); pub const GL_POLYGON_OFFSET_CLAMP_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E1B, .hexadecimal); pub const GL_EXT_post_depth_coverage = @as(c_int, 1); pub const GL_EXT_provoking_vertex = @as(c_int, 1); pub const GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E4C, .hexadecimal); pub const GL_FIRST_VERTEX_CONVENTION_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E4D, .hexadecimal); pub const GL_LAST_VERTEX_CONVENTION_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E4E, .hexadecimal); pub const GL_PROVOKING_VERTEX_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E4F, .hexadecimal); pub const GL_EXT_raster_multisample = @as(c_int, 1); pub const GL_RASTER_MULTISAMPLE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9327, .hexadecimal); pub const GL_RASTER_SAMPLES_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9328, .hexadecimal); pub const GL_MAX_RASTER_SAMPLES_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9329, .hexadecimal); pub const GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x932A, .hexadecimal); pub const GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x932B, .hexadecimal); pub const GL_EFFECTIVE_RASTER_SAMPLES_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x932C, .hexadecimal); pub const GL_EXT_rescale_normal = @as(c_int, 1); pub const GL_RESCALE_NORMAL_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x803A, .hexadecimal); pub const GL_EXT_secondary_color = @as(c_int, 1); pub const GL_COLOR_SUM_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8458, .hexadecimal); pub const GL_CURRENT_SECONDARY_COLOR_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8459, .hexadecimal); pub const GL_SECONDARY_COLOR_ARRAY_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x845A, .hexadecimal); pub const GL_SECONDARY_COLOR_ARRAY_TYPE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x845B, .hexadecimal); pub const GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x845C, .hexadecimal); pub const GL_SECONDARY_COLOR_ARRAY_POINTER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x845D, .hexadecimal); pub const GL_SECONDARY_COLOR_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x845E, .hexadecimal); pub const GL_EXT_semaphore = @as(c_int, 1); pub const GL_LAYOUT_GENERAL_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x958D, .hexadecimal); pub const GL_LAYOUT_COLOR_ATTACHMENT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x958E, .hexadecimal); pub const GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x958F, .hexadecimal); pub const GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9590, .hexadecimal); pub const GL_LAYOUT_SHADER_READ_ONLY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9591, .hexadecimal); pub const GL_LAYOUT_TRANSFER_SRC_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9592, .hexadecimal); pub const GL_LAYOUT_TRANSFER_DST_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9593, .hexadecimal); pub const GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9530, .hexadecimal); pub const GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9531, .hexadecimal); pub const GL_EXT_semaphore_fd = @as(c_int, 1); pub const GL_EXT_semaphore_win32 = @as(c_int, 1); pub const GL_HANDLE_TYPE_D3D12_FENCE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9594, .hexadecimal); pub const GL_D3D12_FENCE_VALUE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9595, .hexadecimal); pub const GL_EXT_separate_shader_objects = @as(c_int, 1); pub const GL_ACTIVE_PROGRAM_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8B8D, .hexadecimal); pub const GL_EXT_separate_specular_color = @as(c_int, 1); pub const GL_LIGHT_MODEL_COLOR_CONTROL_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81F8, .hexadecimal); pub const GL_SINGLE_COLOR_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81F9, .hexadecimal); pub const GL_SEPARATE_SPECULAR_COLOR_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81FA, .hexadecimal); pub const GL_EXT_shader_framebuffer_fetch = @as(c_int, 1); pub const GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A52, .hexadecimal); pub const GL_EXT_shader_framebuffer_fetch_non_coherent = @as(c_int, 1); pub const GL_EXT_shader_image_load_formatted = @as(c_int, 1); pub const GL_EXT_shader_image_load_store = @as(c_int, 1); pub const GL_MAX_IMAGE_UNITS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F38, .hexadecimal); pub const GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F39, .hexadecimal); pub const GL_IMAGE_BINDING_NAME_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F3A, .hexadecimal); pub const GL_IMAGE_BINDING_LEVEL_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F3B, .hexadecimal); pub const GL_IMAGE_BINDING_LAYERED_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F3C, .hexadecimal); pub const GL_IMAGE_BINDING_LAYER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F3D, .hexadecimal); pub const GL_IMAGE_BINDING_ACCESS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F3E, .hexadecimal); pub const GL_IMAGE_1D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x904C, .hexadecimal); pub const GL_IMAGE_2D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x904D, .hexadecimal); pub const GL_IMAGE_3D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x904E, .hexadecimal); pub const GL_IMAGE_2D_RECT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x904F, .hexadecimal); pub const GL_IMAGE_CUBE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9050, .hexadecimal); pub const GL_IMAGE_BUFFER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9051, .hexadecimal); pub const GL_IMAGE_1D_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9052, .hexadecimal); pub const GL_IMAGE_2D_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9053, .hexadecimal); pub const GL_IMAGE_CUBE_MAP_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9054, .hexadecimal); pub const GL_IMAGE_2D_MULTISAMPLE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9055, .hexadecimal); pub const GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9056, .hexadecimal); pub const GL_INT_IMAGE_1D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9057, .hexadecimal); pub const GL_INT_IMAGE_2D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9058, .hexadecimal); pub const GL_INT_IMAGE_3D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9059, .hexadecimal); pub const GL_INT_IMAGE_2D_RECT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x905A, .hexadecimal); pub const GL_INT_IMAGE_CUBE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x905B, .hexadecimal); pub const GL_INT_IMAGE_BUFFER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x905C, .hexadecimal); pub const GL_INT_IMAGE_1D_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x905D, .hexadecimal); pub const GL_INT_IMAGE_2D_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x905E, .hexadecimal); pub const GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x905F, .hexadecimal); pub const GL_INT_IMAGE_2D_MULTISAMPLE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9060, .hexadecimal); pub const GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9061, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_1D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9062, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_2D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9063, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_3D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9064, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9065, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_CUBE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9066, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_BUFFER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9067, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9068, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9069, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x906A, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x906B, .hexadecimal); pub const GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x906C, .hexadecimal); pub const GL_MAX_IMAGE_SAMPLES_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x906D, .hexadecimal); pub const GL_IMAGE_BINDING_FORMAT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x906E, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT = @as(c_int, 0x00000001); pub const GL_ELEMENT_ARRAY_BARRIER_BIT_EXT = @as(c_int, 0x00000002); pub const GL_UNIFORM_BARRIER_BIT_EXT = @as(c_int, 0x00000004); pub const GL_TEXTURE_FETCH_BARRIER_BIT_EXT = @as(c_int, 0x00000008); pub const GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT = @as(c_int, 0x00000020); pub const GL_COMMAND_BARRIER_BIT_EXT = @as(c_int, 0x00000040); pub const GL_PIXEL_BUFFER_BARRIER_BIT_EXT = @as(c_int, 0x00000080); pub const GL_TEXTURE_UPDATE_BARRIER_BIT_EXT = @as(c_int, 0x00000100); pub const GL_BUFFER_UPDATE_BARRIER_BIT_EXT = @as(c_int, 0x00000200); pub const GL_FRAMEBUFFER_BARRIER_BIT_EXT = @as(c_int, 0x00000400); pub const GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT = @as(c_int, 0x00000800); pub const GL_ATOMIC_COUNTER_BARRIER_BIT_EXT = @as(c_int, 0x00001000); pub const GL_ALL_BARRIER_BITS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0xFFFFFFFF, .hexadecimal); pub const GL_EXT_shader_integer_mix = @as(c_int, 1); pub const GL_EXT_shadow_funcs = @as(c_int, 1); pub const GL_EXT_shared_texture_palette = @as(c_int, 1); pub const GL_SHARED_TEXTURE_PALETTE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81FB, .hexadecimal); pub const GL_EXT_sparse_texture2 = @as(c_int, 1); pub const GL_EXT_stencil_clear_tag = @as(c_int, 1); pub const GL_STENCIL_TAG_BITS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88F2, .hexadecimal); pub const GL_STENCIL_CLEAR_TAG_VALUE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88F3, .hexadecimal); pub const GL_EXT_stencil_two_side = @as(c_int, 1); pub const GL_STENCIL_TEST_TWO_SIDE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8910, .hexadecimal); pub const GL_ACTIVE_STENCIL_FACE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8911, .hexadecimal); pub const GL_EXT_stencil_wrap = @as(c_int, 1); pub const GL_INCR_WRAP_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8507, .hexadecimal); pub const GL_DECR_WRAP_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8508, .hexadecimal); pub const GL_EXT_subtexture = @as(c_int, 1); pub const GL_EXT_texture = @as(c_int, 1); pub const GL_ALPHA4_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x803B, .hexadecimal); pub const GL_ALPHA8_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x803C, .hexadecimal); pub const GL_ALPHA12_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x803D, .hexadecimal); pub const GL_ALPHA16_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x803E, .hexadecimal); pub const GL_LUMINANCE4_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x803F, .hexadecimal); pub const GL_LUMINANCE8_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8040, .hexadecimal); pub const GL_LUMINANCE12_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8041, .hexadecimal); pub const GL_LUMINANCE16_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8042, .hexadecimal); pub const GL_LUMINANCE4_ALPHA4_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8043, .hexadecimal); pub const GL_LUMINANCE6_ALPHA2_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8044, .hexadecimal); pub const GL_LUMINANCE8_ALPHA8_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8045, .hexadecimal); pub const GL_LUMINANCE12_ALPHA4_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8046, .hexadecimal); pub const GL_LUMINANCE12_ALPHA12_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8047, .hexadecimal); pub const GL_LUMINANCE16_ALPHA16_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8048, .hexadecimal); pub const GL_INTENSITY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8049, .hexadecimal); pub const GL_INTENSITY4_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x804A, .hexadecimal); pub const GL_INTENSITY8_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x804B, .hexadecimal); pub const GL_INTENSITY12_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x804C, .hexadecimal); pub const GL_INTENSITY16_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x804D, .hexadecimal); pub const GL_RGB2_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x804E, .hexadecimal); pub const GL_RGB4_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x804F, .hexadecimal); pub const GL_RGB5_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8050, .hexadecimal); pub const GL_RGB8_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8051, .hexadecimal); pub const GL_RGB10_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8052, .hexadecimal); pub const GL_RGB12_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8053, .hexadecimal); pub const GL_RGB16_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8054, .hexadecimal); pub const GL_RGBA2_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8055, .hexadecimal); pub const GL_RGBA4_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8056, .hexadecimal); pub const GL_RGB5_A1_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8057, .hexadecimal); pub const GL_RGBA8_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8058, .hexadecimal); pub const GL_RGB10_A2_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8059, .hexadecimal); pub const GL_RGBA12_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x805A, .hexadecimal); pub const GL_RGBA16_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x805B, .hexadecimal); pub const GL_TEXTURE_RED_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x805C, .hexadecimal); pub const GL_TEXTURE_GREEN_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x805D, .hexadecimal); pub const GL_TEXTURE_BLUE_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x805E, .hexadecimal); pub const GL_TEXTURE_ALPHA_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x805F, .hexadecimal); pub const GL_TEXTURE_LUMINANCE_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8060, .hexadecimal); pub const GL_TEXTURE_INTENSITY_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8061, .hexadecimal); pub const GL_REPLACE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8062, .hexadecimal); pub const GL_PROXY_TEXTURE_1D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8063, .hexadecimal); pub const GL_PROXY_TEXTURE_2D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8064, .hexadecimal); pub const GL_TEXTURE_TOO_LARGE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8065, .hexadecimal); pub const GL_EXT_texture3D = @as(c_int, 1); pub const GL_PACK_SKIP_IMAGES_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x806B, .hexadecimal); pub const GL_PACK_IMAGE_HEIGHT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x806C, .hexadecimal); pub const GL_UNPACK_SKIP_IMAGES_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x806D, .hexadecimal); pub const GL_UNPACK_IMAGE_HEIGHT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x806E, .hexadecimal); pub const GL_TEXTURE_3D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x806F, .hexadecimal); pub const GL_PROXY_TEXTURE_3D_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8070, .hexadecimal); pub const GL_TEXTURE_DEPTH_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8071, .hexadecimal); pub const GL_TEXTURE_WRAP_R_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8072, .hexadecimal); pub const GL_MAX_3D_TEXTURE_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8073, .hexadecimal); pub const GL_EXT_texture_array = @as(c_int, 1); pub const GL_TEXTURE_1D_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C18, .hexadecimal); pub const GL_PROXY_TEXTURE_1D_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C19, .hexadecimal); pub const GL_TEXTURE_2D_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C1A, .hexadecimal); pub const GL_PROXY_TEXTURE_2D_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C1B, .hexadecimal); pub const GL_TEXTURE_BINDING_1D_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C1C, .hexadecimal); pub const GL_TEXTURE_BINDING_2D_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C1D, .hexadecimal); pub const GL_MAX_ARRAY_TEXTURE_LAYERS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88FF, .hexadecimal); pub const GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x884E, .hexadecimal); pub const GL_EXT_texture_buffer_object = @as(c_int, 1); pub const GL_TEXTURE_BUFFER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C2A, .hexadecimal); pub const GL_MAX_TEXTURE_BUFFER_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C2B, .hexadecimal); pub const GL_TEXTURE_BINDING_BUFFER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C2C, .hexadecimal); pub const GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C2D, .hexadecimal); pub const GL_TEXTURE_BUFFER_FORMAT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C2E, .hexadecimal); pub const GL_EXT_texture_compression_latc = @as(c_int, 1); pub const GL_COMPRESSED_LUMINANCE_LATC1_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C70, .hexadecimal); pub const GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C71, .hexadecimal); pub const GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C72, .hexadecimal); pub const GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C73, .hexadecimal); pub const GL_EXT_texture_compression_rgtc = @as(c_int, 1); pub const GL_COMPRESSED_RED_RGTC1_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DBB, .hexadecimal); pub const GL_COMPRESSED_SIGNED_RED_RGTC1_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DBC, .hexadecimal); pub const GL_COMPRESSED_RED_GREEN_RGTC2_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DBD, .hexadecimal); pub const GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DBE, .hexadecimal); pub const GL_EXT_texture_compression_s3tc = @as(c_int, 1); pub const GL_COMPRESSED_RGB_S3TC_DXT1_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83F0, .hexadecimal); pub const GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83F1, .hexadecimal); pub const GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83F2, .hexadecimal); pub const GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83F3, .hexadecimal); pub const GL_EXT_texture_cube_map = @as(c_int, 1); pub const GL_NORMAL_MAP_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8511, .hexadecimal); pub const GL_REFLECTION_MAP_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8512, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8513, .hexadecimal); pub const GL_TEXTURE_BINDING_CUBE_MAP_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8514, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8515, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8516, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8517, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8518, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8519, .hexadecimal); pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x851A, .hexadecimal); pub const GL_PROXY_TEXTURE_CUBE_MAP_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x851B, .hexadecimal); pub const GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x851C, .hexadecimal); pub const GL_EXT_texture_env_add = @as(c_int, 1); pub const GL_EXT_texture_env_combine = @as(c_int, 1); pub const GL_COMBINE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8570, .hexadecimal); pub const GL_COMBINE_RGB_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8571, .hexadecimal); pub const GL_COMBINE_ALPHA_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8572, .hexadecimal); pub const GL_RGB_SCALE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8573, .hexadecimal); pub const GL_ADD_SIGNED_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8574, .hexadecimal); pub const GL_INTERPOLATE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8575, .hexadecimal); pub const GL_CONSTANT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8576, .hexadecimal); pub const GL_PRIMARY_COLOR_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8577, .hexadecimal); pub const GL_PREVIOUS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8578, .hexadecimal); pub const GL_SOURCE0_RGB_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8580, .hexadecimal); pub const GL_SOURCE1_RGB_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8581, .hexadecimal); pub const GL_SOURCE2_RGB_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8582, .hexadecimal); pub const GL_SOURCE0_ALPHA_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8588, .hexadecimal); pub const GL_SOURCE1_ALPHA_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8589, .hexadecimal); pub const GL_SOURCE2_ALPHA_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x858A, .hexadecimal); pub const GL_OPERAND0_RGB_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8590, .hexadecimal); pub const GL_OPERAND1_RGB_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8591, .hexadecimal); pub const GL_OPERAND2_RGB_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8592, .hexadecimal); pub const GL_OPERAND0_ALPHA_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8598, .hexadecimal); pub const GL_OPERAND1_ALPHA_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8599, .hexadecimal); pub const GL_OPERAND2_ALPHA_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x859A, .hexadecimal); pub const GL_EXT_texture_env_dot3 = @as(c_int, 1); pub const GL_DOT3_RGB_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8740, .hexadecimal); pub const GL_DOT3_RGBA_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8741, .hexadecimal); pub const GL_EXT_texture_filter_anisotropic = @as(c_int, 1); pub const GL_TEXTURE_MAX_ANISOTROPY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84FE, .hexadecimal); pub const GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84FF, .hexadecimal); pub const GL_EXT_texture_filter_minmax = @as(c_int, 1); pub const GL_TEXTURE_REDUCTION_MODE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9366, .hexadecimal); pub const GL_WEIGHTED_AVERAGE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9367, .hexadecimal); pub const GL_EXT_texture_integer = @as(c_int, 1); pub const GL_RGBA32UI_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D70, .hexadecimal); pub const GL_RGB32UI_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D71, .hexadecimal); pub const GL_ALPHA32UI_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D72, .hexadecimal); pub const GL_INTENSITY32UI_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D73, .hexadecimal); pub const GL_LUMINANCE32UI_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D74, .hexadecimal); pub const GL_LUMINANCE_ALPHA32UI_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D75, .hexadecimal); pub const GL_RGBA16UI_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D76, .hexadecimal); pub const GL_RGB16UI_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D77, .hexadecimal); pub const GL_ALPHA16UI_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D78, .hexadecimal); pub const GL_INTENSITY16UI_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D79, .hexadecimal); pub const GL_LUMINANCE16UI_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D7A, .hexadecimal); pub const GL_LUMINANCE_ALPHA16UI_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D7B, .hexadecimal); pub const GL_RGBA8UI_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D7C, .hexadecimal); pub const GL_RGB8UI_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D7D, .hexadecimal); pub const GL_ALPHA8UI_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D7E, .hexadecimal); pub const GL_INTENSITY8UI_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D7F, .hexadecimal); pub const GL_LUMINANCE8UI_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D80, .hexadecimal); pub const GL_LUMINANCE_ALPHA8UI_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D81, .hexadecimal); pub const GL_RGBA32I_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D82, .hexadecimal); pub const GL_RGB32I_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D83, .hexadecimal); pub const GL_ALPHA32I_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D84, .hexadecimal); pub const GL_INTENSITY32I_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D85, .hexadecimal); pub const GL_LUMINANCE32I_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D86, .hexadecimal); pub const GL_LUMINANCE_ALPHA32I_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D87, .hexadecimal); pub const GL_RGBA16I_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D88, .hexadecimal); pub const GL_RGB16I_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D89, .hexadecimal); pub const GL_ALPHA16I_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D8A, .hexadecimal); pub const GL_INTENSITY16I_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D8B, .hexadecimal); pub const GL_LUMINANCE16I_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D8C, .hexadecimal); pub const GL_LUMINANCE_ALPHA16I_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D8D, .hexadecimal); pub const GL_RGBA8I_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D8E, .hexadecimal); pub const GL_RGB8I_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D8F, .hexadecimal); pub const GL_ALPHA8I_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D90, .hexadecimal); pub const GL_INTENSITY8I_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D91, .hexadecimal); pub const GL_LUMINANCE8I_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D92, .hexadecimal); pub const GL_LUMINANCE_ALPHA8I_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D93, .hexadecimal); pub const GL_RED_INTEGER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D94, .hexadecimal); pub const GL_GREEN_INTEGER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D95, .hexadecimal); pub const GL_BLUE_INTEGER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D96, .hexadecimal); pub const GL_ALPHA_INTEGER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D97, .hexadecimal); pub const GL_RGB_INTEGER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D98, .hexadecimal); pub const GL_RGBA_INTEGER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D99, .hexadecimal); pub const GL_BGR_INTEGER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D9A, .hexadecimal); pub const GL_BGRA_INTEGER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D9B, .hexadecimal); pub const GL_LUMINANCE_INTEGER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D9C, .hexadecimal); pub const GL_LUMINANCE_ALPHA_INTEGER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D9D, .hexadecimal); pub const GL_RGBA_INTEGER_MODE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8D9E, .hexadecimal); pub const GL_EXT_texture_lod_bias = @as(c_int, 1); pub const GL_MAX_TEXTURE_LOD_BIAS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84FD, .hexadecimal); pub const GL_TEXTURE_FILTER_CONTROL_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8500, .hexadecimal); pub const GL_TEXTURE_LOD_BIAS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8501, .hexadecimal); pub const GL_EXT_texture_mirror_clamp = @as(c_int, 1); pub const GL_MIRROR_CLAMP_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8742, .hexadecimal); pub const GL_MIRROR_CLAMP_TO_EDGE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8743, .hexadecimal); pub const GL_MIRROR_CLAMP_TO_BORDER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8912, .hexadecimal); pub const GL_EXT_texture_object = @as(c_int, 1); pub const GL_TEXTURE_PRIORITY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8066, .hexadecimal); pub const GL_TEXTURE_RESIDENT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8067, .hexadecimal); pub const GL_TEXTURE_1D_BINDING_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8068, .hexadecimal); pub const GL_TEXTURE_2D_BINDING_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8069, .hexadecimal); pub const GL_TEXTURE_3D_BINDING_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x806A, .hexadecimal); pub const GL_EXT_texture_perturb_normal = @as(c_int, 1); pub const GL_PERTURB_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85AE, .hexadecimal); pub const GL_TEXTURE_NORMAL_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85AF, .hexadecimal); pub const GL_EXT_texture_sRGB = @as(c_int, 1); pub const GL_SRGB_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C40, .hexadecimal); pub const GL_SRGB8_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C41, .hexadecimal); pub const GL_SRGB_ALPHA_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C42, .hexadecimal); pub const GL_SRGB8_ALPHA8_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C43, .hexadecimal); pub const GL_SLUMINANCE_ALPHA_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C44, .hexadecimal); pub const GL_SLUMINANCE8_ALPHA8_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C45, .hexadecimal); pub const GL_SLUMINANCE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C46, .hexadecimal); pub const GL_SLUMINANCE8_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C47, .hexadecimal); pub const GL_COMPRESSED_SRGB_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C48, .hexadecimal); pub const GL_COMPRESSED_SRGB_ALPHA_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C49, .hexadecimal); pub const GL_COMPRESSED_SLUMINANCE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C4A, .hexadecimal); pub const GL_COMPRESSED_SLUMINANCE_ALPHA_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C4B, .hexadecimal); pub const GL_COMPRESSED_SRGB_S3TC_DXT1_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C4C, .hexadecimal); pub const GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C4D, .hexadecimal); pub const GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C4E, .hexadecimal); pub const GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C4F, .hexadecimal); pub const GL_EXT_texture_sRGB_R8 = @as(c_int, 1); pub const GL_SR8_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FBD, .hexadecimal); pub const GL_EXT_texture_sRGB_decode = @as(c_int, 1); pub const GL_TEXTURE_SRGB_DECODE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A48, .hexadecimal); pub const GL_DECODE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A49, .hexadecimal); pub const GL_SKIP_DECODE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8A4A, .hexadecimal); pub const GL_EXT_texture_shadow_lod = @as(c_int, 1); pub const GL_EXT_texture_shared_exponent = @as(c_int, 1); pub const GL_RGB9_E5_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C3D, .hexadecimal); pub const GL_UNSIGNED_INT_5_9_9_9_REV_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C3E, .hexadecimal); pub const GL_TEXTURE_SHARED_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C3F, .hexadecimal); pub const GL_EXT_texture_snorm = @as(c_int, 1); pub const GL_ALPHA_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9010, .hexadecimal); pub const GL_LUMINANCE_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9011, .hexadecimal); pub const GL_LUMINANCE_ALPHA_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9012, .hexadecimal); pub const GL_INTENSITY_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9013, .hexadecimal); pub const GL_ALPHA8_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9014, .hexadecimal); pub const GL_LUMINANCE8_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9015, .hexadecimal); pub const GL_LUMINANCE8_ALPHA8_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9016, .hexadecimal); pub const GL_INTENSITY8_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9017, .hexadecimal); pub const GL_ALPHA16_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9018, .hexadecimal); pub const GL_LUMINANCE16_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9019, .hexadecimal); pub const GL_LUMINANCE16_ALPHA16_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x901A, .hexadecimal); pub const GL_INTENSITY16_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x901B, .hexadecimal); pub const GL_RED_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F90, .hexadecimal); pub const GL_RG_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F91, .hexadecimal); pub const GL_RGB_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F92, .hexadecimal); pub const GL_RGBA_SNORM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F93, .hexadecimal); pub const GL_EXT_texture_swizzle = @as(c_int, 1); pub const GL_TEXTURE_SWIZZLE_R_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E42, .hexadecimal); pub const GL_TEXTURE_SWIZZLE_G_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E43, .hexadecimal); pub const GL_TEXTURE_SWIZZLE_B_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E44, .hexadecimal); pub const GL_TEXTURE_SWIZZLE_A_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E45, .hexadecimal); pub const GL_TEXTURE_SWIZZLE_RGBA_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E46, .hexadecimal); pub const GL_EXT_timer_query = @as(c_int, 1); pub const GL_TIME_ELAPSED_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88BF, .hexadecimal); pub const GL_EXT_transform_feedback = @as(c_int, 1); pub const GL_TRANSFORM_FEEDBACK_BUFFER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C8E, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C84, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C85, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C8F, .hexadecimal); pub const GL_INTERLEAVED_ATTRIBS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C8C, .hexadecimal); pub const GL_SEPARATE_ATTRIBS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C8D, .hexadecimal); pub const GL_PRIMITIVES_GENERATED_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C87, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C88, .hexadecimal); pub const GL_RASTERIZER_DISCARD_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C89, .hexadecimal); pub const GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C8A, .hexadecimal); pub const GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C8B, .hexadecimal); pub const GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C80, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_VARYINGS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C83, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C7F, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C76, .hexadecimal); pub const GL_EXT_vertex_array = @as(c_int, 1); pub const GL_VERTEX_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8074, .hexadecimal); pub const GL_NORMAL_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8075, .hexadecimal); pub const GL_COLOR_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8076, .hexadecimal); pub const GL_INDEX_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8077, .hexadecimal); pub const GL_TEXTURE_COORD_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8078, .hexadecimal); pub const GL_EDGE_FLAG_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8079, .hexadecimal); pub const GL_VERTEX_ARRAY_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x807A, .hexadecimal); pub const GL_VERTEX_ARRAY_TYPE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x807B, .hexadecimal); pub const GL_VERTEX_ARRAY_STRIDE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x807C, .hexadecimal); pub const GL_VERTEX_ARRAY_COUNT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x807D, .hexadecimal); pub const GL_NORMAL_ARRAY_TYPE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x807E, .hexadecimal); pub const GL_NORMAL_ARRAY_STRIDE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x807F, .hexadecimal); pub const GL_NORMAL_ARRAY_COUNT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8080, .hexadecimal); pub const GL_COLOR_ARRAY_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8081, .hexadecimal); pub const GL_COLOR_ARRAY_TYPE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8082, .hexadecimal); pub const GL_COLOR_ARRAY_STRIDE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8083, .hexadecimal); pub const GL_COLOR_ARRAY_COUNT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8084, .hexadecimal); pub const GL_INDEX_ARRAY_TYPE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8085, .hexadecimal); pub const GL_INDEX_ARRAY_STRIDE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8086, .hexadecimal); pub const GL_INDEX_ARRAY_COUNT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8087, .hexadecimal); pub const GL_TEXTURE_COORD_ARRAY_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8088, .hexadecimal); pub const GL_TEXTURE_COORD_ARRAY_TYPE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8089, .hexadecimal); pub const GL_TEXTURE_COORD_ARRAY_STRIDE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x808A, .hexadecimal); pub const GL_TEXTURE_COORD_ARRAY_COUNT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x808B, .hexadecimal); pub const GL_EDGE_FLAG_ARRAY_STRIDE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x808C, .hexadecimal); pub const GL_EDGE_FLAG_ARRAY_COUNT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x808D, .hexadecimal); pub const GL_VERTEX_ARRAY_POINTER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x808E, .hexadecimal); pub const GL_NORMAL_ARRAY_POINTER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x808F, .hexadecimal); pub const GL_COLOR_ARRAY_POINTER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8090, .hexadecimal); pub const GL_INDEX_ARRAY_POINTER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8091, .hexadecimal); pub const GL_TEXTURE_COORD_ARRAY_POINTER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8092, .hexadecimal); pub const GL_EDGE_FLAG_ARRAY_POINTER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8093, .hexadecimal); pub const GL_EXT_vertex_array_bgra = @as(c_int, 1); pub const GL_EXT_vertex_attrib_64bit = @as(c_int, 1); pub const GL_DOUBLE_VEC2_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FFC, .hexadecimal); pub const GL_DOUBLE_VEC3_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FFD, .hexadecimal); pub const GL_DOUBLE_VEC4_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8FFE, .hexadecimal); pub const GL_DOUBLE_MAT2_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F46, .hexadecimal); pub const GL_DOUBLE_MAT3_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F47, .hexadecimal); pub const GL_DOUBLE_MAT4_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F48, .hexadecimal); pub const GL_DOUBLE_MAT2x3_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F49, .hexadecimal); pub const GL_DOUBLE_MAT2x4_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F4A, .hexadecimal); pub const GL_DOUBLE_MAT3x2_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F4B, .hexadecimal); pub const GL_DOUBLE_MAT3x4_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F4C, .hexadecimal); pub const GL_DOUBLE_MAT4x2_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F4D, .hexadecimal); pub const GL_DOUBLE_MAT4x3_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F4E, .hexadecimal); pub const GL_EXT_vertex_shader = @as(c_int, 1); pub const GL_VERTEX_SHADER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8780, .hexadecimal); pub const GL_VERTEX_SHADER_BINDING_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8781, .hexadecimal); pub const GL_OP_INDEX_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8782, .hexadecimal); pub const GL_OP_NEGATE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8783, .hexadecimal); pub const GL_OP_DOT3_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8784, .hexadecimal); pub const GL_OP_DOT4_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8785, .hexadecimal); pub const GL_OP_MUL_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8786, .hexadecimal); pub const GL_OP_ADD_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8787, .hexadecimal); pub const GL_OP_MADD_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8788, .hexadecimal); pub const GL_OP_FRAC_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8789, .hexadecimal); pub const GL_OP_MAX_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x878A, .hexadecimal); pub const GL_OP_MIN_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x878B, .hexadecimal); pub const GL_OP_SET_GE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x878C, .hexadecimal); pub const GL_OP_SET_LT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x878D, .hexadecimal); pub const GL_OP_CLAMP_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x878E, .hexadecimal); pub const GL_OP_FLOOR_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x878F, .hexadecimal); pub const GL_OP_ROUND_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8790, .hexadecimal); pub const GL_OP_EXP_BASE_2_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8791, .hexadecimal); pub const GL_OP_LOG_BASE_2_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8792, .hexadecimal); pub const GL_OP_POWER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8793, .hexadecimal); pub const GL_OP_RECIP_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8794, .hexadecimal); pub const GL_OP_RECIP_SQRT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8795, .hexadecimal); pub const GL_OP_SUB_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8796, .hexadecimal); pub const GL_OP_CROSS_PRODUCT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8797, .hexadecimal); pub const GL_OP_MULTIPLY_MATRIX_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8798, .hexadecimal); pub const GL_OP_MOV_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8799, .hexadecimal); pub const GL_OUTPUT_VERTEX_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x879A, .hexadecimal); pub const GL_OUTPUT_COLOR0_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x879B, .hexadecimal); pub const GL_OUTPUT_COLOR1_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x879C, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD0_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x879D, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD1_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x879E, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD2_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x879F, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD3_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87A0, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD4_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87A1, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD5_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87A2, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD6_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87A3, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD7_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87A4, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD8_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87A5, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD9_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87A6, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD10_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87A7, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD11_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87A8, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD12_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87A9, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD13_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87AA, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD14_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87AB, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD15_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87AC, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD16_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87AD, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD17_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87AE, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD18_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87AF, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD19_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87B0, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD20_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87B1, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD21_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87B2, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD22_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87B3, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD23_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87B4, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD24_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87B5, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD25_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87B6, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD26_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87B7, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD27_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87B8, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD28_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87B9, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD29_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87BA, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD30_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87BB, .hexadecimal); pub const GL_OUTPUT_TEXTURE_COORD31_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87BC, .hexadecimal); pub const GL_OUTPUT_FOG_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87BD, .hexadecimal); pub const GL_SCALAR_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87BE, .hexadecimal); pub const GL_VECTOR_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87BF, .hexadecimal); pub const GL_MATRIX_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87C0, .hexadecimal); pub const GL_VARIANT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87C1, .hexadecimal); pub const GL_INVARIANT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87C2, .hexadecimal); pub const GL_LOCAL_CONSTANT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87C3, .hexadecimal); pub const GL_LOCAL_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87C4, .hexadecimal); pub const GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87C5, .hexadecimal); pub const GL_MAX_VERTEX_SHADER_VARIANTS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87C6, .hexadecimal); pub const GL_MAX_VERTEX_SHADER_INVARIANTS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87C7, .hexadecimal); pub const GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87C8, .hexadecimal); pub const GL_MAX_VERTEX_SHADER_LOCALS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87C9, .hexadecimal); pub const GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87CA, .hexadecimal); pub const GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87CB, .hexadecimal); pub const GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87CC, .hexadecimal); pub const GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87CD, .hexadecimal); pub const GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87CE, .hexadecimal); pub const GL_VERTEX_SHADER_INSTRUCTIONS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87CF, .hexadecimal); pub const GL_VERTEX_SHADER_VARIANTS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87D0, .hexadecimal); pub const GL_VERTEX_SHADER_INVARIANTS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87D1, .hexadecimal); pub const GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87D2, .hexadecimal); pub const GL_VERTEX_SHADER_LOCALS_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87D3, .hexadecimal); pub const GL_VERTEX_SHADER_OPTIMIZED_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87D4, .hexadecimal); pub const GL_X_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87D5, .hexadecimal); pub const GL_Y_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87D6, .hexadecimal); pub const GL_Z_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87D7, .hexadecimal); pub const GL_W_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87D8, .hexadecimal); pub const GL_NEGATIVE_X_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87D9, .hexadecimal); pub const GL_NEGATIVE_Y_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87DA, .hexadecimal); pub const GL_NEGATIVE_Z_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87DB, .hexadecimal); pub const GL_NEGATIVE_W_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87DC, .hexadecimal); pub const GL_ZERO_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87DD, .hexadecimal); pub const GL_ONE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87DE, .hexadecimal); pub const GL_NEGATIVE_ONE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87DF, .hexadecimal); pub const GL_NORMALIZED_RANGE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87E0, .hexadecimal); pub const GL_FULL_RANGE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87E1, .hexadecimal); pub const GL_CURRENT_VERTEX_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87E2, .hexadecimal); pub const GL_MVP_MATRIX_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87E3, .hexadecimal); pub const GL_VARIANT_VALUE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87E4, .hexadecimal); pub const GL_VARIANT_DATATYPE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87E5, .hexadecimal); pub const GL_VARIANT_ARRAY_STRIDE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87E6, .hexadecimal); pub const GL_VARIANT_ARRAY_TYPE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87E7, .hexadecimal); pub const GL_VARIANT_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87E8, .hexadecimal); pub const GL_VARIANT_ARRAY_POINTER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87E9, .hexadecimal); pub const GL_INVARIANT_VALUE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87EA, .hexadecimal); pub const GL_INVARIANT_DATATYPE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87EB, .hexadecimal); pub const GL_LOCAL_CONSTANT_VALUE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87EC, .hexadecimal); pub const GL_LOCAL_CONSTANT_DATATYPE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x87ED, .hexadecimal); pub const GL_EXT_vertex_weighting = @as(c_int, 1); pub const GL_MODELVIEW0_STACK_DEPTH_EXT = @as(c_int, 0x0BA3); pub const GL_MODELVIEW1_STACK_DEPTH_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8502, .hexadecimal); pub const GL_MODELVIEW0_MATRIX_EXT = @as(c_int, 0x0BA6); pub const GL_MODELVIEW1_MATRIX_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8506, .hexadecimal); pub const GL_VERTEX_WEIGHTING_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8509, .hexadecimal); pub const GL_MODELVIEW0_EXT = @as(c_int, 0x1700); pub const GL_MODELVIEW1_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x850A, .hexadecimal); pub const GL_CURRENT_VERTEX_WEIGHT_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x850B, .hexadecimal); pub const GL_VERTEX_WEIGHT_ARRAY_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x850C, .hexadecimal); pub const GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x850D, .hexadecimal); pub const GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x850E, .hexadecimal); pub const GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x850F, .hexadecimal); pub const GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8510, .hexadecimal); pub const GL_EXT_win32_keyed_mutex = @as(c_int, 1); pub const GL_EXT_window_rectangles = @as(c_int, 1); pub const GL_INCLUSIVE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F10, .hexadecimal); pub const GL_EXCLUSIVE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F11, .hexadecimal); pub const GL_WINDOW_RECTANGLE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F12, .hexadecimal); pub const GL_WINDOW_RECTANGLE_MODE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F13, .hexadecimal); pub const GL_MAX_WINDOW_RECTANGLES_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F14, .hexadecimal); pub const GL_NUM_WINDOW_RECTANGLES_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F15, .hexadecimal); pub const GL_EXT_x11_sync_object = @as(c_int, 1); pub const GL_SYNC_X11_FENCE_EXT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90E1, .hexadecimal); pub const GL_GREMEDY_frame_terminator = @as(c_int, 1); pub const GL_GREMEDY_string_marker = @as(c_int, 1); pub const GL_HP_convolution_border_modes = @as(c_int, 1); pub const GL_IGNORE_BORDER_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8150, .hexadecimal); pub const GL_CONSTANT_BORDER_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8151, .hexadecimal); pub const GL_REPLICATE_BORDER_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8153, .hexadecimal); pub const GL_CONVOLUTION_BORDER_COLOR_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8154, .hexadecimal); pub const GL_HP_image_transform = @as(c_int, 1); pub const GL_IMAGE_SCALE_X_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8155, .hexadecimal); pub const GL_IMAGE_SCALE_Y_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8156, .hexadecimal); pub const GL_IMAGE_TRANSLATE_X_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8157, .hexadecimal); pub const GL_IMAGE_TRANSLATE_Y_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8158, .hexadecimal); pub const GL_IMAGE_ROTATE_ANGLE_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8159, .hexadecimal); pub const GL_IMAGE_ROTATE_ORIGIN_X_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x815A, .hexadecimal); pub const GL_IMAGE_ROTATE_ORIGIN_Y_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x815B, .hexadecimal); pub const GL_IMAGE_MAG_FILTER_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x815C, .hexadecimal); pub const GL_IMAGE_MIN_FILTER_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x815D, .hexadecimal); pub const GL_IMAGE_CUBIC_WEIGHT_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x815E, .hexadecimal); pub const GL_CUBIC_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x815F, .hexadecimal); pub const GL_AVERAGE_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8160, .hexadecimal); pub const GL_IMAGE_TRANSFORM_2D_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8161, .hexadecimal); pub const GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8162, .hexadecimal); pub const GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8163, .hexadecimal); pub const GL_HP_occlusion_test = @as(c_int, 1); pub const GL_OCCLUSION_TEST_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8165, .hexadecimal); pub const GL_OCCLUSION_TEST_RESULT_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8166, .hexadecimal); pub const GL_HP_texture_lighting = @as(c_int, 1); pub const GL_TEXTURE_LIGHTING_MODE_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8167, .hexadecimal); pub const GL_TEXTURE_POST_SPECULAR_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8168, .hexadecimal); pub const GL_TEXTURE_PRE_SPECULAR_HP = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8169, .hexadecimal); pub const GL_IBM_cull_vertex = @as(c_int, 1); pub const GL_CULL_VERTEX_IBM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 103050, .decimal); pub const GL_IBM_multimode_draw_arrays = @as(c_int, 1); pub const GL_IBM_rasterpos_clip = @as(c_int, 1); pub const GL_RASTER_POSITION_UNCLIPPED_IBM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x19262, .hexadecimal); pub const GL_IBM_static_data = @as(c_int, 1); pub const GL_ALL_STATIC_DATA_IBM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 103060, .decimal); pub const GL_STATIC_VERTEX_ARRAY_IBM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 103061, .decimal); pub const GL_IBM_texture_mirrored_repeat = @as(c_int, 1); pub const GL_MIRRORED_REPEAT_IBM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8370, .hexadecimal); pub const GL_IBM_vertex_array_lists = @as(c_int, 1); pub const GL_VERTEX_ARRAY_LIST_IBM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 103070, .decimal); pub const GL_NORMAL_ARRAY_LIST_IBM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 103071, .decimal); pub const GL_COLOR_ARRAY_LIST_IBM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 103072, .decimal); pub const GL_INDEX_ARRAY_LIST_IBM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 103073, .decimal); pub const GL_TEXTURE_COORD_ARRAY_LIST_IBM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 103074, .decimal); pub const GL_EDGE_FLAG_ARRAY_LIST_IBM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 103075, .decimal); pub const GL_FOG_COORDINATE_ARRAY_LIST_IBM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 103076, .decimal); pub const GL_SECONDARY_COLOR_ARRAY_LIST_IBM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 103077, .decimal); pub const GL_VERTEX_ARRAY_LIST_STRIDE_IBM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 103080, .decimal); pub const GL_NORMAL_ARRAY_LIST_STRIDE_IBM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 103081, .decimal); pub const GL_COLOR_ARRAY_LIST_STRIDE_IBM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 103082, .decimal); pub const GL_INDEX_ARRAY_LIST_STRIDE_IBM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 103083, .decimal); pub const GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 103084, .decimal); pub const GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 103085, .decimal); pub const GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 103086, .decimal); pub const GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM = @import("std").zig.c_translation.promoteIntLiteral(c_int, 103087, .decimal); pub const GL_INGR_blend_func_separate = @as(c_int, 1); pub const GL_INGR_color_clamp = @as(c_int, 1); pub const GL_RED_MIN_CLAMP_INGR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8560, .hexadecimal); pub const GL_GREEN_MIN_CLAMP_INGR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8561, .hexadecimal); pub const GL_BLUE_MIN_CLAMP_INGR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8562, .hexadecimal); pub const GL_ALPHA_MIN_CLAMP_INGR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8563, .hexadecimal); pub const GL_RED_MAX_CLAMP_INGR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8564, .hexadecimal); pub const GL_GREEN_MAX_CLAMP_INGR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8565, .hexadecimal); pub const GL_BLUE_MAX_CLAMP_INGR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8566, .hexadecimal); pub const GL_ALPHA_MAX_CLAMP_INGR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8567, .hexadecimal); pub const GL_INGR_interlace_read = @as(c_int, 1); pub const GL_INTERLACE_READ_INGR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8568, .hexadecimal); pub const GL_INTEL_blackhole_render = @as(c_int, 1); pub const GL_BLACKHOLE_RENDER_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83FC, .hexadecimal); pub const GL_INTEL_conservative_rasterization = @as(c_int, 1); pub const GL_CONSERVATIVE_RASTERIZATION_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83FE, .hexadecimal); pub const GL_INTEL_fragment_shader_ordering = @as(c_int, 1); pub const GL_INTEL_framebuffer_CMAA = @as(c_int, 1); pub const GL_INTEL_map_texture = @as(c_int, 1); pub const GL_TEXTURE_MEMORY_LAYOUT_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83FF, .hexadecimal); pub const GL_LAYOUT_DEFAULT_INTEL = @as(c_int, 0); pub const GL_LAYOUT_LINEAR_INTEL = @as(c_int, 1); pub const GL_LAYOUT_LINEAR_CPU_CACHED_INTEL = @as(c_int, 2); pub const GL_INTEL_parallel_arrays = @as(c_int, 1); pub const GL_PARALLEL_ARRAYS_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83F4, .hexadecimal); pub const GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83F5, .hexadecimal); pub const GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83F6, .hexadecimal); pub const GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83F7, .hexadecimal); pub const GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83F8, .hexadecimal); pub const GL_INTEL_performance_query = @as(c_int, 1); pub const GL_PERFQUERY_SINGLE_CONTEXT_INTEL = @as(c_int, 0x00000000); pub const GL_PERFQUERY_GLOBAL_CONTEXT_INTEL = @as(c_int, 0x00000001); pub const GL_PERFQUERY_WAIT_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83FB, .hexadecimal); pub const GL_PERFQUERY_FLUSH_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83FA, .hexadecimal); pub const GL_PERFQUERY_DONOT_FLUSH_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83F9, .hexadecimal); pub const GL_PERFQUERY_COUNTER_EVENT_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x94F0, .hexadecimal); pub const GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x94F1, .hexadecimal); pub const GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x94F2, .hexadecimal); pub const GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x94F3, .hexadecimal); pub const GL_PERFQUERY_COUNTER_RAW_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x94F4, .hexadecimal); pub const GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x94F5, .hexadecimal); pub const GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x94F8, .hexadecimal); pub const GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x94F9, .hexadecimal); pub const GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x94FA, .hexadecimal); pub const GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x94FB, .hexadecimal); pub const GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x94FC, .hexadecimal); pub const GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x94FD, .hexadecimal); pub const GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x94FE, .hexadecimal); pub const GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x94FF, .hexadecimal); pub const GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9500, .hexadecimal); pub const GL_MESAX_texture_stack = @as(c_int, 1); pub const GL_TEXTURE_1D_STACK_MESAX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8759, .hexadecimal); pub const GL_TEXTURE_2D_STACK_MESAX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x875A, .hexadecimal); pub const GL_PROXY_TEXTURE_1D_STACK_MESAX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x875B, .hexadecimal); pub const GL_PROXY_TEXTURE_2D_STACK_MESAX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x875C, .hexadecimal); pub const GL_TEXTURE_1D_STACK_BINDING_MESAX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x875D, .hexadecimal); pub const GL_TEXTURE_2D_STACK_BINDING_MESAX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x875E, .hexadecimal); pub const GL_MESA_framebuffer_flip_y = @as(c_int, 1); pub const GL_FRAMEBUFFER_FLIP_Y_MESA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8BBB, .hexadecimal); pub const GL_MESA_pack_invert = @as(c_int, 1); pub const GL_PACK_INVERT_MESA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8758, .hexadecimal); pub const GL_MESA_program_binary_formats = @as(c_int, 1); pub const GL_PROGRAM_BINARY_FORMAT_MESA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x875F, .hexadecimal); pub const GL_MESA_resize_buffers = @as(c_int, 1); pub const GL_MESA_shader_integer_functions = @as(c_int, 1); pub const GL_MESA_tile_raster_order = @as(c_int, 1); pub const GL_TILE_RASTER_ORDER_FIXED_MESA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8BB8, .hexadecimal); pub const GL_TILE_RASTER_ORDER_INCREASING_X_MESA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8BB9, .hexadecimal); pub const GL_TILE_RASTER_ORDER_INCREASING_Y_MESA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8BBA, .hexadecimal); pub const GL_MESA_window_pos = @as(c_int, 1); pub const GL_MESA_ycbcr_texture = @as(c_int, 1); pub const GL_UNSIGNED_SHORT_8_8_MESA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85BA, .hexadecimal); pub const GL_UNSIGNED_SHORT_8_8_REV_MESA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85BB, .hexadecimal); pub const GL_YCBCR_MESA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8757, .hexadecimal); pub const GL_NVX_blend_equation_advanced_multi_draw_buffers = @as(c_int, 1); pub const GL_NVX_conditional_render = @as(c_int, 1); pub const GL_NVX_gpu_memory_info = @as(c_int, 1); pub const GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9047, .hexadecimal); pub const GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9048, .hexadecimal); pub const GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9049, .hexadecimal); pub const GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x904A, .hexadecimal); pub const GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x904B, .hexadecimal); pub const GL_NVX_gpu_multicast2 = @as(c_int, 1); pub const GL_UPLOAD_GPU_MASK_NVX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x954A, .hexadecimal); pub const GL_NVX_linked_gpu_multicast = @as(c_int, 1); pub const GL_LGPU_SEPARATE_STORAGE_BIT_NVX = @as(c_int, 0x0800); pub const GL_MAX_LGPU_GPUS_NVX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92BA, .hexadecimal); pub const GL_NVX_progress_fence = @as(c_int, 1); pub const GL_NV_alpha_to_coverage_dither_control = @as(c_int, 1); pub const GL_ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x934D, .hexadecimal); pub const GL_ALPHA_TO_COVERAGE_DITHER_ENABLE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x934E, .hexadecimal); pub const GL_ALPHA_TO_COVERAGE_DITHER_DISABLE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x934F, .hexadecimal); pub const GL_ALPHA_TO_COVERAGE_DITHER_MODE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92BF, .hexadecimal); pub const GL_NV_bindless_multi_draw_indirect = @as(c_int, 1); pub const GL_NV_bindless_multi_draw_indirect_count = @as(c_int, 1); pub const GL_NV_bindless_texture = @as(c_int, 1); pub const GL_NV_blend_equation_advanced = @as(c_int, 1); pub const GL_BLEND_OVERLAP_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9281, .hexadecimal); pub const GL_BLEND_PREMULTIPLIED_SRC_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9280, .hexadecimal); pub const GL_BLUE_NV = @as(c_int, 0x1905); pub const GL_COLORBURN_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x929A, .hexadecimal); pub const GL_COLORDODGE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9299, .hexadecimal); pub const GL_CONJOINT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9284, .hexadecimal); pub const GL_CONTRAST_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92A1, .hexadecimal); pub const GL_DARKEN_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9297, .hexadecimal); pub const GL_DIFFERENCE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x929E, .hexadecimal); pub const GL_DISJOINT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9283, .hexadecimal); pub const GL_DST_ATOP_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x928F, .hexadecimal); pub const GL_DST_IN_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x928B, .hexadecimal); pub const GL_DST_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9287, .hexadecimal); pub const GL_DST_OUT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x928D, .hexadecimal); pub const GL_DST_OVER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9289, .hexadecimal); pub const GL_EXCLUSION_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92A0, .hexadecimal); pub const GL_GREEN_NV = @as(c_int, 0x1904); pub const GL_HARDLIGHT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x929B, .hexadecimal); pub const GL_HARDMIX_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92A9, .hexadecimal); pub const GL_HSL_COLOR_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92AF, .hexadecimal); pub const GL_HSL_HUE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92AD, .hexadecimal); pub const GL_HSL_LUMINOSITY_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92B0, .hexadecimal); pub const GL_HSL_SATURATION_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92AE, .hexadecimal); pub const GL_INVERT_OVG_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92B4, .hexadecimal); pub const GL_INVERT_RGB_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92A3, .hexadecimal); pub const GL_LIGHTEN_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9298, .hexadecimal); pub const GL_LINEARBURN_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92A5, .hexadecimal); pub const GL_LINEARDODGE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92A4, .hexadecimal); pub const GL_LINEARLIGHT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92A7, .hexadecimal); pub const GL_MINUS_CLAMPED_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92B3, .hexadecimal); pub const GL_MINUS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x929F, .hexadecimal); pub const GL_MULTIPLY_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9294, .hexadecimal); pub const GL_OVERLAY_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9296, .hexadecimal); pub const GL_PINLIGHT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92A8, .hexadecimal); pub const GL_PLUS_CLAMPED_ALPHA_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92B2, .hexadecimal); pub const GL_PLUS_CLAMPED_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92B1, .hexadecimal); pub const GL_PLUS_DARKER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9292, .hexadecimal); pub const GL_PLUS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9291, .hexadecimal); pub const GL_RED_NV = @as(c_int, 0x1903); pub const GL_SCREEN_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9295, .hexadecimal); pub const GL_SOFTLIGHT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x929C, .hexadecimal); pub const GL_SRC_ATOP_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x928E, .hexadecimal); pub const GL_SRC_IN_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x928A, .hexadecimal); pub const GL_SRC_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9286, .hexadecimal); pub const GL_SRC_OUT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x928C, .hexadecimal); pub const GL_SRC_OVER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9288, .hexadecimal); pub const GL_UNCORRELATED_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9282, .hexadecimal); pub const GL_VIVIDLIGHT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92A6, .hexadecimal); pub const GL_XOR_NV = @as(c_int, 0x1506); pub const GL_NV_blend_equation_advanced_coherent = @as(c_int, 1); pub const GL_BLEND_ADVANCED_COHERENT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9285, .hexadecimal); pub const GL_NV_blend_minmax_factor = @as(c_int, 1); pub const GL_NV_blend_square = @as(c_int, 1); pub const GL_NV_clip_space_w_scaling = @as(c_int, 1); pub const GL_VIEWPORT_POSITION_W_SCALE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x937C, .hexadecimal); pub const GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x937D, .hexadecimal); pub const GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x937E, .hexadecimal); pub const GL_NV_command_list = @as(c_int, 1); pub const GL_TERMINATE_SEQUENCE_COMMAND_NV = @as(c_int, 0x0000); pub const GL_NOP_COMMAND_NV = @as(c_int, 0x0001); pub const GL_DRAW_ELEMENTS_COMMAND_NV = @as(c_int, 0x0002); pub const GL_DRAW_ARRAYS_COMMAND_NV = @as(c_int, 0x0003); pub const GL_DRAW_ELEMENTS_STRIP_COMMAND_NV = @as(c_int, 0x0004); pub const GL_DRAW_ARRAYS_STRIP_COMMAND_NV = @as(c_int, 0x0005); pub const GL_DRAW_ELEMENTS_INSTANCED_COMMAND_NV = @as(c_int, 0x0006); pub const GL_DRAW_ARRAYS_INSTANCED_COMMAND_NV = @as(c_int, 0x0007); pub const GL_ELEMENT_ADDRESS_COMMAND_NV = @as(c_int, 0x0008); pub const GL_ATTRIBUTE_ADDRESS_COMMAND_NV = @as(c_int, 0x0009); pub const GL_UNIFORM_ADDRESS_COMMAND_NV = @as(c_int, 0x000A); pub const GL_BLEND_COLOR_COMMAND_NV = @as(c_int, 0x000B); pub const GL_STENCIL_REF_COMMAND_NV = @as(c_int, 0x000C); pub const GL_LINE_WIDTH_COMMAND_NV = @as(c_int, 0x000D); pub const GL_POLYGON_OFFSET_COMMAND_NV = @as(c_int, 0x000E); pub const GL_ALPHA_REF_COMMAND_NV = @as(c_int, 0x000F); pub const GL_VIEWPORT_COMMAND_NV = @as(c_int, 0x0010); pub const GL_SCISSOR_COMMAND_NV = @as(c_int, 0x0011); pub const GL_FRONT_FACE_COMMAND_NV = @as(c_int, 0x0012); pub const GL_NV_compute_program5 = @as(c_int, 1); pub const GL_COMPUTE_PROGRAM_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90FB, .hexadecimal); pub const GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90FC, .hexadecimal); pub const GL_NV_compute_shader_derivatives = @as(c_int, 1); pub const GL_NV_conditional_render = @as(c_int, 1); pub const GL_QUERY_WAIT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E13, .hexadecimal); pub const GL_QUERY_NO_WAIT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E14, .hexadecimal); pub const GL_QUERY_BY_REGION_WAIT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E15, .hexadecimal); pub const GL_QUERY_BY_REGION_NO_WAIT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E16, .hexadecimal); pub const GL_NV_conservative_raster = @as(c_int, 1); pub const GL_CONSERVATIVE_RASTERIZATION_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9346, .hexadecimal); pub const GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9347, .hexadecimal); pub const GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9348, .hexadecimal); pub const GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9349, .hexadecimal); pub const GL_NV_conservative_raster_dilate = @as(c_int, 1); pub const GL_CONSERVATIVE_RASTER_DILATE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9379, .hexadecimal); pub const GL_CONSERVATIVE_RASTER_DILATE_RANGE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x937A, .hexadecimal); pub const GL_CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x937B, .hexadecimal); pub const GL_NV_conservative_raster_pre_snap = @as(c_int, 1); pub const GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9550, .hexadecimal); pub const GL_NV_conservative_raster_pre_snap_triangles = @as(c_int, 1); pub const GL_CONSERVATIVE_RASTER_MODE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x954D, .hexadecimal); pub const GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x954E, .hexadecimal); pub const GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x954F, .hexadecimal); pub const GL_NV_conservative_raster_underestimation = @as(c_int, 1); pub const GL_NV_copy_depth_to_color = @as(c_int, 1); pub const GL_DEPTH_STENCIL_TO_RGBA_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x886E, .hexadecimal); pub const GL_DEPTH_STENCIL_TO_BGRA_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x886F, .hexadecimal); pub const GL_NV_copy_image = @as(c_int, 1); pub const GL_NV_deep_texture3D = @as(c_int, 1); pub const GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90D0, .hexadecimal); pub const GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90D1, .hexadecimal); pub const GL_NV_depth_buffer_float = @as(c_int, 1); pub const GL_DEPTH_COMPONENT32F_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DAB, .hexadecimal); pub const GL_DEPTH32F_STENCIL8_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DAC, .hexadecimal); pub const GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DAD, .hexadecimal); pub const GL_DEPTH_BUFFER_FLOAT_MODE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DAF, .hexadecimal); pub const GL_NV_depth_clamp = @as(c_int, 1); pub const GL_DEPTH_CLAMP_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x864F, .hexadecimal); pub const GL_NV_draw_texture = @as(c_int, 1); pub const GL_NV_draw_vulkan_image = @as(c_int, 1); pub const GL_NV_evaluators = @as(c_int, 1); pub const GL_EVAL_2D_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86C0, .hexadecimal); pub const GL_EVAL_TRIANGULAR_2D_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86C1, .hexadecimal); pub const GL_MAP_TESSELLATION_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86C2, .hexadecimal); pub const GL_MAP_ATTRIB_U_ORDER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86C3, .hexadecimal); pub const GL_MAP_ATTRIB_V_ORDER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86C4, .hexadecimal); pub const GL_EVAL_FRACTIONAL_TESSELLATION_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86C5, .hexadecimal); pub const GL_EVAL_VERTEX_ATTRIB0_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86C6, .hexadecimal); pub const GL_EVAL_VERTEX_ATTRIB1_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86C7, .hexadecimal); pub const GL_EVAL_VERTEX_ATTRIB2_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86C8, .hexadecimal); pub const GL_EVAL_VERTEX_ATTRIB3_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86C9, .hexadecimal); pub const GL_EVAL_VERTEX_ATTRIB4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86CA, .hexadecimal); pub const GL_EVAL_VERTEX_ATTRIB5_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86CB, .hexadecimal); pub const GL_EVAL_VERTEX_ATTRIB6_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86CC, .hexadecimal); pub const GL_EVAL_VERTEX_ATTRIB7_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86CD, .hexadecimal); pub const GL_EVAL_VERTEX_ATTRIB8_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86CE, .hexadecimal); pub const GL_EVAL_VERTEX_ATTRIB9_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86CF, .hexadecimal); pub const GL_EVAL_VERTEX_ATTRIB10_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86D0, .hexadecimal); pub const GL_EVAL_VERTEX_ATTRIB11_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86D1, .hexadecimal); pub const GL_EVAL_VERTEX_ATTRIB12_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86D2, .hexadecimal); pub const GL_EVAL_VERTEX_ATTRIB13_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86D3, .hexadecimal); pub const GL_EVAL_VERTEX_ATTRIB14_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86D4, .hexadecimal); pub const GL_EVAL_VERTEX_ATTRIB15_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86D5, .hexadecimal); pub const GL_MAX_MAP_TESSELLATION_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86D6, .hexadecimal); pub const GL_MAX_RATIONAL_EVAL_ORDER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86D7, .hexadecimal); pub const GL_NV_explicit_multisample = @as(c_int, 1); pub const GL_SAMPLE_POSITION_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E50, .hexadecimal); pub const GL_SAMPLE_MASK_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E51, .hexadecimal); pub const GL_SAMPLE_MASK_VALUE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E52, .hexadecimal); pub const GL_TEXTURE_BINDING_RENDERBUFFER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E53, .hexadecimal); pub const GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E54, .hexadecimal); pub const GL_TEXTURE_RENDERBUFFER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E55, .hexadecimal); pub const GL_SAMPLER_RENDERBUFFER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E56, .hexadecimal); pub const GL_INT_SAMPLER_RENDERBUFFER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E57, .hexadecimal); pub const GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E58, .hexadecimal); pub const GL_MAX_SAMPLE_MASK_WORDS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E59, .hexadecimal); pub const GL_NV_fence = @as(c_int, 1); pub const GL_ALL_COMPLETED_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84F2, .hexadecimal); pub const GL_FENCE_STATUS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84F3, .hexadecimal); pub const GL_FENCE_CONDITION_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84F4, .hexadecimal); pub const GL_NV_fill_rectangle = @as(c_int, 1); pub const GL_FILL_RECTANGLE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x933C, .hexadecimal); pub const GL_NV_float_buffer = @as(c_int, 1); pub const GL_FLOAT_R_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8880, .hexadecimal); pub const GL_FLOAT_RG_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8881, .hexadecimal); pub const GL_FLOAT_RGB_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8882, .hexadecimal); pub const GL_FLOAT_RGBA_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8883, .hexadecimal); pub const GL_FLOAT_R16_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8884, .hexadecimal); pub const GL_FLOAT_R32_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8885, .hexadecimal); pub const GL_FLOAT_RG16_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8886, .hexadecimal); pub const GL_FLOAT_RG32_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8887, .hexadecimal); pub const GL_FLOAT_RGB16_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8888, .hexadecimal); pub const GL_FLOAT_RGB32_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8889, .hexadecimal); pub const GL_FLOAT_RGBA16_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x888A, .hexadecimal); pub const GL_FLOAT_RGBA32_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x888B, .hexadecimal); pub const GL_TEXTURE_FLOAT_COMPONENTS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x888C, .hexadecimal); pub const GL_FLOAT_CLEAR_COLOR_VALUE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x888D, .hexadecimal); pub const GL_FLOAT_RGBA_MODE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x888E, .hexadecimal); pub const GL_NV_fog_distance = @as(c_int, 1); pub const GL_FOG_DISTANCE_MODE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x855A, .hexadecimal); pub const GL_EYE_RADIAL_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x855B, .hexadecimal); pub const GL_EYE_PLANE_ABSOLUTE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x855C, .hexadecimal); pub const GL_NV_fragment_coverage_to_color = @as(c_int, 1); pub const GL_FRAGMENT_COVERAGE_TO_COLOR_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92DD, .hexadecimal); pub const GL_FRAGMENT_COVERAGE_COLOR_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92DE, .hexadecimal); pub const GL_NV_fragment_program = @as(c_int, 1); pub const GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8868, .hexadecimal); pub const GL_FRAGMENT_PROGRAM_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8870, .hexadecimal); pub const GL_MAX_TEXTURE_COORDS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8871, .hexadecimal); pub const GL_MAX_TEXTURE_IMAGE_UNITS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8872, .hexadecimal); pub const GL_FRAGMENT_PROGRAM_BINDING_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8873, .hexadecimal); pub const GL_PROGRAM_ERROR_STRING_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8874, .hexadecimal); pub const GL_NV_fragment_program2 = @as(c_int, 1); pub const GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88F4, .hexadecimal); pub const GL_MAX_PROGRAM_CALL_DEPTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88F5, .hexadecimal); pub const GL_MAX_PROGRAM_IF_DEPTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88F6, .hexadecimal); pub const GL_MAX_PROGRAM_LOOP_DEPTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88F7, .hexadecimal); pub const GL_MAX_PROGRAM_LOOP_COUNT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88F8, .hexadecimal); pub const GL_NV_fragment_program4 = @as(c_int, 1); pub const GL_NV_fragment_program_option = @as(c_int, 1); pub const GL_NV_fragment_shader_barycentric = @as(c_int, 1); pub const GL_NV_fragment_shader_interlock = @as(c_int, 1); pub const GL_NV_framebuffer_mixed_samples = @as(c_int, 1); pub const GL_COVERAGE_MODULATION_TABLE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9331, .hexadecimal); pub const GL_COLOR_SAMPLES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E20, .hexadecimal); pub const GL_DEPTH_SAMPLES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x932D, .hexadecimal); pub const GL_STENCIL_SAMPLES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x932E, .hexadecimal); pub const GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x932F, .hexadecimal); pub const GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9330, .hexadecimal); pub const GL_COVERAGE_MODULATION_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9332, .hexadecimal); pub const GL_COVERAGE_MODULATION_TABLE_SIZE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9333, .hexadecimal); pub const GL_NV_framebuffer_multisample_coverage = @as(c_int, 1); pub const GL_RENDERBUFFER_COVERAGE_SAMPLES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8CAB, .hexadecimal); pub const GL_RENDERBUFFER_COLOR_SAMPLES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E10, .hexadecimal); pub const GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E11, .hexadecimal); pub const GL_MULTISAMPLE_COVERAGE_MODES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E12, .hexadecimal); pub const GL_NV_geometry_program4 = @as(c_int, 1); pub const GL_GEOMETRY_PROGRAM_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C26, .hexadecimal); pub const GL_MAX_PROGRAM_OUTPUT_VERTICES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C27, .hexadecimal); pub const GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C28, .hexadecimal); pub const GL_NV_geometry_shader4 = @as(c_int, 1); pub const GL_NV_geometry_shader_passthrough = @as(c_int, 1); pub const GL_NV_gpu_multicast = @as(c_int, 1); pub const GL_PER_GPU_STORAGE_BIT_NV = @as(c_int, 0x0800); pub const GL_MULTICAST_GPUS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92BA, .hexadecimal); pub const GL_RENDER_GPU_MASK_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9558, .hexadecimal); pub const GL_PER_GPU_STORAGE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9548, .hexadecimal); pub const GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9549, .hexadecimal); pub const GL_NV_gpu_program4 = @as(c_int, 1); pub const GL_MIN_PROGRAM_TEXEL_OFFSET_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8904, .hexadecimal); pub const GL_MAX_PROGRAM_TEXEL_OFFSET_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8905, .hexadecimal); pub const GL_PROGRAM_ATTRIB_COMPONENTS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8906, .hexadecimal); pub const GL_PROGRAM_RESULT_COMPONENTS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8907, .hexadecimal); pub const GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8908, .hexadecimal); pub const GL_MAX_PROGRAM_RESULT_COMPONENTS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8909, .hexadecimal); pub const GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DA5, .hexadecimal); pub const GL_MAX_PROGRAM_GENERIC_RESULTS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DA6, .hexadecimal); pub const GL_NV_gpu_program5 = @as(c_int, 1); pub const GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E5A, .hexadecimal); pub const GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E5B, .hexadecimal); pub const GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E5C, .hexadecimal); pub const GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E5D, .hexadecimal); pub const GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E5E, .hexadecimal); pub const GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E5F, .hexadecimal); pub const GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F44, .hexadecimal); pub const GL_MAX_PROGRAM_SUBROUTINE_NUM_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F45, .hexadecimal); pub const GL_NV_gpu_program5_mem_extended = @as(c_int, 1); pub const GL_NV_gpu_shader5 = @as(c_int, 1); pub const GL_NV_half_float = @as(c_int, 1); pub const GL_HALF_FLOAT_NV = @as(c_int, 0x140B); pub const GL_NV_internalformat_sample_query = @as(c_int, 1); pub const GL_MULTISAMPLES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9371, .hexadecimal); pub const GL_SUPERSAMPLE_SCALE_X_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9372, .hexadecimal); pub const GL_SUPERSAMPLE_SCALE_Y_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9373, .hexadecimal); pub const GL_CONFORMANT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9374, .hexadecimal); pub const GL_NV_light_max_exponent = @as(c_int, 1); pub const GL_MAX_SHININESS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8504, .hexadecimal); pub const GL_MAX_SPOT_EXPONENT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8505, .hexadecimal); pub const GL_NV_memory_attachment = @as(c_int, 1); pub const GL_ATTACHED_MEMORY_OBJECT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x95A4, .hexadecimal); pub const GL_ATTACHED_MEMORY_OFFSET_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x95A5, .hexadecimal); pub const GL_MEMORY_ATTACHABLE_ALIGNMENT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x95A6, .hexadecimal); pub const GL_MEMORY_ATTACHABLE_SIZE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x95A7, .hexadecimal); pub const GL_MEMORY_ATTACHABLE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x95A8, .hexadecimal); pub const GL_DETACHED_MEMORY_INCARNATION_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x95A9, .hexadecimal); pub const GL_DETACHED_TEXTURES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x95AA, .hexadecimal); pub const GL_DETACHED_BUFFERS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x95AB, .hexadecimal); pub const GL_MAX_DETACHED_TEXTURES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x95AC, .hexadecimal); pub const GL_MAX_DETACHED_BUFFERS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x95AD, .hexadecimal); pub const GL_NV_mesh_shader = @as(c_int, 1); pub const GL_MESH_SHADER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9559, .hexadecimal); pub const GL_TASK_SHADER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x955A, .hexadecimal); pub const GL_MAX_MESH_UNIFORM_BLOCKS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E60, .hexadecimal); pub const GL_MAX_MESH_TEXTURE_IMAGE_UNITS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E61, .hexadecimal); pub const GL_MAX_MESH_IMAGE_UNIFORMS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E62, .hexadecimal); pub const GL_MAX_MESH_UNIFORM_COMPONENTS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E63, .hexadecimal); pub const GL_MAX_MESH_ATOMIC_COUNTER_BUFFERS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E64, .hexadecimal); pub const GL_MAX_MESH_ATOMIC_COUNTERS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E65, .hexadecimal); pub const GL_MAX_MESH_SHADER_STORAGE_BLOCKS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E66, .hexadecimal); pub const GL_MAX_COMBINED_MESH_UNIFORM_COMPONENTS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E67, .hexadecimal); pub const GL_MAX_TASK_UNIFORM_BLOCKS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E68, .hexadecimal); pub const GL_MAX_TASK_TEXTURE_IMAGE_UNITS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E69, .hexadecimal); pub const GL_MAX_TASK_IMAGE_UNIFORMS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E6A, .hexadecimal); pub const GL_MAX_TASK_UNIFORM_COMPONENTS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E6B, .hexadecimal); pub const GL_MAX_TASK_ATOMIC_COUNTER_BUFFERS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E6C, .hexadecimal); pub const GL_MAX_TASK_ATOMIC_COUNTERS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E6D, .hexadecimal); pub const GL_MAX_TASK_SHADER_STORAGE_BLOCKS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E6E, .hexadecimal); pub const GL_MAX_COMBINED_TASK_UNIFORM_COMPONENTS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E6F, .hexadecimal); pub const GL_MAX_MESH_WORK_GROUP_INVOCATIONS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x95A2, .hexadecimal); pub const GL_MAX_TASK_WORK_GROUP_INVOCATIONS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x95A3, .hexadecimal); pub const GL_MAX_MESH_TOTAL_MEMORY_SIZE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9536, .hexadecimal); pub const GL_MAX_TASK_TOTAL_MEMORY_SIZE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9537, .hexadecimal); pub const GL_MAX_MESH_OUTPUT_VERTICES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9538, .hexadecimal); pub const GL_MAX_MESH_OUTPUT_PRIMITIVES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9539, .hexadecimal); pub const GL_MAX_TASK_OUTPUT_COUNT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x953A, .hexadecimal); pub const GL_MAX_DRAW_MESH_TASKS_COUNT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x953D, .hexadecimal); pub const GL_MAX_MESH_VIEWS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9557, .hexadecimal); pub const GL_MESH_OUTPUT_PER_VERTEX_GRANULARITY_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92DF, .hexadecimal); pub const GL_MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9543, .hexadecimal); pub const GL_MAX_MESH_WORK_GROUP_SIZE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x953B, .hexadecimal); pub const GL_MAX_TASK_WORK_GROUP_SIZE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x953C, .hexadecimal); pub const GL_MESH_WORK_GROUP_SIZE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x953E, .hexadecimal); pub const GL_TASK_WORK_GROUP_SIZE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x953F, .hexadecimal); pub const GL_MESH_VERTICES_OUT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9579, .hexadecimal); pub const GL_MESH_PRIMITIVES_OUT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x957A, .hexadecimal); pub const GL_MESH_OUTPUT_TYPE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x957B, .hexadecimal); pub const GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x959C, .hexadecimal); pub const GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x959D, .hexadecimal); pub const GL_REFERENCED_BY_MESH_SHADER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x95A0, .hexadecimal); pub const GL_REFERENCED_BY_TASK_SHADER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x95A1, .hexadecimal); pub const GL_MESH_SHADER_BIT_NV = @as(c_int, 0x00000040); pub const GL_TASK_SHADER_BIT_NV = @as(c_int, 0x00000080); pub const GL_MESH_SUBROUTINE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x957C, .hexadecimal); pub const GL_TASK_SUBROUTINE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x957D, .hexadecimal); pub const GL_MESH_SUBROUTINE_UNIFORM_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x957E, .hexadecimal); pub const GL_TASK_SUBROUTINE_UNIFORM_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x957F, .hexadecimal); pub const GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x959E, .hexadecimal); pub const GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x959F, .hexadecimal); pub const GL_NV_multisample_coverage = @as(c_int, 1); pub const GL_NV_multisample_filter_hint = @as(c_int, 1); pub const GL_MULTISAMPLE_FILTER_HINT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8534, .hexadecimal); pub const GL_NV_occlusion_query = @as(c_int, 1); pub const GL_PIXEL_COUNTER_BITS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8864, .hexadecimal); pub const GL_CURRENT_OCCLUSION_QUERY_ID_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8865, .hexadecimal); pub const GL_PIXEL_COUNT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8866, .hexadecimal); pub const GL_PIXEL_COUNT_AVAILABLE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8867, .hexadecimal); pub const GL_NV_packed_depth_stencil = @as(c_int, 1); pub const GL_DEPTH_STENCIL_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84F9, .hexadecimal); pub const GL_UNSIGNED_INT_24_8_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84FA, .hexadecimal); pub const GL_NV_parameter_buffer_object = @as(c_int, 1); pub const GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DA0, .hexadecimal); pub const GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DA1, .hexadecimal); pub const GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DA2, .hexadecimal); pub const GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DA3, .hexadecimal); pub const GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DA4, .hexadecimal); pub const GL_NV_parameter_buffer_object2 = @as(c_int, 1); pub const GL_NV_path_rendering = @as(c_int, 1); pub const GL_PATH_FORMAT_SVG_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9070, .hexadecimal); pub const GL_PATH_FORMAT_PS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9071, .hexadecimal); pub const GL_STANDARD_FONT_NAME_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9072, .hexadecimal); pub const GL_SYSTEM_FONT_NAME_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9073, .hexadecimal); pub const GL_FILE_NAME_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9074, .hexadecimal); pub const GL_PATH_STROKE_WIDTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9075, .hexadecimal); pub const GL_PATH_END_CAPS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9076, .hexadecimal); pub const GL_PATH_INITIAL_END_CAP_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9077, .hexadecimal); pub const GL_PATH_TERMINAL_END_CAP_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9078, .hexadecimal); pub const GL_PATH_JOIN_STYLE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9079, .hexadecimal); pub const GL_PATH_MITER_LIMIT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x907A, .hexadecimal); pub const GL_PATH_DASH_CAPS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x907B, .hexadecimal); pub const GL_PATH_INITIAL_DASH_CAP_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x907C, .hexadecimal); pub const GL_PATH_TERMINAL_DASH_CAP_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x907D, .hexadecimal); pub const GL_PATH_DASH_OFFSET_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x907E, .hexadecimal); pub const GL_PATH_CLIENT_LENGTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x907F, .hexadecimal); pub const GL_PATH_FILL_MODE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9080, .hexadecimal); pub const GL_PATH_FILL_MASK_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9081, .hexadecimal); pub const GL_PATH_FILL_COVER_MODE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9082, .hexadecimal); pub const GL_PATH_STROKE_COVER_MODE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9083, .hexadecimal); pub const GL_PATH_STROKE_MASK_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9084, .hexadecimal); pub const GL_COUNT_UP_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9088, .hexadecimal); pub const GL_COUNT_DOWN_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9089, .hexadecimal); pub const GL_PATH_OBJECT_BOUNDING_BOX_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x908A, .hexadecimal); pub const GL_CONVEX_HULL_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x908B, .hexadecimal); pub const GL_BOUNDING_BOX_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x908D, .hexadecimal); pub const GL_TRANSLATE_X_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x908E, .hexadecimal); pub const GL_TRANSLATE_Y_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x908F, .hexadecimal); pub const GL_TRANSLATE_2D_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9090, .hexadecimal); pub const GL_TRANSLATE_3D_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9091, .hexadecimal); pub const GL_AFFINE_2D_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9092, .hexadecimal); pub const GL_AFFINE_3D_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9094, .hexadecimal); pub const GL_TRANSPOSE_AFFINE_2D_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9096, .hexadecimal); pub const GL_TRANSPOSE_AFFINE_3D_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9098, .hexadecimal); pub const GL_UTF8_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x909A, .hexadecimal); pub const GL_UTF16_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x909B, .hexadecimal); pub const GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x909C, .hexadecimal); pub const GL_PATH_COMMAND_COUNT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x909D, .hexadecimal); pub const GL_PATH_COORD_COUNT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x909E, .hexadecimal); pub const GL_PATH_DASH_ARRAY_COUNT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x909F, .hexadecimal); pub const GL_PATH_COMPUTED_LENGTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90A0, .hexadecimal); pub const GL_PATH_FILL_BOUNDING_BOX_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90A1, .hexadecimal); pub const GL_PATH_STROKE_BOUNDING_BOX_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90A2, .hexadecimal); pub const GL_SQUARE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90A3, .hexadecimal); pub const GL_ROUND_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90A4, .hexadecimal); pub const GL_TRIANGULAR_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90A5, .hexadecimal); pub const GL_BEVEL_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90A6, .hexadecimal); pub const GL_MITER_REVERT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90A7, .hexadecimal); pub const GL_MITER_TRUNCATE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90A8, .hexadecimal); pub const GL_SKIP_MISSING_GLYPH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90A9, .hexadecimal); pub const GL_USE_MISSING_GLYPH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90AA, .hexadecimal); pub const GL_PATH_ERROR_POSITION_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90AB, .hexadecimal); pub const GL_ACCUM_ADJACENT_PAIRS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90AD, .hexadecimal); pub const GL_ADJACENT_PAIRS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90AE, .hexadecimal); pub const GL_FIRST_TO_REST_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90AF, .hexadecimal); pub const GL_PATH_GEN_MODE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90B0, .hexadecimal); pub const GL_PATH_GEN_COEFF_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90B1, .hexadecimal); pub const GL_PATH_GEN_COMPONENTS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90B3, .hexadecimal); pub const GL_PATH_STENCIL_FUNC_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90B7, .hexadecimal); pub const GL_PATH_STENCIL_REF_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90B8, .hexadecimal); pub const GL_PATH_STENCIL_VALUE_MASK_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90B9, .hexadecimal); pub const GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90BD, .hexadecimal); pub const GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90BE, .hexadecimal); pub const GL_PATH_COVER_DEPTH_FUNC_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90BF, .hexadecimal); pub const GL_PATH_DASH_OFFSET_RESET_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90B4, .hexadecimal); pub const GL_MOVE_TO_RESETS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90B5, .hexadecimal); pub const GL_MOVE_TO_CONTINUES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90B6, .hexadecimal); pub const GL_CLOSE_PATH_NV = @as(c_int, 0x00); pub const GL_MOVE_TO_NV = @as(c_int, 0x02); pub const GL_RELATIVE_MOVE_TO_NV = @as(c_int, 0x03); pub const GL_LINE_TO_NV = @as(c_int, 0x04); pub const GL_RELATIVE_LINE_TO_NV = @as(c_int, 0x05); pub const GL_HORIZONTAL_LINE_TO_NV = @as(c_int, 0x06); pub const GL_RELATIVE_HORIZONTAL_LINE_TO_NV = @as(c_int, 0x07); pub const GL_VERTICAL_LINE_TO_NV = @as(c_int, 0x08); pub const GL_RELATIVE_VERTICAL_LINE_TO_NV = @as(c_int, 0x09); pub const GL_QUADRATIC_CURVE_TO_NV = @as(c_int, 0x0A); pub const GL_RELATIVE_QUADRATIC_CURVE_TO_NV = @as(c_int, 0x0B); pub const GL_CUBIC_CURVE_TO_NV = @as(c_int, 0x0C); pub const GL_RELATIVE_CUBIC_CURVE_TO_NV = @as(c_int, 0x0D); pub const GL_SMOOTH_QUADRATIC_CURVE_TO_NV = @as(c_int, 0x0E); pub const GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV = @as(c_int, 0x0F); pub const GL_SMOOTH_CUBIC_CURVE_TO_NV = @as(c_int, 0x10); pub const GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV = @as(c_int, 0x11); pub const GL_SMALL_CCW_ARC_TO_NV = @as(c_int, 0x12); pub const GL_RELATIVE_SMALL_CCW_ARC_TO_NV = @as(c_int, 0x13); pub const GL_SMALL_CW_ARC_TO_NV = @as(c_int, 0x14); pub const GL_RELATIVE_SMALL_CW_ARC_TO_NV = @as(c_int, 0x15); pub const GL_LARGE_CCW_ARC_TO_NV = @as(c_int, 0x16); pub const GL_RELATIVE_LARGE_CCW_ARC_TO_NV = @as(c_int, 0x17); pub const GL_LARGE_CW_ARC_TO_NV = @as(c_int, 0x18); pub const GL_RELATIVE_LARGE_CW_ARC_TO_NV = @as(c_int, 0x19); pub const GL_RESTART_PATH_NV = @as(c_int, 0xF0); pub const GL_DUP_FIRST_CUBIC_CURVE_TO_NV = @as(c_int, 0xF2); pub const GL_DUP_LAST_CUBIC_CURVE_TO_NV = @as(c_int, 0xF4); pub const GL_RECT_NV = @as(c_int, 0xF6); pub const GL_CIRCULAR_CCW_ARC_TO_NV = @as(c_int, 0xF8); pub const GL_CIRCULAR_CW_ARC_TO_NV = @as(c_int, 0xFA); pub const GL_CIRCULAR_TANGENT_ARC_TO_NV = @as(c_int, 0xFC); pub const GL_ARC_TO_NV = @as(c_int, 0xFE); pub const GL_RELATIVE_ARC_TO_NV = @as(c_int, 0xFF); pub const GL_BOLD_BIT_NV = @as(c_int, 0x01); pub const GL_ITALIC_BIT_NV = @as(c_int, 0x02); pub const GL_GLYPH_WIDTH_BIT_NV = @as(c_int, 0x01); pub const GL_GLYPH_HEIGHT_BIT_NV = @as(c_int, 0x02); pub const GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV = @as(c_int, 0x04); pub const GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV = @as(c_int, 0x08); pub const GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV = @as(c_int, 0x10); pub const GL_GLYPH_VERTICAL_BEARING_X_BIT_NV = @as(c_int, 0x20); pub const GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV = @as(c_int, 0x40); pub const GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV = @as(c_int, 0x80); pub const GL_GLYPH_HAS_KERNING_BIT_NV = @as(c_int, 0x100); pub const GL_FONT_X_MIN_BOUNDS_BIT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00010000, .hexadecimal); pub const GL_FONT_Y_MIN_BOUNDS_BIT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00020000, .hexadecimal); pub const GL_FONT_X_MAX_BOUNDS_BIT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00040000, .hexadecimal); pub const GL_FONT_Y_MAX_BOUNDS_BIT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00080000, .hexadecimal); pub const GL_FONT_UNITS_PER_EM_BIT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00100000, .hexadecimal); pub const GL_FONT_ASCENDER_BIT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00200000, .hexadecimal); pub const GL_FONT_DESCENDER_BIT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00400000, .hexadecimal); pub const GL_FONT_HEIGHT_BIT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00800000, .hexadecimal); pub const GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x01000000, .hexadecimal); pub const GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x02000000, .hexadecimal); pub const GL_FONT_UNDERLINE_POSITION_BIT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x04000000, .hexadecimal); pub const GL_FONT_UNDERLINE_THICKNESS_BIT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x08000000, .hexadecimal); pub const GL_FONT_HAS_KERNING_BIT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x10000000, .hexadecimal); pub const GL_ROUNDED_RECT_NV = @as(c_int, 0xE8); pub const GL_RELATIVE_ROUNDED_RECT_NV = @as(c_int, 0xE9); pub const GL_ROUNDED_RECT2_NV = @as(c_int, 0xEA); pub const GL_RELATIVE_ROUNDED_RECT2_NV = @as(c_int, 0xEB); pub const GL_ROUNDED_RECT4_NV = @as(c_int, 0xEC); pub const GL_RELATIVE_ROUNDED_RECT4_NV = @as(c_int, 0xED); pub const GL_ROUNDED_RECT8_NV = @as(c_int, 0xEE); pub const GL_RELATIVE_ROUNDED_RECT8_NV = @as(c_int, 0xEF); pub const GL_RELATIVE_RECT_NV = @as(c_int, 0xF7); pub const GL_FONT_GLYPHS_AVAILABLE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9368, .hexadecimal); pub const GL_FONT_TARGET_UNAVAILABLE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9369, .hexadecimal); pub const GL_FONT_UNAVAILABLE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x936A, .hexadecimal); pub const GL_FONT_UNINTELLIGIBLE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x936B, .hexadecimal); pub const GL_CONIC_CURVE_TO_NV = @as(c_int, 0x1A); pub const GL_RELATIVE_CONIC_CURVE_TO_NV = @as(c_int, 0x1B); pub const GL_FONT_NUM_GLYPH_INDICES_BIT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x20000000, .hexadecimal); pub const GL_STANDARD_FONT_FORMAT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x936C, .hexadecimal); pub const GL_2_BYTES_NV = @as(c_int, 0x1407); pub const GL_3_BYTES_NV = @as(c_int, 0x1408); pub const GL_4_BYTES_NV = @as(c_int, 0x1409); pub const GL_EYE_LINEAR_NV = @as(c_int, 0x2400); pub const GL_OBJECT_LINEAR_NV = @as(c_int, 0x2401); pub const GL_CONSTANT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8576, .hexadecimal); pub const GL_PATH_FOG_GEN_MODE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90AC, .hexadecimal); pub const GL_PRIMARY_COLOR_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x852C, .hexadecimal); pub const GL_SECONDARY_COLOR_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x852D, .hexadecimal); pub const GL_PATH_GEN_COLOR_FORMAT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x90B2, .hexadecimal); pub const GL_PATH_PROJECTION_NV = @as(c_int, 0x1701); pub const GL_PATH_MODELVIEW_NV = @as(c_int, 0x1700); pub const GL_PATH_MODELVIEW_STACK_DEPTH_NV = @as(c_int, 0x0BA3); pub const GL_PATH_MODELVIEW_MATRIX_NV = @as(c_int, 0x0BA6); pub const GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV = @as(c_int, 0x0D36); pub const GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E3, .hexadecimal); pub const GL_PATH_PROJECTION_STACK_DEPTH_NV = @as(c_int, 0x0BA4); pub const GL_PATH_PROJECTION_MATRIX_NV = @as(c_int, 0x0BA7); pub const GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV = @as(c_int, 0x0D38); pub const GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84E4, .hexadecimal); pub const GL_FRAGMENT_INPUT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x936D, .hexadecimal); pub const GL_NV_path_rendering_shared_edge = @as(c_int, 1); pub const GL_SHARED_EDGE_NV = @as(c_int, 0xC0); pub const GL_NV_pixel_data_range = @as(c_int, 1); pub const GL_WRITE_PIXEL_DATA_RANGE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8878, .hexadecimal); pub const GL_READ_PIXEL_DATA_RANGE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8879, .hexadecimal); pub const GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x887A, .hexadecimal); pub const GL_READ_PIXEL_DATA_RANGE_LENGTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x887B, .hexadecimal); pub const GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x887C, .hexadecimal); pub const GL_READ_PIXEL_DATA_RANGE_POINTER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x887D, .hexadecimal); pub const GL_NV_point_sprite = @as(c_int, 1); pub const GL_POINT_SPRITE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8861, .hexadecimal); pub const GL_COORD_REPLACE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8862, .hexadecimal); pub const GL_POINT_SPRITE_R_MODE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8863, .hexadecimal); pub const GL_NV_present_video = @as(c_int, 1); pub const GL_FRAME_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E26, .hexadecimal); pub const GL_FIELDS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E27, .hexadecimal); pub const GL_CURRENT_TIME_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E28, .hexadecimal); pub const GL_NUM_FILL_STREAMS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E29, .hexadecimal); pub const GL_PRESENT_TIME_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E2A, .hexadecimal); pub const GL_PRESENT_DURATION_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E2B, .hexadecimal); pub const GL_NV_primitive_restart = @as(c_int, 1); pub const GL_PRIMITIVE_RESTART_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8558, .hexadecimal); pub const GL_PRIMITIVE_RESTART_INDEX_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8559, .hexadecimal); pub const GL_NV_query_resource = @as(c_int, 1); pub const GL_QUERY_RESOURCE_TYPE_VIDMEM_ALLOC_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9540, .hexadecimal); pub const GL_QUERY_RESOURCE_MEMTYPE_VIDMEM_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9542, .hexadecimal); pub const GL_QUERY_RESOURCE_SYS_RESERVED_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9544, .hexadecimal); pub const GL_QUERY_RESOURCE_TEXTURE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9545, .hexadecimal); pub const GL_QUERY_RESOURCE_RENDERBUFFER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9546, .hexadecimal); pub const GL_QUERY_RESOURCE_BUFFEROBJECT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9547, .hexadecimal); pub const GL_NV_query_resource_tag = @as(c_int, 1); pub const GL_NV_register_combiners = @as(c_int, 1); pub const GL_REGISTER_COMBINERS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8522, .hexadecimal); pub const GL_VARIABLE_A_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8523, .hexadecimal); pub const GL_VARIABLE_B_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8524, .hexadecimal); pub const GL_VARIABLE_C_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8525, .hexadecimal); pub const GL_VARIABLE_D_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8526, .hexadecimal); pub const GL_VARIABLE_E_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8527, .hexadecimal); pub const GL_VARIABLE_F_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8528, .hexadecimal); pub const GL_VARIABLE_G_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8529, .hexadecimal); pub const GL_CONSTANT_COLOR0_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x852A, .hexadecimal); pub const GL_CONSTANT_COLOR1_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x852B, .hexadecimal); pub const GL_SPARE0_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x852E, .hexadecimal); pub const GL_SPARE1_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x852F, .hexadecimal); pub const GL_DISCARD_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8530, .hexadecimal); pub const GL_E_TIMES_F_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8531, .hexadecimal); pub const GL_SPARE0_PLUS_SECONDARY_COLOR_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8532, .hexadecimal); pub const GL_UNSIGNED_IDENTITY_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8536, .hexadecimal); pub const GL_UNSIGNED_INVERT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8537, .hexadecimal); pub const GL_EXPAND_NORMAL_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8538, .hexadecimal); pub const GL_EXPAND_NEGATE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8539, .hexadecimal); pub const GL_HALF_BIAS_NORMAL_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x853A, .hexadecimal); pub const GL_HALF_BIAS_NEGATE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x853B, .hexadecimal); pub const GL_SIGNED_IDENTITY_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x853C, .hexadecimal); pub const GL_SIGNED_NEGATE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x853D, .hexadecimal); pub const GL_SCALE_BY_TWO_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x853E, .hexadecimal); pub const GL_SCALE_BY_FOUR_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x853F, .hexadecimal); pub const GL_SCALE_BY_ONE_HALF_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8540, .hexadecimal); pub const GL_BIAS_BY_NEGATIVE_ONE_HALF_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8541, .hexadecimal); pub const GL_COMBINER_INPUT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8542, .hexadecimal); pub const GL_COMBINER_MAPPING_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8543, .hexadecimal); pub const GL_COMBINER_COMPONENT_USAGE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8544, .hexadecimal); pub const GL_COMBINER_AB_DOT_PRODUCT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8545, .hexadecimal); pub const GL_COMBINER_CD_DOT_PRODUCT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8546, .hexadecimal); pub const GL_COMBINER_MUX_SUM_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8547, .hexadecimal); pub const GL_COMBINER_SCALE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8548, .hexadecimal); pub const GL_COMBINER_BIAS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8549, .hexadecimal); pub const GL_COMBINER_AB_OUTPUT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x854A, .hexadecimal); pub const GL_COMBINER_CD_OUTPUT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x854B, .hexadecimal); pub const GL_COMBINER_SUM_OUTPUT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x854C, .hexadecimal); pub const GL_MAX_GENERAL_COMBINERS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x854D, .hexadecimal); pub const GL_NUM_GENERAL_COMBINERS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x854E, .hexadecimal); pub const GL_COLOR_SUM_CLAMP_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x854F, .hexadecimal); pub const GL_COMBINER0_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8550, .hexadecimal); pub const GL_COMBINER1_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8551, .hexadecimal); pub const GL_COMBINER2_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8552, .hexadecimal); pub const GL_COMBINER3_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8553, .hexadecimal); pub const GL_COMBINER4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8554, .hexadecimal); pub const GL_COMBINER5_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8555, .hexadecimal); pub const GL_COMBINER6_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8556, .hexadecimal); pub const GL_COMBINER7_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8557, .hexadecimal); pub const GL_NV_register_combiners2 = @as(c_int, 1); pub const GL_PER_STAGE_CONSTANTS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8535, .hexadecimal); pub const GL_NV_representative_fragment_test = @as(c_int, 1); pub const GL_REPRESENTATIVE_FRAGMENT_TEST_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x937F, .hexadecimal); pub const GL_NV_robustness_video_memory_purge = @as(c_int, 1); pub const GL_PURGED_CONTEXT_RESET_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x92BB, .hexadecimal); pub const GL_NV_sample_locations = @as(c_int, 1); pub const GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x933D, .hexadecimal); pub const GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x933E, .hexadecimal); pub const GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x933F, .hexadecimal); pub const GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9340, .hexadecimal); pub const GL_SAMPLE_LOCATION_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E50, .hexadecimal); pub const GL_PROGRAMMABLE_SAMPLE_LOCATION_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9341, .hexadecimal); pub const GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9342, .hexadecimal); pub const GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9343, .hexadecimal); pub const GL_NV_sample_mask_override_coverage = @as(c_int, 1); pub const GL_NV_scissor_exclusive = @as(c_int, 1); pub const GL_SCISSOR_TEST_EXCLUSIVE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9555, .hexadecimal); pub const GL_SCISSOR_BOX_EXCLUSIVE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9556, .hexadecimal); pub const GL_NV_shader_atomic_counters = @as(c_int, 1); pub const GL_NV_shader_atomic_float = @as(c_int, 1); pub const GL_NV_shader_atomic_float64 = @as(c_int, 1); pub const GL_NV_shader_atomic_fp16_vector = @as(c_int, 1); pub const GL_NV_shader_atomic_int64 = @as(c_int, 1); pub const GL_NV_shader_buffer_load = @as(c_int, 1); pub const GL_BUFFER_GPU_ADDRESS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F1D, .hexadecimal); pub const GL_GPU_ADDRESS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F34, .hexadecimal); pub const GL_MAX_SHADER_BUFFER_ADDRESS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F35, .hexadecimal); pub const GL_NV_shader_buffer_store = @as(c_int, 1); pub const GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV = @as(c_int, 0x00000010); pub const GL_NV_shader_storage_buffer_object = @as(c_int, 1); pub const GL_NV_shader_subgroup_partitioned = @as(c_int, 1); pub const GL_SUBGROUP_FEATURE_PARTITIONED_BIT_NV = @as(c_int, 0x00000100); pub const GL_NV_shader_texture_footprint = @as(c_int, 1); pub const GL_NV_shader_thread_group = @as(c_int, 1); pub const GL_WARP_SIZE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9339, .hexadecimal); pub const GL_WARPS_PER_SM_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x933A, .hexadecimal); pub const GL_SM_COUNT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x933B, .hexadecimal); pub const GL_NV_shader_thread_shuffle = @as(c_int, 1); pub const GL_NV_shading_rate_image = @as(c_int, 1); pub const GL_SHADING_RATE_IMAGE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9563, .hexadecimal); pub const GL_SHADING_RATE_NO_INVOCATIONS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9564, .hexadecimal); pub const GL_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9565, .hexadecimal); pub const GL_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9566, .hexadecimal); pub const GL_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9567, .hexadecimal); pub const GL_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9568, .hexadecimal); pub const GL_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9569, .hexadecimal); pub const GL_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x956A, .hexadecimal); pub const GL_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x956B, .hexadecimal); pub const GL_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x956C, .hexadecimal); pub const GL_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x956D, .hexadecimal); pub const GL_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x956E, .hexadecimal); pub const GL_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x956F, .hexadecimal); pub const GL_SHADING_RATE_IMAGE_BINDING_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x955B, .hexadecimal); pub const GL_SHADING_RATE_IMAGE_TEXEL_WIDTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x955C, .hexadecimal); pub const GL_SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x955D, .hexadecimal); pub const GL_SHADING_RATE_IMAGE_PALETTE_SIZE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x955E, .hexadecimal); pub const GL_MAX_COARSE_FRAGMENT_SAMPLES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x955F, .hexadecimal); pub const GL_SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x95AE, .hexadecimal); pub const GL_SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x95AF, .hexadecimal); pub const GL_SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x95B0, .hexadecimal); pub const GL_NV_stereo_view_rendering = @as(c_int, 1); pub const GL_NV_tessellation_program5 = @as(c_int, 1); pub const GL_MAX_PROGRAM_PATCH_ATTRIBS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86D8, .hexadecimal); pub const GL_TESS_CONTROL_PROGRAM_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x891E, .hexadecimal); pub const GL_TESS_EVALUATION_PROGRAM_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x891F, .hexadecimal); pub const GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C74, .hexadecimal); pub const GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C75, .hexadecimal); pub const GL_NV_texgen_emboss = @as(c_int, 1); pub const GL_EMBOSS_LIGHT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x855D, .hexadecimal); pub const GL_EMBOSS_CONSTANT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x855E, .hexadecimal); pub const GL_EMBOSS_MAP_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x855F, .hexadecimal); pub const GL_NV_texgen_reflection = @as(c_int, 1); pub const GL_NORMAL_MAP_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8511, .hexadecimal); pub const GL_REFLECTION_MAP_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8512, .hexadecimal); pub const GL_NV_texture_barrier = @as(c_int, 1); pub const GL_NV_texture_compression_vtc = @as(c_int, 1); pub const GL_NV_texture_env_combine4 = @as(c_int, 1); pub const GL_COMBINE4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8503, .hexadecimal); pub const GL_SOURCE3_RGB_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8583, .hexadecimal); pub const GL_SOURCE3_ALPHA_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x858B, .hexadecimal); pub const GL_OPERAND3_RGB_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8593, .hexadecimal); pub const GL_OPERAND3_ALPHA_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x859B, .hexadecimal); pub const GL_NV_texture_expand_normal = @as(c_int, 1); pub const GL_TEXTURE_UNSIGNED_REMAP_MODE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x888F, .hexadecimal); pub const GL_NV_texture_multisample = @as(c_int, 1); pub const GL_TEXTURE_COVERAGE_SAMPLES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9045, .hexadecimal); pub const GL_TEXTURE_COLOR_SAMPLES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9046, .hexadecimal); pub const GL_NV_texture_rectangle = @as(c_int, 1); pub const GL_TEXTURE_RECTANGLE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84F5, .hexadecimal); pub const GL_TEXTURE_BINDING_RECTANGLE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84F6, .hexadecimal); pub const GL_PROXY_TEXTURE_RECTANGLE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84F7, .hexadecimal); pub const GL_MAX_RECTANGLE_TEXTURE_SIZE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x84F8, .hexadecimal); pub const GL_NV_texture_rectangle_compressed = @as(c_int, 1); pub const GL_NV_texture_shader = @as(c_int, 1); pub const GL_OFFSET_TEXTURE_RECTANGLE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x864C, .hexadecimal); pub const GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x864D, .hexadecimal); pub const GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x864E, .hexadecimal); pub const GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86D9, .hexadecimal); pub const GL_UNSIGNED_INT_S8_S8_8_8_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86DA, .hexadecimal); pub const GL_UNSIGNED_INT_8_8_S8_S8_REV_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86DB, .hexadecimal); pub const GL_DSDT_MAG_INTENSITY_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86DC, .hexadecimal); pub const GL_SHADER_CONSISTENT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86DD, .hexadecimal); pub const GL_TEXTURE_SHADER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86DE, .hexadecimal); pub const GL_SHADER_OPERATION_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86DF, .hexadecimal); pub const GL_CULL_MODES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86E0, .hexadecimal); pub const GL_OFFSET_TEXTURE_MATRIX_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86E1, .hexadecimal); pub const GL_OFFSET_TEXTURE_SCALE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86E2, .hexadecimal); pub const GL_OFFSET_TEXTURE_BIAS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86E3, .hexadecimal); pub const GL_OFFSET_TEXTURE_2D_MATRIX_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86E1, .hexadecimal); pub const GL_OFFSET_TEXTURE_2D_SCALE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86E2, .hexadecimal); pub const GL_OFFSET_TEXTURE_2D_BIAS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86E3, .hexadecimal); pub const GL_PREVIOUS_TEXTURE_INPUT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86E4, .hexadecimal); pub const GL_CONST_EYE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86E5, .hexadecimal); pub const GL_PASS_THROUGH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86E6, .hexadecimal); pub const GL_CULL_FRAGMENT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86E7, .hexadecimal); pub const GL_OFFSET_TEXTURE_2D_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86E8, .hexadecimal); pub const GL_DEPENDENT_AR_TEXTURE_2D_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86E9, .hexadecimal); pub const GL_DEPENDENT_GB_TEXTURE_2D_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86EA, .hexadecimal); pub const GL_DOT_PRODUCT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86EC, .hexadecimal); pub const GL_DOT_PRODUCT_DEPTH_REPLACE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86ED, .hexadecimal); pub const GL_DOT_PRODUCT_TEXTURE_2D_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86EE, .hexadecimal); pub const GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86F0, .hexadecimal); pub const GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86F1, .hexadecimal); pub const GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86F2, .hexadecimal); pub const GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86F3, .hexadecimal); pub const GL_HILO_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86F4, .hexadecimal); pub const GL_DSDT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86F5, .hexadecimal); pub const GL_DSDT_MAG_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86F6, .hexadecimal); pub const GL_DSDT_MAG_VIB_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86F7, .hexadecimal); pub const GL_HILO16_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86F8, .hexadecimal); pub const GL_SIGNED_HILO_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86F9, .hexadecimal); pub const GL_SIGNED_HILO16_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86FA, .hexadecimal); pub const GL_SIGNED_RGBA_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86FB, .hexadecimal); pub const GL_SIGNED_RGBA8_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86FC, .hexadecimal); pub const GL_SIGNED_RGB_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86FE, .hexadecimal); pub const GL_SIGNED_RGB8_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86FF, .hexadecimal); pub const GL_SIGNED_LUMINANCE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8701, .hexadecimal); pub const GL_SIGNED_LUMINANCE8_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8702, .hexadecimal); pub const GL_SIGNED_LUMINANCE_ALPHA_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8703, .hexadecimal); pub const GL_SIGNED_LUMINANCE8_ALPHA8_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8704, .hexadecimal); pub const GL_SIGNED_ALPHA_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8705, .hexadecimal); pub const GL_SIGNED_ALPHA8_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8706, .hexadecimal); pub const GL_SIGNED_INTENSITY_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8707, .hexadecimal); pub const GL_SIGNED_INTENSITY8_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8708, .hexadecimal); pub const GL_DSDT8_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8709, .hexadecimal); pub const GL_DSDT8_MAG8_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x870A, .hexadecimal); pub const GL_DSDT8_MAG8_INTENSITY8_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x870B, .hexadecimal); pub const GL_SIGNED_RGB_UNSIGNED_ALPHA_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x870C, .hexadecimal); pub const GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x870D, .hexadecimal); pub const GL_HI_SCALE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x870E, .hexadecimal); pub const GL_LO_SCALE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x870F, .hexadecimal); pub const GL_DS_SCALE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8710, .hexadecimal); pub const GL_DT_SCALE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8711, .hexadecimal); pub const GL_MAGNITUDE_SCALE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8712, .hexadecimal); pub const GL_VIBRANCE_SCALE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8713, .hexadecimal); pub const GL_HI_BIAS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8714, .hexadecimal); pub const GL_LO_BIAS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8715, .hexadecimal); pub const GL_DS_BIAS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8716, .hexadecimal); pub const GL_DT_BIAS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8717, .hexadecimal); pub const GL_MAGNITUDE_BIAS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8718, .hexadecimal); pub const GL_VIBRANCE_BIAS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8719, .hexadecimal); pub const GL_TEXTURE_BORDER_VALUES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x871A, .hexadecimal); pub const GL_TEXTURE_HI_SIZE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x871B, .hexadecimal); pub const GL_TEXTURE_LO_SIZE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x871C, .hexadecimal); pub const GL_TEXTURE_DS_SIZE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x871D, .hexadecimal); pub const GL_TEXTURE_DT_SIZE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x871E, .hexadecimal); pub const GL_TEXTURE_MAG_SIZE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x871F, .hexadecimal); pub const GL_NV_texture_shader2 = @as(c_int, 1); pub const GL_DOT_PRODUCT_TEXTURE_3D_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86EF, .hexadecimal); pub const GL_NV_texture_shader3 = @as(c_int, 1); pub const GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8850, .hexadecimal); pub const GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8851, .hexadecimal); pub const GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8852, .hexadecimal); pub const GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8853, .hexadecimal); pub const GL_OFFSET_HILO_TEXTURE_2D_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8854, .hexadecimal); pub const GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8855, .hexadecimal); pub const GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8856, .hexadecimal); pub const GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8857, .hexadecimal); pub const GL_DEPENDENT_HILO_TEXTURE_2D_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8858, .hexadecimal); pub const GL_DEPENDENT_RGB_TEXTURE_3D_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8859, .hexadecimal); pub const GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x885A, .hexadecimal); pub const GL_DOT_PRODUCT_PASS_THROUGH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x885B, .hexadecimal); pub const GL_DOT_PRODUCT_TEXTURE_1D_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x885C, .hexadecimal); pub const GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x885D, .hexadecimal); pub const GL_HILO8_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x885E, .hexadecimal); pub const GL_SIGNED_HILO8_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x885F, .hexadecimal); pub const GL_FORCE_BLUE_TO_ONE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8860, .hexadecimal); pub const GL_NV_transform_feedback = @as(c_int, 1); pub const GL_BACK_PRIMARY_COLOR_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C77, .hexadecimal); pub const GL_BACK_SECONDARY_COLOR_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C78, .hexadecimal); pub const GL_TEXTURE_COORD_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C79, .hexadecimal); pub const GL_CLIP_DISTANCE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C7A, .hexadecimal); pub const GL_VERTEX_ID_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C7B, .hexadecimal); pub const GL_PRIMITIVE_ID_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C7C, .hexadecimal); pub const GL_GENERIC_ATTRIB_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C7D, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_ATTRIBS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C7E, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C7F, .hexadecimal); pub const GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C80, .hexadecimal); pub const GL_ACTIVE_VARYINGS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C81, .hexadecimal); pub const GL_ACTIVE_VARYING_MAX_LENGTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C82, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_VARYINGS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C83, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BUFFER_START_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C84, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C85, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_RECORD_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C86, .hexadecimal); pub const GL_PRIMITIVES_GENERATED_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C87, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C88, .hexadecimal); pub const GL_RASTERIZER_DISCARD_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C89, .hexadecimal); pub const GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C8A, .hexadecimal); pub const GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C8B, .hexadecimal); pub const GL_INTERLEAVED_ATTRIBS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C8C, .hexadecimal); pub const GL_SEPARATE_ATTRIBS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C8D, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BUFFER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C8E, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8C8F, .hexadecimal); pub const GL_LAYER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8DAA, .hexadecimal); pub const GL_NEXT_BUFFER_NV = -@as(c_int, 2); pub const GL_SKIP_COMPONENTS4_NV = -@as(c_int, 3); pub const GL_SKIP_COMPONENTS3_NV = -@as(c_int, 4); pub const GL_SKIP_COMPONENTS2_NV = -@as(c_int, 5); pub const GL_SKIP_COMPONENTS1_NV = -@as(c_int, 6); pub const GL_NV_transform_feedback2 = @as(c_int, 1); pub const GL_TRANSFORM_FEEDBACK_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E22, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E23, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E24, .hexadecimal); pub const GL_TRANSFORM_FEEDBACK_BINDING_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8E25, .hexadecimal); pub const GL_NV_uniform_buffer_unified_memory = @as(c_int, 1); pub const GL_UNIFORM_BUFFER_UNIFIED_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x936E, .hexadecimal); pub const GL_UNIFORM_BUFFER_ADDRESS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x936F, .hexadecimal); pub const GL_UNIFORM_BUFFER_LENGTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9370, .hexadecimal); pub const GL_NV_vdpau_interop = @as(c_int, 1); pub const GL_SURFACE_STATE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86EB, .hexadecimal); pub const GL_SURFACE_REGISTERED_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x86FD, .hexadecimal); pub const GL_SURFACE_MAPPED_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8700, .hexadecimal); pub const GL_WRITE_DISCARD_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88BE, .hexadecimal); pub const GL_NV_vdpau_interop2 = @as(c_int, 1); pub const GL_NV_vertex_array_range = @as(c_int, 1); pub const GL_VERTEX_ARRAY_RANGE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x851D, .hexadecimal); pub const GL_VERTEX_ARRAY_RANGE_LENGTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x851E, .hexadecimal); pub const GL_VERTEX_ARRAY_RANGE_VALID_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x851F, .hexadecimal); pub const GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8520, .hexadecimal); pub const GL_VERTEX_ARRAY_RANGE_POINTER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8521, .hexadecimal); pub const GL_NV_vertex_array_range2 = @as(c_int, 1); pub const GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8533, .hexadecimal); pub const GL_NV_vertex_attrib_integer_64bit = @as(c_int, 1); pub const GL_NV_vertex_buffer_unified_memory = @as(c_int, 1); pub const GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F1E, .hexadecimal); pub const GL_ELEMENT_ARRAY_UNIFIED_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F1F, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F20, .hexadecimal); pub const GL_VERTEX_ARRAY_ADDRESS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F21, .hexadecimal); pub const GL_NORMAL_ARRAY_ADDRESS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F22, .hexadecimal); pub const GL_COLOR_ARRAY_ADDRESS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F23, .hexadecimal); pub const GL_INDEX_ARRAY_ADDRESS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F24, .hexadecimal); pub const GL_TEXTURE_COORD_ARRAY_ADDRESS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F25, .hexadecimal); pub const GL_EDGE_FLAG_ARRAY_ADDRESS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F26, .hexadecimal); pub const GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F27, .hexadecimal); pub const GL_FOG_COORD_ARRAY_ADDRESS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F28, .hexadecimal); pub const GL_ELEMENT_ARRAY_ADDRESS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F29, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F2A, .hexadecimal); pub const GL_VERTEX_ARRAY_LENGTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F2B, .hexadecimal); pub const GL_NORMAL_ARRAY_LENGTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F2C, .hexadecimal); pub const GL_COLOR_ARRAY_LENGTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F2D, .hexadecimal); pub const GL_INDEX_ARRAY_LENGTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F2E, .hexadecimal); pub const GL_TEXTURE_COORD_ARRAY_LENGTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F2F, .hexadecimal); pub const GL_EDGE_FLAG_ARRAY_LENGTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F30, .hexadecimal); pub const GL_SECONDARY_COLOR_ARRAY_LENGTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F31, .hexadecimal); pub const GL_FOG_COORD_ARRAY_LENGTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F32, .hexadecimal); pub const GL_ELEMENT_ARRAY_LENGTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F33, .hexadecimal); pub const GL_DRAW_INDIRECT_UNIFIED_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F40, .hexadecimal); pub const GL_DRAW_INDIRECT_ADDRESS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F41, .hexadecimal); pub const GL_DRAW_INDIRECT_LENGTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8F42, .hexadecimal); pub const GL_NV_vertex_program = @as(c_int, 1); pub const GL_VERTEX_PROGRAM_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8620, .hexadecimal); pub const GL_VERTEX_STATE_PROGRAM_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8621, .hexadecimal); pub const GL_ATTRIB_ARRAY_SIZE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8623, .hexadecimal); pub const GL_ATTRIB_ARRAY_STRIDE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8624, .hexadecimal); pub const GL_ATTRIB_ARRAY_TYPE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8625, .hexadecimal); pub const GL_CURRENT_ATTRIB_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8626, .hexadecimal); pub const GL_PROGRAM_LENGTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8627, .hexadecimal); pub const GL_PROGRAM_STRING_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8628, .hexadecimal); pub const GL_MODELVIEW_PROJECTION_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8629, .hexadecimal); pub const GL_IDENTITY_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x862A, .hexadecimal); pub const GL_INVERSE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x862B, .hexadecimal); pub const GL_TRANSPOSE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x862C, .hexadecimal); pub const GL_INVERSE_TRANSPOSE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x862D, .hexadecimal); pub const GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x862E, .hexadecimal); pub const GL_MAX_TRACK_MATRICES_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x862F, .hexadecimal); pub const GL_MATRIX0_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8630, .hexadecimal); pub const GL_MATRIX1_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8631, .hexadecimal); pub const GL_MATRIX2_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8632, .hexadecimal); pub const GL_MATRIX3_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8633, .hexadecimal); pub const GL_MATRIX4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8634, .hexadecimal); pub const GL_MATRIX5_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8635, .hexadecimal); pub const GL_MATRIX6_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8636, .hexadecimal); pub const GL_MATRIX7_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8637, .hexadecimal); pub const GL_CURRENT_MATRIX_STACK_DEPTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8640, .hexadecimal); pub const GL_CURRENT_MATRIX_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8641, .hexadecimal); pub const GL_VERTEX_PROGRAM_POINT_SIZE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8642, .hexadecimal); pub const GL_VERTEX_PROGRAM_TWO_SIDE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8643, .hexadecimal); pub const GL_PROGRAM_PARAMETER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8644, .hexadecimal); pub const GL_ATTRIB_ARRAY_POINTER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8645, .hexadecimal); pub const GL_PROGRAM_TARGET_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8646, .hexadecimal); pub const GL_PROGRAM_RESIDENT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8647, .hexadecimal); pub const GL_TRACK_MATRIX_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8648, .hexadecimal); pub const GL_TRACK_MATRIX_TRANSFORM_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8649, .hexadecimal); pub const GL_VERTEX_PROGRAM_BINDING_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x864A, .hexadecimal); pub const GL_PROGRAM_ERROR_POSITION_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x864B, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY0_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8650, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY1_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8651, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY2_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8652, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY3_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8653, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8654, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY5_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8655, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY6_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8656, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY7_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8657, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY8_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8658, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY9_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8659, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY10_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x865A, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY11_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x865B, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY12_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x865C, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY13_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x865D, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY14_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x865E, .hexadecimal); pub const GL_VERTEX_ATTRIB_ARRAY15_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x865F, .hexadecimal); pub const GL_MAP1_VERTEX_ATTRIB0_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8660, .hexadecimal); pub const GL_MAP1_VERTEX_ATTRIB1_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8661, .hexadecimal); pub const GL_MAP1_VERTEX_ATTRIB2_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8662, .hexadecimal); pub const GL_MAP1_VERTEX_ATTRIB3_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8663, .hexadecimal); pub const GL_MAP1_VERTEX_ATTRIB4_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8664, .hexadecimal); pub const GL_MAP1_VERTEX_ATTRIB5_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8665, .hexadecimal); pub const GL_MAP1_VERTEX_ATTRIB6_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8666, .hexadecimal); pub const GL_MAP1_VERTEX_ATTRIB7_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8667, .hexadecimal); pub const GL_MAP1_VERTEX_ATTRIB8_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8668, .hexadecimal); pub const GL_MAP1_VERTEX_ATTRIB9_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8669, .hexadecimal); pub const GL_MAP1_VERTEX_ATTRIB10_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x866A, .hexadecimal); pub const GL_MAP1_VERTEX_ATTRIB11_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x866B, .hexadecimal); pub const GL_MAP1_VERTEX_ATTRIB12_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x866C, .hexadecimal); pub const GL_MAP1_VERTEX_ATTRIB13_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x866D, .hexadecimal); pub const GL_MAP1_VERTEX_ATTRIB14_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x866E, .hexadecimal); pub const GL_MAP1_VERTEX_ATTRIB15_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x866F, .hexadecimal); pub const GL_MAP2_VERTEX_ATTRIB0_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8670, .hexadecimal); pub const GL_MAP2_VERTEX_ATTRIB1_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8671, .hexadecimal); pub const GL_MAP2_VERTEX_ATTRIB2_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8672, .hexadecimal); pub const GL_MAP2_VERTEX_ATTRIB3_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8673, .hexadecimal); pub const GL_MAP2_VERTEX_ATTRIB4_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8674, .hexadecimal); pub const GL_MAP2_VERTEX_ATTRIB5_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8675, .hexadecimal); pub const GL_MAP2_VERTEX_ATTRIB6_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8676, .hexadecimal); pub const GL_MAP2_VERTEX_ATTRIB7_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8677, .hexadecimal); pub const GL_MAP2_VERTEX_ATTRIB8_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8678, .hexadecimal); pub const GL_MAP2_VERTEX_ATTRIB9_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8679, .hexadecimal); pub const GL_MAP2_VERTEX_ATTRIB10_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x867A, .hexadecimal); pub const GL_MAP2_VERTEX_ATTRIB11_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x867B, .hexadecimal); pub const GL_MAP2_VERTEX_ATTRIB12_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x867C, .hexadecimal); pub const GL_MAP2_VERTEX_ATTRIB13_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x867D, .hexadecimal); pub const GL_MAP2_VERTEX_ATTRIB14_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x867E, .hexadecimal); pub const GL_MAP2_VERTEX_ATTRIB15_4_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x867F, .hexadecimal); pub const GL_NV_vertex_program1_1 = @as(c_int, 1); pub const GL_NV_vertex_program2 = @as(c_int, 1); pub const GL_NV_vertex_program2_option = @as(c_int, 1); pub const GL_NV_vertex_program3 = @as(c_int, 1); pub const GL_NV_vertex_program4 = @as(c_int, 1); pub const GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x88FD, .hexadecimal); pub const GL_NV_video_capture = @as(c_int, 1); pub const GL_VIDEO_BUFFER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9020, .hexadecimal); pub const GL_VIDEO_BUFFER_BINDING_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9021, .hexadecimal); pub const GL_FIELD_UPPER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9022, .hexadecimal); pub const GL_FIELD_LOWER_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9023, .hexadecimal); pub const GL_NUM_VIDEO_CAPTURE_STREAMS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9024, .hexadecimal); pub const GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9025, .hexadecimal); pub const GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9026, .hexadecimal); pub const GL_LAST_VIDEO_CAPTURE_STATUS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9027, .hexadecimal); pub const GL_VIDEO_BUFFER_PITCH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9028, .hexadecimal); pub const GL_VIDEO_COLOR_CONVERSION_MATRIX_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9029, .hexadecimal); pub const GL_VIDEO_COLOR_CONVERSION_MAX_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x902A, .hexadecimal); pub const GL_VIDEO_COLOR_CONVERSION_MIN_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x902B, .hexadecimal); pub const GL_VIDEO_COLOR_CONVERSION_OFFSET_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x902C, .hexadecimal); pub const GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x902D, .hexadecimal); pub const GL_PARTIAL_SUCCESS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x902E, .hexadecimal); pub const GL_SUCCESS_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x902F, .hexadecimal); pub const GL_FAILURE_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9030, .hexadecimal); pub const GL_YCBYCR8_422_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9031, .hexadecimal); pub const GL_YCBAYCR8A_4224_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9032, .hexadecimal); pub const GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9033, .hexadecimal); pub const GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9034, .hexadecimal); pub const GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9035, .hexadecimal); pub const GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9036, .hexadecimal); pub const GL_Z4Y12Z4CB12Z4CR12_444_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9037, .hexadecimal); pub const GL_VIDEO_CAPTURE_FRAME_WIDTH_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9038, .hexadecimal); pub const GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9039, .hexadecimal); pub const GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x903A, .hexadecimal); pub const GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x903B, .hexadecimal); pub const GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x903C, .hexadecimal); pub const GL_NV_viewport_array2 = @as(c_int, 1); pub const GL_NV_viewport_swizzle = @as(c_int, 1); pub const GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9350, .hexadecimal); pub const GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9351, .hexadecimal); pub const GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9352, .hexadecimal); pub const GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9353, .hexadecimal); pub const GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9354, .hexadecimal); pub const GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9355, .hexadecimal); pub const GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9356, .hexadecimal); pub const GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9357, .hexadecimal); pub const GL_VIEWPORT_SWIZZLE_X_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9358, .hexadecimal); pub const GL_VIEWPORT_SWIZZLE_Y_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9359, .hexadecimal); pub const GL_VIEWPORT_SWIZZLE_Z_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x935A, .hexadecimal); pub const GL_VIEWPORT_SWIZZLE_W_NV = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x935B, .hexadecimal); pub const GL_OML_interlace = @as(c_int, 1); pub const GL_INTERLACE_OML = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8980, .hexadecimal); pub const GL_INTERLACE_READ_OML = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8981, .hexadecimal); pub const GL_OML_resample = @as(c_int, 1); pub const GL_PACK_RESAMPLE_OML = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8984, .hexadecimal); pub const GL_UNPACK_RESAMPLE_OML = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8985, .hexadecimal); pub const GL_RESAMPLE_REPLICATE_OML = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8986, .hexadecimal); pub const GL_RESAMPLE_ZERO_FILL_OML = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8987, .hexadecimal); pub const GL_RESAMPLE_AVERAGE_OML = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8988, .hexadecimal); pub const GL_RESAMPLE_DECIMATE_OML = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8989, .hexadecimal); pub const GL_OML_subsample = @as(c_int, 1); pub const GL_FORMAT_SUBSAMPLE_24_24_OML = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8982, .hexadecimal); pub const GL_FORMAT_SUBSAMPLE_244_244_OML = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8983, .hexadecimal); pub const GL_OVR_multiview = @as(c_int, 1); pub const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9630, .hexadecimal); pub const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9632, .hexadecimal); pub const GL_MAX_VIEWS_OVR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9631, .hexadecimal); pub const GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9633, .hexadecimal); pub const GL_OVR_multiview2 = @as(c_int, 1); pub const GL_PGI_misc_hints = @as(c_int, 1); pub const GL_PREFER_DOUBLEBUFFER_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A1F8, .hexadecimal); pub const GL_CONSERVE_MEMORY_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A1FD, .hexadecimal); pub const GL_RECLAIM_MEMORY_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A1FE, .hexadecimal); pub const GL_NATIVE_GRAPHICS_HANDLE_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A202, .hexadecimal); pub const GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A203, .hexadecimal); pub const GL_NATIVE_GRAPHICS_END_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A204, .hexadecimal); pub const GL_ALWAYS_FAST_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A20C, .hexadecimal); pub const GL_ALWAYS_SOFT_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A20D, .hexadecimal); pub const GL_ALLOW_DRAW_OBJ_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A20E, .hexadecimal); pub const GL_ALLOW_DRAW_WIN_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A20F, .hexadecimal); pub const GL_ALLOW_DRAW_FRG_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A210, .hexadecimal); pub const GL_ALLOW_DRAW_MEM_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A211, .hexadecimal); pub const GL_STRICT_DEPTHFUNC_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A216, .hexadecimal); pub const GL_STRICT_LIGHTING_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A217, .hexadecimal); pub const GL_STRICT_SCISSOR_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A218, .hexadecimal); pub const GL_FULL_STIPPLE_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A219, .hexadecimal); pub const GL_CLIP_NEAR_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A220, .hexadecimal); pub const GL_CLIP_FAR_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A221, .hexadecimal); pub const GL_WIDE_LINE_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A222, .hexadecimal); pub const GL_BACK_NORMALS_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A223, .hexadecimal); pub const GL_PGI_vertex_hints = @as(c_int, 1); pub const GL_VERTEX_DATA_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A22A, .hexadecimal); pub const GL_VERTEX_CONSISTENT_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A22B, .hexadecimal); pub const GL_MATERIAL_SIDE_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A22C, .hexadecimal); pub const GL_MAX_VERTEX_HINT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1A22D, .hexadecimal); pub const GL_COLOR3_BIT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00010000, .hexadecimal); pub const GL_COLOR4_BIT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00020000, .hexadecimal); pub const GL_EDGEFLAG_BIT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00040000, .hexadecimal); pub const GL_INDEX_BIT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00080000, .hexadecimal); pub const GL_MAT_AMBIENT_BIT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00100000, .hexadecimal); pub const GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00200000, .hexadecimal); pub const GL_MAT_DIFFUSE_BIT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00400000, .hexadecimal); pub const GL_MAT_EMISSION_BIT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x00800000, .hexadecimal); pub const GL_MAT_COLOR_INDEXES_BIT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x01000000, .hexadecimal); pub const GL_MAT_SHININESS_BIT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x02000000, .hexadecimal); pub const GL_MAT_SPECULAR_BIT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x04000000, .hexadecimal); pub const GL_NORMAL_BIT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x08000000, .hexadecimal); pub const GL_TEXCOORD1_BIT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x10000000, .hexadecimal); pub const GL_TEXCOORD2_BIT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x20000000, .hexadecimal); pub const GL_TEXCOORD3_BIT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x40000000, .hexadecimal); pub const GL_TEXCOORD4_BIT_PGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80000000, .hexadecimal); pub const GL_VERTEX23_BIT_PGI = @as(c_int, 0x00000004); pub const GL_VERTEX4_BIT_PGI = @as(c_int, 0x00000008); pub const GL_REND_screen_coordinates = @as(c_int, 1); pub const GL_SCREEN_COORDINATES_REND = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8490, .hexadecimal); pub const GL_INVERTED_SCREEN_W_REND = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8491, .hexadecimal); pub const GL_S3_s3tc = @as(c_int, 1); pub const GL_RGB_S3TC = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83A0, .hexadecimal); pub const GL_RGB4_S3TC = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83A1, .hexadecimal); pub const GL_RGBA_S3TC = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83A2, .hexadecimal); pub const GL_RGBA4_S3TC = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83A3, .hexadecimal); pub const GL_RGBA_DXT5_S3TC = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83A4, .hexadecimal); pub const GL_RGBA4_DXT5_S3TC = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83A5, .hexadecimal); pub const GL_SGIS_detail_texture = @as(c_int, 1); pub const GL_DETAIL_TEXTURE_2D_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8095, .hexadecimal); pub const GL_DETAIL_TEXTURE_2D_BINDING_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8096, .hexadecimal); pub const GL_LINEAR_DETAIL_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8097, .hexadecimal); pub const GL_LINEAR_DETAIL_ALPHA_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8098, .hexadecimal); pub const GL_LINEAR_DETAIL_COLOR_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8099, .hexadecimal); pub const GL_DETAIL_TEXTURE_LEVEL_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x809A, .hexadecimal); pub const GL_DETAIL_TEXTURE_MODE_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x809B, .hexadecimal); pub const GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x809C, .hexadecimal); pub const GL_SGIS_fog_function = @as(c_int, 1); pub const GL_FOG_FUNC_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x812A, .hexadecimal); pub const GL_FOG_FUNC_POINTS_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x812B, .hexadecimal); pub const GL_MAX_FOG_FUNC_POINTS_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x812C, .hexadecimal); pub const GL_SGIS_generate_mipmap = @as(c_int, 1); pub const GL_GENERATE_MIPMAP_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8191, .hexadecimal); pub const GL_GENERATE_MIPMAP_HINT_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8192, .hexadecimal); pub const GL_SGIS_multisample = @as(c_int, 1); pub const GL_MULTISAMPLE_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x809D, .hexadecimal); pub const GL_SAMPLE_ALPHA_TO_MASK_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x809E, .hexadecimal); pub const GL_SAMPLE_ALPHA_TO_ONE_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x809F, .hexadecimal); pub const GL_SAMPLE_MASK_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A0, .hexadecimal); pub const GL_1PASS_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A1, .hexadecimal); pub const GL_2PASS_0_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A2, .hexadecimal); pub const GL_2PASS_1_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A3, .hexadecimal); pub const GL_4PASS_0_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A4, .hexadecimal); pub const GL_4PASS_1_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A5, .hexadecimal); pub const GL_4PASS_2_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A6, .hexadecimal); pub const GL_4PASS_3_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A7, .hexadecimal); pub const GL_SAMPLE_BUFFERS_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A8, .hexadecimal); pub const GL_SAMPLES_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80A9, .hexadecimal); pub const GL_SAMPLE_MASK_VALUE_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80AA, .hexadecimal); pub const GL_SAMPLE_MASK_INVERT_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80AB, .hexadecimal); pub const GL_SAMPLE_PATTERN_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80AC, .hexadecimal); pub const GL_SGIS_pixel_texture = @as(c_int, 1); pub const GL_PIXEL_TEXTURE_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8353, .hexadecimal); pub const GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8354, .hexadecimal); pub const GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8355, .hexadecimal); pub const GL_PIXEL_GROUP_COLOR_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8356, .hexadecimal); pub const GL_SGIS_point_line_texgen = @as(c_int, 1); pub const GL_EYE_DISTANCE_TO_POINT_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81F0, .hexadecimal); pub const GL_OBJECT_DISTANCE_TO_POINT_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81F1, .hexadecimal); pub const GL_EYE_DISTANCE_TO_LINE_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81F2, .hexadecimal); pub const GL_OBJECT_DISTANCE_TO_LINE_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81F3, .hexadecimal); pub const GL_EYE_POINT_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81F4, .hexadecimal); pub const GL_OBJECT_POINT_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81F5, .hexadecimal); pub const GL_EYE_LINE_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81F6, .hexadecimal); pub const GL_OBJECT_LINE_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81F7, .hexadecimal); pub const GL_SGIS_point_parameters = @as(c_int, 1); pub const GL_POINT_SIZE_MIN_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8126, .hexadecimal); pub const GL_POINT_SIZE_MAX_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8127, .hexadecimal); pub const GL_POINT_FADE_THRESHOLD_SIZE_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8128, .hexadecimal); pub const GL_DISTANCE_ATTENUATION_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8129, .hexadecimal); pub const GL_SGIS_sharpen_texture = @as(c_int, 1); pub const GL_LINEAR_SHARPEN_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80AD, .hexadecimal); pub const GL_LINEAR_SHARPEN_ALPHA_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80AE, .hexadecimal); pub const GL_LINEAR_SHARPEN_COLOR_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80AF, .hexadecimal); pub const GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80B0, .hexadecimal); pub const GL_SGIS_texture4D = @as(c_int, 1); pub const GL_PACK_SKIP_VOLUMES_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8130, .hexadecimal); pub const GL_PACK_IMAGE_DEPTH_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8131, .hexadecimal); pub const GL_UNPACK_SKIP_VOLUMES_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8132, .hexadecimal); pub const GL_UNPACK_IMAGE_DEPTH_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8133, .hexadecimal); pub const GL_TEXTURE_4D_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8134, .hexadecimal); pub const GL_PROXY_TEXTURE_4D_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8135, .hexadecimal); pub const GL_TEXTURE_4DSIZE_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8136, .hexadecimal); pub const GL_TEXTURE_WRAP_Q_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8137, .hexadecimal); pub const GL_MAX_4D_TEXTURE_SIZE_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8138, .hexadecimal); pub const GL_TEXTURE_4D_BINDING_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x814F, .hexadecimal); pub const GL_SGIS_texture_border_clamp = @as(c_int, 1); pub const GL_CLAMP_TO_BORDER_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x812D, .hexadecimal); pub const GL_SGIS_texture_color_mask = @as(c_int, 1); pub const GL_TEXTURE_COLOR_WRITEMASK_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81EF, .hexadecimal); pub const GL_SGIS_texture_edge_clamp = @as(c_int, 1); pub const GL_CLAMP_TO_EDGE_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x812F, .hexadecimal); pub const GL_SGIS_texture_filter4 = @as(c_int, 1); pub const GL_FILTER4_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8146, .hexadecimal); pub const GL_TEXTURE_FILTER4_SIZE_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8147, .hexadecimal); pub const GL_SGIS_texture_lod = @as(c_int, 1); pub const GL_TEXTURE_MIN_LOD_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x813A, .hexadecimal); pub const GL_TEXTURE_MAX_LOD_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x813B, .hexadecimal); pub const GL_TEXTURE_BASE_LEVEL_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x813C, .hexadecimal); pub const GL_TEXTURE_MAX_LEVEL_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x813D, .hexadecimal); pub const GL_SGIS_texture_select = @as(c_int, 1); pub const GL_DUAL_ALPHA4_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8110, .hexadecimal); pub const GL_DUAL_ALPHA8_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8111, .hexadecimal); pub const GL_DUAL_ALPHA12_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8112, .hexadecimal); pub const GL_DUAL_ALPHA16_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8113, .hexadecimal); pub const GL_DUAL_LUMINANCE4_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8114, .hexadecimal); pub const GL_DUAL_LUMINANCE8_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8115, .hexadecimal); pub const GL_DUAL_LUMINANCE12_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8116, .hexadecimal); pub const GL_DUAL_LUMINANCE16_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8117, .hexadecimal); pub const GL_DUAL_INTENSITY4_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8118, .hexadecimal); pub const GL_DUAL_INTENSITY8_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8119, .hexadecimal); pub const GL_DUAL_INTENSITY12_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x811A, .hexadecimal); pub const GL_DUAL_INTENSITY16_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x811B, .hexadecimal); pub const GL_DUAL_LUMINANCE_ALPHA4_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x811C, .hexadecimal); pub const GL_DUAL_LUMINANCE_ALPHA8_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x811D, .hexadecimal); pub const GL_QUAD_ALPHA4_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x811E, .hexadecimal); pub const GL_QUAD_ALPHA8_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x811F, .hexadecimal); pub const GL_QUAD_LUMINANCE4_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8120, .hexadecimal); pub const GL_QUAD_LUMINANCE8_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8121, .hexadecimal); pub const GL_QUAD_INTENSITY4_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8122, .hexadecimal); pub const GL_QUAD_INTENSITY8_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8123, .hexadecimal); pub const GL_DUAL_TEXTURE_SELECT_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8124, .hexadecimal); pub const GL_QUAD_TEXTURE_SELECT_SGIS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8125, .hexadecimal); pub const GL_SGIX_async = @as(c_int, 1); pub const GL_ASYNC_MARKER_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8329, .hexadecimal); pub const GL_SGIX_async_histogram = @as(c_int, 1); pub const GL_ASYNC_HISTOGRAM_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x832C, .hexadecimal); pub const GL_MAX_ASYNC_HISTOGRAM_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x832D, .hexadecimal); pub const GL_SGIX_async_pixel = @as(c_int, 1); pub const GL_ASYNC_TEX_IMAGE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x835C, .hexadecimal); pub const GL_ASYNC_DRAW_PIXELS_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x835D, .hexadecimal); pub const GL_ASYNC_READ_PIXELS_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x835E, .hexadecimal); pub const GL_MAX_ASYNC_TEX_IMAGE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x835F, .hexadecimal); pub const GL_MAX_ASYNC_DRAW_PIXELS_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8360, .hexadecimal); pub const GL_MAX_ASYNC_READ_PIXELS_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8361, .hexadecimal); pub const GL_SGIX_blend_alpha_minmax = @as(c_int, 1); pub const GL_ALPHA_MIN_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8320, .hexadecimal); pub const GL_ALPHA_MAX_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8321, .hexadecimal); pub const GL_SGIX_calligraphic_fragment = @as(c_int, 1); pub const GL_CALLIGRAPHIC_FRAGMENT_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8183, .hexadecimal); pub const GL_SGIX_clipmap = @as(c_int, 1); pub const GL_LINEAR_CLIPMAP_LINEAR_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8170, .hexadecimal); pub const GL_TEXTURE_CLIPMAP_CENTER_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8171, .hexadecimal); pub const GL_TEXTURE_CLIPMAP_FRAME_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8172, .hexadecimal); pub const GL_TEXTURE_CLIPMAP_OFFSET_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8173, .hexadecimal); pub const GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8174, .hexadecimal); pub const GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8175, .hexadecimal); pub const GL_TEXTURE_CLIPMAP_DEPTH_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8176, .hexadecimal); pub const GL_MAX_CLIPMAP_DEPTH_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8177, .hexadecimal); pub const GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8178, .hexadecimal); pub const GL_NEAREST_CLIPMAP_NEAREST_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x844D, .hexadecimal); pub const GL_NEAREST_CLIPMAP_LINEAR_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x844E, .hexadecimal); pub const GL_LINEAR_CLIPMAP_NEAREST_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x844F, .hexadecimal); pub const GL_SGIX_convolution_accuracy = @as(c_int, 1); pub const GL_CONVOLUTION_HINT_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8316, .hexadecimal); pub const GL_SGIX_depth_pass_instrument = @as(c_int, 1); pub const GL_SGIX_depth_texture = @as(c_int, 1); pub const GL_DEPTH_COMPONENT16_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81A5, .hexadecimal); pub const GL_DEPTH_COMPONENT24_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81A6, .hexadecimal); pub const GL_DEPTH_COMPONENT32_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81A7, .hexadecimal); pub const GL_SGIX_flush_raster = @as(c_int, 1); pub const GL_SGIX_fog_offset = @as(c_int, 1); pub const GL_FOG_OFFSET_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8198, .hexadecimal); pub const GL_FOG_OFFSET_VALUE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8199, .hexadecimal); pub const GL_SGIX_fragment_lighting = @as(c_int, 1); pub const GL_FRAGMENT_LIGHTING_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8400, .hexadecimal); pub const GL_FRAGMENT_COLOR_MATERIAL_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8401, .hexadecimal); pub const GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8402, .hexadecimal); pub const GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8403, .hexadecimal); pub const GL_MAX_FRAGMENT_LIGHTS_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8404, .hexadecimal); pub const GL_MAX_ACTIVE_LIGHTS_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8405, .hexadecimal); pub const GL_CURRENT_RASTER_NORMAL_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8406, .hexadecimal); pub const GL_LIGHT_ENV_MODE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8407, .hexadecimal); pub const GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8408, .hexadecimal); pub const GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8409, .hexadecimal); pub const GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x840A, .hexadecimal); pub const GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x840B, .hexadecimal); pub const GL_FRAGMENT_LIGHT0_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x840C, .hexadecimal); pub const GL_FRAGMENT_LIGHT1_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x840D, .hexadecimal); pub const GL_FRAGMENT_LIGHT2_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x840E, .hexadecimal); pub const GL_FRAGMENT_LIGHT3_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x840F, .hexadecimal); pub const GL_FRAGMENT_LIGHT4_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8410, .hexadecimal); pub const GL_FRAGMENT_LIGHT5_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8411, .hexadecimal); pub const GL_FRAGMENT_LIGHT6_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8412, .hexadecimal); pub const GL_FRAGMENT_LIGHT7_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8413, .hexadecimal); pub const GL_SGIX_framezoom = @as(c_int, 1); pub const GL_FRAMEZOOM_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x818B, .hexadecimal); pub const GL_FRAMEZOOM_FACTOR_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x818C, .hexadecimal); pub const GL_MAX_FRAMEZOOM_FACTOR_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x818D, .hexadecimal); pub const GL_SGIX_igloo_interface = @as(c_int, 1); pub const GL_SGIX_instruments = @as(c_int, 1); pub const GL_INSTRUMENT_BUFFER_POINTER_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8180, .hexadecimal); pub const GL_INSTRUMENT_MEASUREMENTS_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8181, .hexadecimal); pub const GL_SGIX_interlace = @as(c_int, 1); pub const GL_INTERLACE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8094, .hexadecimal); pub const GL_SGIX_ir_instrument1 = @as(c_int, 1); pub const GL_IR_INSTRUMENT1_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x817F, .hexadecimal); pub const GL_SGIX_list_priority = @as(c_int, 1); pub const GL_LIST_PRIORITY_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8182, .hexadecimal); pub const GL_SGIX_pixel_texture = @as(c_int, 1); pub const GL_PIXEL_TEX_GEN_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8139, .hexadecimal); pub const GL_PIXEL_TEX_GEN_MODE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x832B, .hexadecimal); pub const GL_SGIX_pixel_tiles = @as(c_int, 1); pub const GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x813E, .hexadecimal); pub const GL_PIXEL_TILE_CACHE_INCREMENT_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x813F, .hexadecimal); pub const GL_PIXEL_TILE_WIDTH_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8140, .hexadecimal); pub const GL_PIXEL_TILE_HEIGHT_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8141, .hexadecimal); pub const GL_PIXEL_TILE_GRID_WIDTH_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8142, .hexadecimal); pub const GL_PIXEL_TILE_GRID_HEIGHT_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8143, .hexadecimal); pub const GL_PIXEL_TILE_GRID_DEPTH_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8144, .hexadecimal); pub const GL_PIXEL_TILE_CACHE_SIZE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8145, .hexadecimal); pub const GL_SGIX_polynomial_ffd = @as(c_int, 1); pub const GL_TEXTURE_DEFORMATION_BIT_SGIX = @as(c_int, 0x00000001); pub const GL_GEOMETRY_DEFORMATION_BIT_SGIX = @as(c_int, 0x00000002); pub const GL_GEOMETRY_DEFORMATION_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8194, .hexadecimal); pub const GL_TEXTURE_DEFORMATION_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8195, .hexadecimal); pub const GL_DEFORMATIONS_MASK_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8196, .hexadecimal); pub const GL_MAX_DEFORMATION_ORDER_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8197, .hexadecimal); pub const GL_SGIX_reference_plane = @as(c_int, 1); pub const GL_REFERENCE_PLANE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x817D, .hexadecimal); pub const GL_REFERENCE_PLANE_EQUATION_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x817E, .hexadecimal); pub const GL_SGIX_resample = @as(c_int, 1); pub const GL_PACK_RESAMPLE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x842E, .hexadecimal); pub const GL_UNPACK_RESAMPLE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x842F, .hexadecimal); pub const GL_RESAMPLE_REPLICATE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8433, .hexadecimal); pub const GL_RESAMPLE_ZERO_FILL_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8434, .hexadecimal); pub const GL_RESAMPLE_DECIMATE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8430, .hexadecimal); pub const GL_SGIX_scalebias_hint = @as(c_int, 1); pub const GL_SCALEBIAS_HINT_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8322, .hexadecimal); pub const GL_SGIX_shadow = @as(c_int, 1); pub const GL_TEXTURE_COMPARE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x819A, .hexadecimal); pub const GL_TEXTURE_COMPARE_OPERATOR_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x819B, .hexadecimal); pub const GL_TEXTURE_LEQUAL_R_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x819C, .hexadecimal); pub const GL_TEXTURE_GEQUAL_R_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x819D, .hexadecimal); pub const GL_SGIX_shadow_ambient = @as(c_int, 1); pub const GL_SHADOW_AMBIENT_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80BF, .hexadecimal); pub const GL_SGIX_sprite = @as(c_int, 1); pub const GL_SPRITE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8148, .hexadecimal); pub const GL_SPRITE_MODE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8149, .hexadecimal); pub const GL_SPRITE_AXIS_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x814A, .hexadecimal); pub const GL_SPRITE_TRANSLATION_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x814B, .hexadecimal); pub const GL_SPRITE_AXIAL_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x814C, .hexadecimal); pub const GL_SPRITE_OBJECT_ALIGNED_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x814D, .hexadecimal); pub const GL_SPRITE_EYE_ALIGNED_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x814E, .hexadecimal); pub const GL_SGIX_subsample = @as(c_int, 1); pub const GL_PACK_SUBSAMPLE_RATE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85A0, .hexadecimal); pub const GL_UNPACK_SUBSAMPLE_RATE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85A1, .hexadecimal); pub const GL_PIXEL_SUBSAMPLE_4444_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85A2, .hexadecimal); pub const GL_PIXEL_SUBSAMPLE_2424_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85A3, .hexadecimal); pub const GL_PIXEL_SUBSAMPLE_4242_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85A4, .hexadecimal); pub const GL_SGIX_tag_sample_buffer = @as(c_int, 1); pub const GL_SGIX_texture_add_env = @as(c_int, 1); pub const GL_TEXTURE_ENV_BIAS_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80BE, .hexadecimal); pub const GL_SGIX_texture_coordinate_clamp = @as(c_int, 1); pub const GL_TEXTURE_MAX_CLAMP_S_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8369, .hexadecimal); pub const GL_TEXTURE_MAX_CLAMP_T_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x836A, .hexadecimal); pub const GL_TEXTURE_MAX_CLAMP_R_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x836B, .hexadecimal); pub const GL_SGIX_texture_lod_bias = @as(c_int, 1); pub const GL_TEXTURE_LOD_BIAS_S_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x818E, .hexadecimal); pub const GL_TEXTURE_LOD_BIAS_T_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x818F, .hexadecimal); pub const GL_TEXTURE_LOD_BIAS_R_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8190, .hexadecimal); pub const GL_SGIX_texture_multi_buffer = @as(c_int, 1); pub const GL_TEXTURE_MULTI_BUFFER_HINT_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x812E, .hexadecimal); pub const GL_SGIX_texture_scale_bias = @as(c_int, 1); pub const GL_POST_TEXTURE_FILTER_BIAS_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8179, .hexadecimal); pub const GL_POST_TEXTURE_FILTER_SCALE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x817A, .hexadecimal); pub const GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x817B, .hexadecimal); pub const GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x817C, .hexadecimal); pub const GL_SGIX_vertex_preclip = @as(c_int, 1); pub const GL_VERTEX_PRECLIP_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83EE, .hexadecimal); pub const GL_VERTEX_PRECLIP_HINT_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x83EF, .hexadecimal); pub const GL_SGIX_ycrcb = @as(c_int, 1); pub const GL_YCRCB_422_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81BB, .hexadecimal); pub const GL_YCRCB_444_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81BC, .hexadecimal); pub const GL_SGIX_ycrcb_subsample = @as(c_int, 1); pub const GL_SGIX_ycrcba = @as(c_int, 1); pub const GL_YCRCB_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8318, .hexadecimal); pub const GL_YCRCBA_SGIX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8319, .hexadecimal); pub const GL_SGI_color_matrix = @as(c_int, 1); pub const GL_COLOR_MATRIX_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80B1, .hexadecimal); pub const GL_COLOR_MATRIX_STACK_DEPTH_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80B2, .hexadecimal); pub const GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80B3, .hexadecimal); pub const GL_POST_COLOR_MATRIX_RED_SCALE_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80B4, .hexadecimal); pub const GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80B5, .hexadecimal); pub const GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80B6, .hexadecimal); pub const GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80B7, .hexadecimal); pub const GL_POST_COLOR_MATRIX_RED_BIAS_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80B8, .hexadecimal); pub const GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80B9, .hexadecimal); pub const GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80BA, .hexadecimal); pub const GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80BB, .hexadecimal); pub const GL_SGI_color_table = @as(c_int, 1); pub const GL_COLOR_TABLE_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80D0, .hexadecimal); pub const GL_POST_CONVOLUTION_COLOR_TABLE_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80D1, .hexadecimal); pub const GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80D2, .hexadecimal); pub const GL_PROXY_COLOR_TABLE_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80D3, .hexadecimal); pub const GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80D4, .hexadecimal); pub const GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80D5, .hexadecimal); pub const GL_COLOR_TABLE_SCALE_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80D6, .hexadecimal); pub const GL_COLOR_TABLE_BIAS_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80D7, .hexadecimal); pub const GL_COLOR_TABLE_FORMAT_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80D8, .hexadecimal); pub const GL_COLOR_TABLE_WIDTH_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80D9, .hexadecimal); pub const GL_COLOR_TABLE_RED_SIZE_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80DA, .hexadecimal); pub const GL_COLOR_TABLE_GREEN_SIZE_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80DB, .hexadecimal); pub const GL_COLOR_TABLE_BLUE_SIZE_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80DC, .hexadecimal); pub const GL_COLOR_TABLE_ALPHA_SIZE_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80DD, .hexadecimal); pub const GL_COLOR_TABLE_LUMINANCE_SIZE_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80DE, .hexadecimal); pub const GL_COLOR_TABLE_INTENSITY_SIZE_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80DF, .hexadecimal); pub const GL_SGI_texture_color_table = @as(c_int, 1); pub const GL_TEXTURE_COLOR_TABLE_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80BC, .hexadecimal); pub const GL_PROXY_TEXTURE_COLOR_TABLE_SGI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80BD, .hexadecimal); pub const GL_SUNX_constant_data = @as(c_int, 1); pub const GL_UNPACK_CONSTANT_DATA_SUNX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81D5, .hexadecimal); pub const GL_TEXTURE_CONSTANT_DATA_SUNX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81D6, .hexadecimal); pub const GL_SUN_convolution_border_modes = @as(c_int, 1); pub const GL_WRAP_BORDER_SUN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81D4, .hexadecimal); pub const GL_SUN_global_alpha = @as(c_int, 1); pub const GL_GLOBAL_ALPHA_SUN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81D9, .hexadecimal); pub const GL_GLOBAL_ALPHA_FACTOR_SUN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81DA, .hexadecimal); pub const GL_SUN_mesh_array = @as(c_int, 1); pub const GL_QUAD_MESH_SUN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8614, .hexadecimal); pub const GL_TRIANGLE_MESH_SUN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8615, .hexadecimal); pub const GL_SUN_slice_accum = @as(c_int, 1); pub const GL_SLICE_ACCUM_SUN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85CC, .hexadecimal); pub const GL_SUN_triangle_list = @as(c_int, 1); pub const GL_RESTART_SUN = @as(c_int, 0x0001); pub const GL_REPLACE_MIDDLE_SUN = @as(c_int, 0x0002); pub const GL_REPLACE_OLDEST_SUN = @as(c_int, 0x0003); pub const GL_TRIANGLE_LIST_SUN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81D7, .hexadecimal); pub const GL_REPLACEMENT_CODE_SUN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x81D8, .hexadecimal); pub const GL_REPLACEMENT_CODE_ARRAY_SUN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85C0, .hexadecimal); pub const GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85C1, .hexadecimal); pub const GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85C2, .hexadecimal); pub const GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85C3, .hexadecimal); pub const GL_R1UI_V3F_SUN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85C4, .hexadecimal); pub const GL_R1UI_C4UB_V3F_SUN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85C5, .hexadecimal); pub const GL_R1UI_C3F_V3F_SUN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85C6, .hexadecimal); pub const GL_R1UI_N3F_V3F_SUN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85C7, .hexadecimal); pub const GL_R1UI_C4F_N3F_V3F_SUN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85C8, .hexadecimal); pub const GL_R1UI_T2F_V3F_SUN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85C9, .hexadecimal); pub const GL_R1UI_T2F_N3F_V3F_SUN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85CA, .hexadecimal); pub const GL_R1UI_T2F_C4F_N3F_V3F_SUN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x85CB, .hexadecimal); pub const GL_SUN_vertex = @as(c_int, 1); pub const GL_WIN_phong_shading = @as(c_int, 1); pub const GL_PHONG_WIN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80EA, .hexadecimal); pub const GL_PHONG_HINT_WIN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80EB, .hexadecimal); pub const GL_WIN_specular_fog = @as(c_int, 1); pub const GL_FOG_SPECULAR_TEXTURE_WIN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80EC, .hexadecimal); pub const GL_MESA_packed_depth_stencil = @as(c_int, 1); pub const GL_DEPTH_STENCIL_MESA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8750, .hexadecimal); pub const GL_UNSIGNED_INT_24_8_MESA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8751, .hexadecimal); pub const GL_UNSIGNED_INT_8_24_REV_MESA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8752, .hexadecimal); pub const GL_UNSIGNED_SHORT_15_1_MESA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8753, .hexadecimal); pub const GL_UNSIGNED_SHORT_1_15_REV_MESA = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8754, .hexadecimal); pub const GL_ATI_blend_equation_separate = @as(c_int, 1); pub const GL_ALPHA_BLEND_EQUATION_ATI = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x883D, .hexadecimal); pub const GL_OES_EGL_image = @as(c_int, 1); pub const GLX_VERSION_1_1 = @as(c_int, 1); pub const GLX_VERSION_1_2 = @as(c_int, 1); pub const GLX_VERSION_1_3 = @as(c_int, 1); pub const GLX_VERSION_1_4 = @as(c_int, 1); pub const GLX_EXTENSION_NAME = "GLX"; pub const GLX_USE_GL = @as(c_int, 1); pub const GLX_BUFFER_SIZE = @as(c_int, 2); pub const GLX_LEVEL = @as(c_int, 3); pub const GLX_RGBA = @as(c_int, 4); pub const GLX_DOUBLEBUFFER = @as(c_int, 5); pub const GLX_STEREO = @as(c_int, 6); pub const GLX_AUX_BUFFERS = @as(c_int, 7); pub const GLX_RED_SIZE = @as(c_int, 8); pub const GLX_GREEN_SIZE = @as(c_int, 9); pub const GLX_BLUE_SIZE = @as(c_int, 10); pub const GLX_ALPHA_SIZE = @as(c_int, 11); pub const GLX_DEPTH_SIZE = @as(c_int, 12); pub const GLX_STENCIL_SIZE = @as(c_int, 13); pub const GLX_ACCUM_RED_SIZE = @as(c_int, 14); pub const GLX_ACCUM_GREEN_SIZE = @as(c_int, 15); pub const GLX_ACCUM_BLUE_SIZE = @as(c_int, 16); pub const GLX_ACCUM_ALPHA_SIZE = @as(c_int, 17); pub const GLX_BAD_SCREEN = @as(c_int, 1); pub const GLX_BAD_ATTRIBUTE = @as(c_int, 2); pub const GLX_NO_EXTENSION = @as(c_int, 3); pub const GLX_BAD_VISUAL = @as(c_int, 4); pub const GLX_BAD_CONTEXT = @as(c_int, 5); pub const GLX_BAD_VALUE = @as(c_int, 6); pub const GLX_BAD_ENUM = @as(c_int, 7); pub const GLX_VENDOR = @as(c_int, 1); pub const GLX_VERSION = @as(c_int, 2); pub const GLX_EXTENSIONS = @as(c_int, 3); pub const GLX_CONFIG_CAVEAT = @as(c_int, 0x20); pub const GLX_DONT_CARE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0xFFFFFFFF, .hexadecimal); pub const GLX_X_VISUAL_TYPE = @as(c_int, 0x22); pub const GLX_TRANSPARENT_TYPE = @as(c_int, 0x23); pub const GLX_TRANSPARENT_INDEX_VALUE = @as(c_int, 0x24); pub const GLX_TRANSPARENT_RED_VALUE = @as(c_int, 0x25); pub const GLX_TRANSPARENT_GREEN_VALUE = @as(c_int, 0x26); pub const GLX_TRANSPARENT_BLUE_VALUE = @as(c_int, 0x27); pub const GLX_TRANSPARENT_ALPHA_VALUE = @as(c_int, 0x28); pub const GLX_WINDOW_BIT = @as(c_int, 0x00000001); pub const GLX_PIXMAP_BIT = @as(c_int, 0x00000002); pub const GLX_PBUFFER_BIT = @as(c_int, 0x00000004); pub const GLX_AUX_BUFFERS_BIT = @as(c_int, 0x00000010); pub const GLX_FRONT_LEFT_BUFFER_BIT = @as(c_int, 0x00000001); pub const GLX_FRONT_RIGHT_BUFFER_BIT = @as(c_int, 0x00000002); pub const GLX_BACK_LEFT_BUFFER_BIT = @as(c_int, 0x00000004); pub const GLX_BACK_RIGHT_BUFFER_BIT = @as(c_int, 0x00000008); pub const GLX_DEPTH_BUFFER_BIT = @as(c_int, 0x00000020); pub const GLX_STENCIL_BUFFER_BIT = @as(c_int, 0x00000040); pub const GLX_ACCUM_BUFFER_BIT = @as(c_int, 0x00000080); pub const GLX_NONE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8000, .hexadecimal); pub const GLX_SLOW_CONFIG = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8001, .hexadecimal); pub const GLX_TRUE_COLOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8002, .hexadecimal); pub const GLX_DIRECT_COLOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8003, .hexadecimal); pub const GLX_PSEUDO_COLOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8004, .hexadecimal); pub const GLX_STATIC_COLOR = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8005, .hexadecimal); pub const GLX_GRAY_SCALE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8006, .hexadecimal); pub const GLX_STATIC_GRAY = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8007, .hexadecimal); pub const GLX_TRANSPARENT_RGB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8008, .hexadecimal); pub const GLX_TRANSPARENT_INDEX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8009, .hexadecimal); pub const GLX_VISUAL_ID = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x800B, .hexadecimal); pub const GLX_SCREEN = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x800C, .hexadecimal); pub const GLX_NON_CONFORMANT_CONFIG = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x800D, .hexadecimal); pub const GLX_DRAWABLE_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8010, .hexadecimal); pub const GLX_RENDER_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8011, .hexadecimal); pub const GLX_X_RENDERABLE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8012, .hexadecimal); pub const GLX_FBCONFIG_ID = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8013, .hexadecimal); pub const GLX_RGBA_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8014, .hexadecimal); pub const GLX_COLOR_INDEX_TYPE = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8015, .hexadecimal); pub const GLX_MAX_PBUFFER_WIDTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8016, .hexadecimal); pub const GLX_MAX_PBUFFER_HEIGHT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8017, .hexadecimal); pub const GLX_MAX_PBUFFER_PIXELS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8018, .hexadecimal); pub const GLX_PRESERVED_CONTENTS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x801B, .hexadecimal); pub const GLX_LARGEST_PBUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x801C, .hexadecimal); pub const GLX_WIDTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x801D, .hexadecimal); pub const GLX_HEIGHT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x801E, .hexadecimal); pub const GLX_EVENT_MASK = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x801F, .hexadecimal); pub const GLX_DAMAGED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8020, .hexadecimal); pub const GLX_SAVED = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8021, .hexadecimal); pub const GLX_WINDOW = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8022, .hexadecimal); pub const GLX_PBUFFER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8023, .hexadecimal); pub const GLX_PBUFFER_HEIGHT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8040, .hexadecimal); pub const GLX_PBUFFER_WIDTH = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8041, .hexadecimal); pub const GLX_RGBA_BIT = @as(c_int, 0x00000001); pub const GLX_COLOR_INDEX_BIT = @as(c_int, 0x00000002); pub const GLX_PBUFFER_CLOBBER_MASK = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x08000000, .hexadecimal); pub const GLX_SAMPLE_BUFFERS = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x186a0, .hexadecimal); pub const GLX_SAMPLES = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x186a1, .hexadecimal); pub const GLX_PbufferClobber = @as(c_int, 0); pub const GLX_BufferSwapComplete = @as(c_int, 1); pub const __GLX_NUMBER_EVENTS = @as(c_int, 17); pub const GLX_ARB_get_proc_address = @as(c_int, 1); pub const GLX_NV_vertex_array_range = ""; pub const GLX_ARB_render_texture = @as(c_int, 1); pub const GLX_NV_float_buffer = @as(c_int, 1); pub const GLX_FLOAT_COMPONENTS_NV = @as(c_int, 0x20B0); pub const GLX_MESA_swap_frame_usage = @as(c_int, 1); pub const GLX_MESA_swap_control = @as(c_int, 1); pub const GLX_EXT_texture_from_pixmap = @as(c_int, 1); pub const GLX_BIND_TO_TEXTURE_RGB_EXT = @as(c_int, 0x20D0); pub const GLX_BIND_TO_TEXTURE_RGBA_EXT = @as(c_int, 0x20D1); pub const GLX_BIND_TO_MIPMAP_TEXTURE_EXT = @as(c_int, 0x20D2); pub const GLX_BIND_TO_TEXTURE_TARGETS_EXT = @as(c_int, 0x20D3); pub const GLX_Y_INVERTED_EXT = @as(c_int, 0x20D4); pub const GLX_TEXTURE_FORMAT_EXT = @as(c_int, 0x20D5); pub const GLX_TEXTURE_TARGET_EXT = @as(c_int, 0x20D6); pub const GLX_MIPMAP_TEXTURE_EXT = @as(c_int, 0x20D7); pub const GLX_TEXTURE_FORMAT_NONE_EXT = @as(c_int, 0x20D8); pub const GLX_TEXTURE_FORMAT_RGB_EXT = @as(c_int, 0x20D9); pub const GLX_TEXTURE_FORMAT_RGBA_EXT = @as(c_int, 0x20DA); pub const GLX_TEXTURE_1D_BIT_EXT = @as(c_int, 0x00000001); pub const GLX_TEXTURE_2D_BIT_EXT = @as(c_int, 0x00000002); pub const GLX_TEXTURE_RECTANGLE_BIT_EXT = @as(c_int, 0x00000004); pub const GLX_TEXTURE_1D_EXT = @as(c_int, 0x20DB); pub const GLX_TEXTURE_2D_EXT = @as(c_int, 0x20DC); pub const GLX_TEXTURE_RECTANGLE_EXT = @as(c_int, 0x20DD); pub const GLX_FRONT_LEFT_EXT = @as(c_int, 0x20DE); pub const GLX_FRONT_RIGHT_EXT = @as(c_int, 0x20DF); pub const GLX_BACK_LEFT_EXT = @as(c_int, 0x20E0); pub const GLX_BACK_RIGHT_EXT = @as(c_int, 0x20E1); pub const GLX_FRONT_EXT = GLX_FRONT_LEFT_EXT; pub const GLX_BACK_EXT = GLX_BACK_LEFT_EXT; pub const GLX_AUX0_EXT = @as(c_int, 0x20E2); pub const GLX_AUX1_EXT = @as(c_int, 0x20E3); pub const GLX_AUX2_EXT = @as(c_int, 0x20E4); pub const GLX_AUX3_EXT = @as(c_int, 0x20E5); pub const GLX_AUX4_EXT = @as(c_int, 0x20E6); pub const GLX_AUX5_EXT = @as(c_int, 0x20E7); pub const GLX_AUX6_EXT = @as(c_int, 0x20E8); pub const GLX_AUX7_EXT = @as(c_int, 0x20E9); pub const GLX_AUX8_EXT = @as(c_int, 0x20EA); pub const GLX_AUX9_EXT = @as(c_int, 0x20EB); pub const __GLsync = struct___GLsync; pub const _cl_context = struct__cl_context; pub const _cl_event = struct__cl_event; pub const __GLXcontextRec = struct___GLXcontextRec; pub const __GLXFBConfigRec = struct___GLXFBConfigRec; pub const __GLXEvent = union___GLXEvent; pub const GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB = @as(c_int, 0x20b2); pub const GLX_CONTEXT_DEBUG_BIT_ARB = @as(c_int, 0x00000001); pub const GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB = @as(c_int, 0x00000002); pub const GLX_CONTEXT_CORE_PROFILE_BIT_ARB = @as(c_int, 0x00000001); pub const GLX_CONTEXT_PROFILE_MASK_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x9126, .hexadecimal); pub const GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB = @as(c_int, 0x00000002); pub const GLX_CONTEXT_MAJOR_VERSION_ARB = @as(c_int, 0x2091); pub const GLX_CONTEXT_MINOR_VERSION_ARB = @as(c_int, 0x2092); pub const GLX_CONTEXT_FLAGS_ARB = @as(c_int, 0x2094); pub const GLX_CONTEXT_ES2_PROFILE_BIT_EXT = @as(c_int, 0x00000004); pub const GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB = @as(c_int, 0x00000004); pub const GLX_LOSE_CONTEXT_ON_RESET_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8252, .hexadecimal); pub const GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8256, .hexadecimal); pub const GLX_NO_RESET_NOTIFICATION_ARB = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8261, .hexadecimal); pub const GLX_CONTEXT_RELEASE_BEHAVIOR_ARB = @as(c_int, 0x2097); pub const GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB = @as(c_int, 0); pub const GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB = @as(c_int, 0x2098); pub const GLX_CONTEXT_OPENGL_NO_ERROR_ARB = @as(c_int, 0x31b3);
modules/platform/src/linux/X11/glx.zig
const std = @import("std"); const math = @import("math.zig"); pub fn identity() math.mat4x4 { const zero: f32 = 0.0; var m: math.mat4x4 = .{@splat(4, zero)} ** 4; m[0][0] = 1.0; m[1][1] = 1.0; m[2][2] = 1.0; m[3][3] = 1.0; return m; } pub fn mul(a: math.mat4x4, b: math.mat4x4) math.mat4x4 { var vs: math.mat4x4 = undefined; for (vs) |*v, i| v.* = @splat(4, b[i][0]) * a[0]; for (vs) |*v, i| v.* = @mulAdd(math.vec4, @splat(4, b[i][1]), a[1], v.*); for (vs) |*v, i| v.* = @mulAdd(math.vec4, @splat(4, b[i][2]), a[2], v.*); vs[3] = @mulAdd(math.vec4, @splat(4, b[3][3]), a[3], vs[3]); return vs; } pub fn mulv(a: math.mat4x4, b: math.vec4) math.vec4 { return a[0] * @splat(4, b[0]) + a[1] * @splat(4, b[1]) + a[2] * @splat(4, b[2]) + a[3] * @splat(4, b[3]); } // Doesn't change a's translation row pub inline fn mulRotOnly(a: math.mat4x4, b: math.mat4x4, dest: *math.mat4x4) void { var vs: [3]math.vec4 = undefined; for (vs) |*v, i| v.* = @splat(4, b[i][0]) * a[0]; for (vs) |*v, i| v.* = @mulAdd(math.vec4, @splat(4, b[i][1]), a[1], v.*); for (vs) |*v, i| v.* = @mulAdd(math.vec4, @splat(4, b[i][2]), a[2], v.*); for (vs) |v, i| dest[i] = v; dest[3] = a[3]; } pub fn lookAt(pos: math.vec3, target: math.vec3, up: math.vec3) math.mat4x4 { const f: math.vec3 = math.Vec3.normalize(target - pos); const s: math.vec3 = math.Vec3.normalize(math.Vec3.cross(up, f)); const u: math.vec3 = math.Vec3.cross(f, s); return .{ .{ s[0], u[0], f[0], 0.0 }, .{ s[1], u[1], f[1], 0.0 }, .{ s[2], u[2], f[2], 0.0 }, .{ -math.Vec3.dot(s, pos), -math.Vec3.dot(u, pos), -math.Vec3.dot(f, pos), 1.0, }, }; } pub fn perspective(fov_y: f32, aspect: f32, near: f32, far: f32) math.mat4x4 { var res: math.mat4x4 = .{math.Vec4.zeros()} ** 4; const f: f32 = 1.0 / std.math.tan(fov_y * 0.5); const depth: f32 = 1.0 / (far - near); res[0][0] = f / aspect; res[1][1] = f; res[2][2] = far * depth; res[2][3] = 1.0; res[3][2] = -(far * near) * depth; return res; } pub fn ortho(size: f32, aspect: f32, near: f32, far: f32) math.mat4x4 { var res: math.mat4x4 = .{math.Vec4.zeros()} ** 4; const left: f32 = -size * aspect; const right: f32 = size * aspect; const bottom: f32 = -size; const top: f32 = size; const rl: f32 = 1.0 / (right - left); const tb: f32 = 1.0 / (top - bottom); const depth: f32 = 1.0 / (near - far); res[0][0] = 2.0 * rl; res[1][1] = 2.0 * tb; res[2][2] = depth; res[3][0] = -(right + left) * rl; res[3][1] = -(top + bottom) * tb; res[3][2] = -near * depth; res[3][3] = 1.0; return res; } pub fn inverse(a: math.mat4x4) math.mat4x4 { const n0: i32 = ~@as(i32, 0); const n1: i32 = ~@as(i32, 1); const n2: i32 = ~@as(i32, 2); const n3: i32 = ~@as(i32, 3); const r0: math.vec4 = a[0]; const r1: math.vec4 = a[1]; const r2: math.vec4 = a[2]; const r3: math.vec4 = a[3]; var x0: math.vec4 = @shuffle(f32, r1, r2, [4]i32{ n3, n3, 3, 3 }); var x1: math.vec4 = @shuffle(f32, r2, r3, [4]i32{ n3, n3, n3, 3 }); var x2: math.vec4 = @shuffle(f32, r2, r3, [4]i32{ n2, n2, n2, 2 }); var x3: math.vec4 = @shuffle(f32, r1, r2, [4]i32{ n2, n2, 2, 2 }); const t0: math.vec4 = x3 * x1 - x2 * x0; const x4: math.vec4 = @shuffle(f32, r2, r3, [4]i32{ n1, n1, n1, 1 }); const x5: math.vec4 = @shuffle(f32, r1, r2, [4]i32{ n1, n1, 1, 1 }); const t1: math.vec4 = x5 * x1 - x4 * x0; const t2: math.vec4 = x5 * x2 - x4 * x3; const x6: math.vec4 = @shuffle(f32, r1, r2, [4]i32{ n0, n0, 0, 0 }); const x7: math.vec4 = @shuffle(f32, r2, r3, [4]i32{ n0, n0, n0, 0 }); const t3: math.vec4 = x6 * x1 - x7 * x0; const t4: math.vec4 = x6 * x2 - x7 * x3; const t5: math.vec4 = x6 * x4 - x7 * x5; x0 = @shuffle(f32, r0, r1, [4]i32{ n0, 0, 0, 0 }); x1 = @shuffle(f32, r0, r1, [4]i32{ n1, 1, 1, 1 }); x2 = @shuffle(f32, r0, r1, [4]i32{ n2, 2, 2, 2 }); x3 = @shuffle(f32, r0, r1, [4]i32{ n3, 3, 3, 3 }); const v0: math.vec4 = (x3 * t2 + x1 * t0 - x2 * t1) * math.vec4{ 1.0, -1.0, 1.0, -1.0 }; const v1: math.vec4 = (x3 * t4 + x0 * t0 - x2 * t3) * math.vec4{ -1.0, 1.0, -1.0, 1.0 }; const v2: math.vec4 = (x3 * t5 + x0 * t1 - x1 * t3) * math.vec4{ 1.0, -1.0, 1.0, -1.0 }; const v3: math.vec4 = (x2 * t5 + x0 * t2 - x1 * t4) * math.vec4{ -1.0, 1.0, -1.0, 1.0 }; x0 = @shuffle(f32, v0, v1, [4]i32{ 0, 0, n0, n0 }); x1 = @shuffle(f32, v2, v3, [4]i32{ 0, 0, n0, n0 }); x0 = @shuffle(f32, x0, x1, [4]i32{ 0, 2, n0, n2 }); x0 *= r0; x0 = @splat(4, 1.0 / @reduce(.Add, x0)); const res: math.mat4x4 = .{ v0 * x0, v1 * x0, v2 * x0, v3 * x0, }; return res; } pub fn unprojecti(p: math.vec3, m: math.mat4x4, vp: math.vec4) math.vec3 { var v: math.vec4 = undefined; v[0] = 2.0 * (p[0] - vp[0]) / vp[2] - 1.0; v[1] = 2.0 * (p[1] - vp[1]) / vp[3] - 1.0; v[2] = p[2]; v[3] = 1.0; v[1] *= -1.0; v = mulv(m, v); v *= @splat(4, 1.0 / v[3]); return .{ v[0], v[1], v[2] }; } pub fn unproject(p: math.vec3, m: math.mat4x4, vp: math.vec4) math.vec3 { const inv: math.mat4x4 = inverse(m); return unprojecti(p, inv, vp); }
src/math/mat4x4.zig
const ZachO = @This(); const std = @import("std"); const fs = std.fs; const io = std.io; const mem = std.mem; const macho = std.macho; const Allocator = std.mem.Allocator; usingnamespace @import("ZachO/commands.zig"); allocator: *Allocator, file: ?fs.File = null, /// Mach-O header header: ?macho.mach_header_64 = null, /// Load commands load_commands: std.ArrayListUnmanaged(LoadCommand) = .{}, /// Data data: std.ArrayListUnmanaged(u8) = .{}, /// Code signature load command code_signature_cmd: ?u16 = null, pub fn init(allocator: *Allocator) ZachO { return .{ .allocator = allocator }; } pub fn deinit(self: *ZachO) void { for (self.load_commands.items) |*cmd| { cmd.deinit(self.allocator); } self.load_commands.deinit(self.allocator); self.data.deinit(self.allocator); } pub fn closeFiles(self: *ZachO) void { if (self.file) |file| { file.close(); } self.file = null; } pub fn parse(self: *ZachO, file: fs.File) !void { self.file = file; var reader = file.reader(); self.header = try reader.readStruct(macho.mach_header_64); const ncmds = self.header.?.ncmds; try self.load_commands.ensureCapacity(self.allocator, ncmds); var i: u16 = 0; while (i < ncmds) : (i += 1) { const cmd = try LoadCommand.parse(self.allocator, reader); switch (cmd.cmd()) { macho.LC_CODE_SIGNATURE => self.code_signature_cmd = i, else => {}, } self.load_commands.appendAssumeCapacity(cmd); } // TODO parse memory mapped segments try reader.context.seekTo(0); const file_size = try reader.context.getEndPos(); var data = try std.ArrayList(u8).initCapacity(self.allocator, file_size); try reader.readAllArrayList(&data, file_size); self.data = data.toUnmanaged(); } pub fn printHeader(self: ZachO, writer: anytype) !void { const header = &self.header.?; try writer.print("Header\n", .{}); try writer.print(" Magic number: 0x{x}\n", .{header.magic}); try writer.print(" CPU type: 0x{x}\n", .{header.cputype}); try writer.print(" CPU sub-type: 0x{x}\n", .{header.cpusubtype}); try writer.print(" File type: 0x{x}\n", .{header.filetype}); try writer.print(" Number of load commands: {}\n", .{header.ncmds}); try writer.print(" Size of load commands: {}\n", .{header.sizeofcmds}); try writer.print(" Flags: 0x{x}\n", .{header.flags}); try writer.print(" Reserved: 0x{x}\n", .{header.reserved}); } pub fn printLoadCommands(self: ZachO, writer: anytype) !void { for (self.load_commands.items) |cmd| { try writer.print("{}\n", .{cmd}); } } pub fn printCodeSignature(self: ZachO, writer: anytype) !void { return if (self.code_signature_cmd) |code_sig| self.formatCodeSignatureData(self.load_commands.items[code_sig].LinkeditData, writer) else writer.print("LC_CODE_SIGNATURE load command not found\n", .{}); } pub fn format( self: ZachO, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype, ) !void { try self.printHeader(writer); try writer.print("\n", .{}); try self.printLoadCommands(writer); try writer.print("\n", .{}); for (self.load_commands.items) |cmd| { switch (cmd) { .Segment => |seg| try self.formatData(seg, writer), .CodeSignature => |csig| try self.formatCodeSignatureData(csig, writer), else => {}, } } } fn formatData(self: ZachO, segment_command: SegmentCommand, writer: anytype) !void { const seg = &segment_command.inner; const start_pos = seg.fileoff; const end_pos = seg.fileoff + seg.filesize; if (end_pos == start_pos) return; try writer.print("{s}\n", .{seg.segname}); try writer.print("file = {{ {}, {} }}\n", .{ start_pos, end_pos }); try writer.print("address = {{ 0x{x:0<16}, 0x{x:0<16} }}\n\n", .{ seg.vmaddr, seg.vmaddr + seg.vmsize, }); for (segment_command.section_headers.items) |sect| { const file_start = sect.offset; const file_end = sect.offset + sect.size; const addr_start = sect.addr; const addr_end = sect.addr + sect.size; try writer.print(" {s},{s}\n", .{ sect.segname, sect.sectname }); try writer.print(" file = {{ {}, {} }}\n", .{ file_start, file_end }); try writer.print(" address = {{ 0x{x:0<16}, 0x{x:0<16} }}\n\n", .{ addr_start, addr_end, }); try formatBinaryBlob(self.data.items[file_start..file_end], " ", writer); try writer.print("\n", .{}); } } fn formatCodeSignatureData( self: ZachO, csig: macho.linkedit_data_command, writer: anytype, ) !void { const start_pos = csig.dataoff; const end_pos = csig.dataoff + csig.datasize; if (end_pos == start_pos) return; try writer.print("Code signature data:\n", .{}); try writer.print("file = {{ {}, {} }}\n\n", .{ start_pos, end_pos }); var data = self.data.items[start_pos..end_pos]; const magic = mem.readIntBig(u32, data[0..4]); const length = mem.readIntBig(u32, data[4..8]); const count = mem.readIntBig(u32, data[8..12]); data = data[12..]; try writer.print("{{\n", .{}); try writer.print(" Magic = 0x{x}\n", .{magic}); try writer.print(" Length = {}\n", .{length}); try writer.print(" Count = {}\n", .{count}); try writer.print("}}\n", .{}); if (magic != macho.CSMAGIC_EMBEDDED_SIGNATURE) { try writer.print("unknown signature type: 0x{x}\n", .{magic}); try formatBinaryBlob(self.data.items[start_pos..end_pos], null, writer); return; } var i: usize = 0; while (i < count) : (i += 1) { const tt = mem.readIntBig(u32, data[0..4]); // ignored for some reason? const offset = mem.readIntBig(u32, data[4..8]); try writer.print("{{\n", .{}); const tt_fmt = switch (tt) { macho.CSSLOT_CODEDIRECTORY => "CSSLOT_CODEDIRECTORY", macho.CSSLOT_REQUIREMENTS => "CSSLOT_REQUIREMENTS", macho.CSSLOT_ALTERNATE_CODEDIRECTORIES => "CSSLOT_ALTERNATE_CODEDIRECTORIES", macho.CSSLOT_SIGNATURESLOT => "CSSLOT_SIGNATURESLOT", else => "Unknown", }; try writer.print(" Type: {s}(0x{x})\n", .{ tt_fmt, tt }); try writer.print(" Offset: {}\n", .{offset}); var inner = data[offset - 12 - i * 8 ..]; const magic2 = mem.readIntBig(u32, inner[0..4]); const length2 = mem.readIntBig(u32, inner[4..8]); const magic2_fmt = switch (magic2) { macho.CSMAGIC_REQUIREMENTS => "CSMAGIC_REQUIREMENTS", macho.CSMAGIC_CODEDIRECTORY => "CSMAGIC_CODEDIRECTORY", macho.CSMAGIC_BLOBWRAPPER => "CSMAGIC_BLOBWRAPPER", else => "Unknown", }; try writer.print(" Magic: {s}(0x{x})\n", .{ magic2_fmt, magic2 }); try writer.print(" Length: {}\n", .{length2}); switch (magic2) { macho.CSMAGIC_CODEDIRECTORY => { const version = mem.readIntBig(u32, inner[8..12]); try writer.print(" Version: 0x{x}\n", .{version}); try writer.print(" Flags: 0x{x}\n", .{mem.readIntBig(u32, inner[12..16])}); try writer.print(" Hash offset: {}\n", .{mem.readIntBig(u32, inner[16..20])}); try writer.print(" Ident offset: {}\n", .{mem.readIntBig(u32, inner[20..24])}); try writer.print(" Number of special slots: {}\n", .{mem.readIntBig(u32, inner[24..28])}); try writer.print(" Number of code slots: {}\n", .{mem.readIntBig(u32, inner[28..32])}); try writer.print(" Code limit: {}\n", .{mem.readIntBig(u32, inner[32..36])}); try writer.print(" Hash size: {}\n", .{inner[36]}); try writer.print(" Hash type: {}\n", .{inner[37]}); try writer.print(" Platform: {}\n", .{inner[38]}); try writer.print(" Page size: {}\n", .{inner[39]}); try writer.print(" Reserved: {}\n", .{mem.readIntBig(u32, inner[40..44])}); const len = blk: { switch (version) { 0x20400 => { try writer.print(" Scatter offset: {}\n", .{mem.readIntBig(u32, inner[44..48])}); try writer.print(" Team offset: {}\n", .{mem.readIntBig(u32, inner[48..52])}); try writer.print(" Reserved: {}\n", .{mem.readIntBig(u32, inner[52..56])}); try writer.print(" Code limit 64: {}\n", .{mem.readIntBig(u64, inner[56..64])}); try writer.print(" Offset of executable segment: {}\n", .{mem.readIntBig(u64, inner[64..72])}); try writer.print(" Limit of executable segment: {}\n", .{mem.readIntBig(u64, inner[72..80])}); try writer.print(" Executable segment flags: 0x{x}\n", .{mem.readIntBig(u64, inner[80..88])}); inner = inner[88..]; break :blk length2 - 88; }, 0x20100 => { try writer.print(" Scatter offset: {}\n", .{mem.readIntBig(u32, inner[52..56])}); inner = inner[56..]; break :blk length2 - 56; }, else => { inner = inner[52..]; break :blk length2 - 52; }, } }; try writer.print(" Data still to parse:\n", .{}); try formatBinaryBlob(inner[0..len], " ", writer); }, else => { try writer.print(" Data:\n", .{}); try formatBinaryBlob(inner[8..length2], " ", writer); }, } try writer.print("}}\n", .{}); data = data[8..]; } } fn formatBinaryBlob(blob: []const u8, prefix: ?[]const u8, writer: anytype) !void { // Format as 16-by-16-by-8 with two left column in hex, and right in ascii: // xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx xxxxxxxx var i: usize = 0; const step = 16; const pp = prefix orelse ""; while (i < blob.len) : (i += step) { if (blob[i..].len < step / 2) { try writer.print("{s}{x:<033} {s}\n", .{ pp, std.fmt.fmtSliceHexLower(blob[i..]), blob[i..], }); continue; } const rem = std.math.min(blob[i..].len, step); try writer.print("{s}{x:<016} {x:<016} {s}\n", .{ pp, std.fmt.fmtSliceHexLower(blob[i .. i + rem / 2]), std.fmt.fmtSliceHexLower(blob[i + rem / 2 .. i + rem]), blob[i .. i + rem], }); } } test "" { std.testing.refAllDecls(@This()); }
src/ZachO.zig
const std = @import("std"); const parseUnsigned = std.fmt.parseUnsigned; const process = std.process; const print = std.debug.print; const page_allocator = std.heap.page_allocator; const DefaultPrng = std.rand.DefaultPrng; const ArenaAllocator = std.heap.ArenaAllocator; const Allocator = std.mem.Allocator; const ArrayList = std.ArrayList; // we use `u7` because our range number (a-z) is less than 128 const alpha_start: u7 = 97; // = ASCII `a` const alpha_end: u7 = 123; // = ASCII `}` (after `z`) const WordGenerator = struct { allocator: *Allocator, // accept an *Allocator as a parameter allow you to decide what allocator to use. word_count: usize, letter_count: usize, pub fn init(allocator: *Allocator, word_count: usize, letter_count: usize) WordGenerator { return WordGenerator{ .allocator = allocator, .word_count = word_count, .letter_count = letter_count }; } // check if "letter" is one of {`a`, `e`, `i`, `o`} or no fn is_regular_letter(letter: u8) bool { if (letter == 97 or letter == 101 or letter == 105 or letter == 111) { return false; } return true; } pub fn generate(self: *WordGenerator) ?[][]u8 { // randomizer engine. generates a new random number millisecond var rand_engine = DefaultPrng.init(@intCast(u64, std.time.milliTimestamp())).random; var list = ArrayList([]u8).init(self.allocator); // init list defer list.deinit(); // deinit while (self.word_count > 0) : (self.word_count -= 1) { var lc: usize = 0; // letters count var prev_letter: u8 = 0; // previus letter to check is_regular_letter var word = ArrayList(u8).init(self.allocator); defer word.deinit(); // deinit while (lc < self.letter_count) { // generate a random letter const letter = rand_engine.intRangeLessThanBiased(u7, alpha_start, alpha_end); // continue if equals to previus letter if (is_regular_letter(prev_letter) == is_regular_letter(letter) and lc != 0) continue; word.append(letter) catch return null; // append letter to word prev_letter = letter; lc += 1; } // append word list.append(word.toOwnedSlice()) catch return null; } return list.toOwnedSlice(); } }; pub fn main() anyerror!void { // init allocator var arena = ArenaAllocator.init(page_allocator); const allocator = &arena.allocator; // get arguments const args = try process.argsAlloc(allocator); // free memory defer { process.argsFree(allocator, args); arena.deinit(); } // init words and letters count var letter_count: usize = 5; var word_count: usize = 5; // modify if there's argument for (args) |arg, i| { if (i == 1) { letter_count = try parseUnsigned(usize, arg, 0); } else if (i == 2) { word_count = try parseUnsigned(usize, arg, 0); } } var wd = WordGenerator.init(allocator, word_count, letter_count); // init WordGenerator const words = wd.generate(); // generate words // check is't null if (words != null) { // print words for (words.?) |word| { print("{s}\n", .{word}); } } }
code/word-generator.zig
const std = @import("std"); const abs = std.math.absInt; const expectEqual = std.testing.expectEqual; const ArrayList = std.ArrayList; pub const Vec3 = struct { x: i32, y: i32, z: i32, const Self = @This(); pub fn v(x: i32, y: i32, z: i32) Self { return Self{ .x = x, .y = y, .z = z, }; } pub fn sumAbs(self: Self) !i32 { return (try abs(self.x)) + (try abs(self.y)) + (try abs(self.z)); } pub fn add(a: *Self, b: Self) void { a.x += b.x; a.y += b.y; a.z += b.z; } pub fn parse(s: []const u8) !Self { var parser = Vec3Parser.init(s); return try parser.parse(); } }; pub const Vec3Parser = struct { buf: []const u8, pos: usize, const Self = @This(); pub fn init(buf: []const u8) Self { return Self{ .buf = buf, .pos = 0, }; } pub fn parse(self: *Self) !Vec3 { try self.acceptChar('<'); try self.acceptChar('x'); try self.acceptChar('='); const x = self.parseInt(); try self.acceptChar(','); try self.acceptChar('y'); try self.acceptChar('='); const y = self.parseInt(); try self.acceptChar(','); try self.acceptChar('z'); try self.acceptChar('='); const z = self.parseInt(); try self.acceptChar('>'); return Vec3.v(x, y, z); } fn acceptChar(self: *Self, ch: u8) !void { while (self.buf[self.pos] == ' ') self.pos += 1; if (self.buf[self.pos] == ch) { self.pos += 1; } else { return error.InvalidCharacter; } } fn parseInt(self: *Self) i32 { var result: i32 = 0; var negate = false; if (self.buf[self.pos] == '-') { negate = true; self.pos += 1; } while (self.buf[self.pos] >= '0' and self.buf[self.pos] <= '9') { result = result * 10 + @intCast(i32, self.buf[self.pos] - '0'); self.pos += 1; } return if (negate) -result else result; } }; test "parse Vec3" { expectEqual(Vec3.v(1, 2, 3), try Vec3.parse("<x=1, y=2, z=3>")); expectEqual(Vec3.v(5, 5, 5), try Vec3.parse("<x=5, y=5, z=5>")); expectEqual(Vec3.v(0, -1, 1), try Vec3.parse("<x=00, y=-1, z=01>")); } pub fn gravityChange(a: i32, b: i32) i32 { if (a > b) { return -1; } else if (a < b) { return 1; } else { return 0; } } pub const Moon = struct { pos: Vec3, vel: Vec3, const Self = @This(); pub fn init(pos: Vec3) Self { return Self{ .pos = pos, .vel = Vec3.v(0, 0, 0) }; } pub fn potEnergy(self: Self) !i32 { return try self.pos.sumAbs(); } pub fn kinEnergy(self: Self) !i32 { return try self.vel.sumAbs(); } pub fn applyGravity(self: *Self, other: Self) void { self.vel.x += gravityChange(self.pos.x, other.pos.x); self.vel.y += gravityChange(self.pos.y, other.pos.y); self.vel.z += gravityChange(self.pos.z, other.pos.z); } pub fn applyVelocity(self: *Self) void { self.pos.add(self.vel); } }; pub fn simulateStep(moons: []Moon) void { // apply gravity for (moons) |*m, i| { for (moons) |n, j| { if (i == j) continue; m.applyGravity(n); } } // apply velocity for (moons) |*m| { m.applyVelocity(); } } pub fn totalEnergy(moons: []Moon) !i32 { var result: i32 = 0; for (moons) |m| { result += (try m.potEnergy()) * (try m.kinEnergy()); } return result; } pub fn main() !void { var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); const allocator = &arena.allocator; defer arena.deinit(); var moons = ArrayList(Moon).init(allocator); const input_file = try std.fs.cwd().openFile("input12.txt", .{}); var input_stream = input_file.reader(); while (input_stream.readUntilDelimiterAlloc(allocator, '\n', 1024)) |line| { defer allocator.free(line); try moons.append(Moon.init(try Vec3.parse(line))); } else |e| switch (e) { error.EndOfStream => {}, else => return e, } // simulate steps const steps = 1000; var i: u32 = 0; while (i < steps) : (i += 1) { simulateStep(moons.items); } // output total energy std.debug.warn("total energy after {} steps: {}\n", .{ steps, totalEnergy(moons.items) }); }
zig/12.zig
const comms = @import("comms.zig"); const std = @import("std"); fn valid_client_fd(fd: i32) bool { // 0, 1, 2 are standard // 3 -> config dir // 4 -> config file return fd > 4; } pub fn run(reader: std.fs.File.Reader, writer: std.fs.File.Writer, enable_writing: bool) !void { try comms.send(writer, @as(u8, @boolToInt(enable_writing))); var data_buffer: [comms.max_write_bytes]u8 = undefined; while (true) { switch (try comms.recv(reader, comms.Command)) { .stat => { const path = try comms.recvpath(reader); var stat_buf = std.mem.zeroes(std.os.Stat); const result = @bitCast(i32, @truncate(u32, std.os.linux.stat(path.ptr(), &stat_buf))); try comms.send(writer, result); if (result == 0) try comms.send(writer, stat_buf); }, .opendir => { const path = try comms.recvpath(reader); const open_result = @bitCast(i32, @truncate(u32, std.os.linux.open( path.ptr(), std.os.O_RDONLY | std.os.O_CLOEXEC | std.os.O_DIRECTORY | std.os.O_NOCTTY | std.os.O_NONBLOCK, 0, ))); try comms.send(writer, open_result); }, .releasedir => { const fd = try comms.recv(reader, i32); if (!valid_client_fd(fd)) { try comms.send(writer, @as(i32, -std.os.EBADF)); } else { try comms.send(writer, @bitCast(i32, @truncate(u32, std.os.linux.close(fd)))); } }, .readdir => { const read_fd = try comms.recv(reader, i32); if (!valid_client_fd(read_fd)) { try comms.send(writer, @as(u8, 0)); } else { var dir_to_read = std.fs.Dir{ .fd = read_fd }; var it = dir_to_read.iterate(); while (true) { if (try it.next()) |dent| { // We got one! try comms.send(writer, @as(u8, 1)); // First send the stat var st = std.mem.zeroes(std.os.Stat); st.mode = @intCast(u32, @enumToInt(dent.kind)) << 12; try comms.send(writer, st); // Now send the name try comms.sendpath(writer, @ptrCast([*:0]const u8, dent.name.ptr)); // Do you want another one? if (0 == try comms.recv(reader, u8)) break; } else { try comms.send(writer, @as(u8, 0)); break; } } } }, .access => { const path = try comms.recvpath(reader); const flags = try comms.recv(reader, u32); if (flags & std.os.W_OK != 0 and !enable_writing) { try comms.send(writer, @as(i32, -1)); } else { try comms.send(writer, @bitCast(i32, @truncate(u32, std.os.linux.access(path.ptr(), flags)))); } }, .open => { const path = try comms.recvpath(reader); try comms.send(writer, @bitCast(i32, @truncate(u32, std.os.linux.open(path.ptr(), if (enable_writing) std.os.O_RDWR else std.os.O_RDONLY, 0)))); }, .create => { const path = try comms.recvpath(reader); const mode = @intCast(usize, try comms.recv(reader, std.os.mode_t)); if (!enable_writing) { std.log.info("Server: create: writing with writing disabled!", .{}); try comms.send(writer, @as(i32, -std.os.EPERM)); continue; } try comms.send(writer, @bitCast(i32, @truncate(u32, std.os.linux.open(path.ptr(), std.os.O_RDWR | std.os.O_CREAT, mode)))); }, .read => { const fd = try comms.recv(reader, i32); const len = try comms.recv(reader, u32); const foff = try comms.recv(reader, std.os.off_t); if (!valid_client_fd(fd)) { try comms.send(writer, @as(i32, -std.os.EBADF)); continue; } var buf = std.mem.span(&data_buffer); if (buf.len > len) buf.len = len; const result = @bitCast(i64, std.os.linux.pread(fd, buf.ptr, buf.len, foff)); try comms.send(writer, @intCast(i32, result)); if (result > 0) { try comms.sendfrom(writer, buf[0..@intCast(usize, result)]); } }, .write => { const fd = try comms.recv(reader, i32); const len = try comms.recv(reader, @TypeOf(comms.max_write_bytes)); const foff = try comms.recv(reader, std.os.off_t); if (!valid_client_fd(fd)) { std.log.info("Server: write: fd misuse", .{}); try comms.send(writer, @as(i32, -std.os.EBADF)); continue; } if (len > comms.max_write_bytes) { @panic("Writing too many bytes!"); } if (!enable_writing) { std.log.info("Server: write: writing with writing disabled!", .{}); try comms.send(writer, @as(i32, -std.os.EPERM)); continue; } var buf = std.mem.span(&data_buffer)[0..len]; try comms.recvinto(reader, buf); try comms.send(writer, @bitCast(i32, @truncate(u32, std.os.linux.pwrite(fd, buf.ptr, buf.len, foff)))); }, .unlink => { const path = try comms.recvpath(reader); if (!enable_writing) { std.log.info("Server: unlink: writing with writing disabled!", .{}); try comms.send(writer, @as(i32, -std.os.EPERM)); continue; } try comms.send(writer, @bitCast(i32, @truncate(u32, std.os.linux.unlink(path.ptr())))); }, .truncate => { const fd = try comms.recv(reader, i32); const new_size = try comms.recv(reader, c_long); if (!valid_client_fd(fd)) { std.log.info("Server: write: fd misuse", .{}); try comms.send(writer, @as(i32, -std.os.EBADF)); continue; } if (!enable_writing) { std.log.info("Server: truncate: writing with writing disabled!", .{}); try comms.send(writer, @as(i32, -std.os.EPERM)); continue; } try comms.send(writer, @bitCast(i32, @truncate(u32, std.os.linux.ftruncate(fd, new_size)))); }, .mkdir => { const path = try comms.recvpath(reader); const mode = @intCast(u32, try comms.recv(reader, std.os.mode_t)); if (!enable_writing) { std.log.info("Server: mkdir: writing with writing disabled!", .{}); try comms.send(writer, @as(i32, -std.os.EPERM)); continue; } try comms.send(writer, @bitCast(i32, @truncate(u32, std.os.linux.mkdir(path.ptr(), mode)))); }, .rename => { const p1 = try comms.recvpath(reader); const p2 = try comms.recvpath(reader); if (!enable_writing) { std.log.info("Server: rename: writing with writing disabled!", .{}); try comms.send(writer, @as(i32, -std.os.EPERM)); continue; } try comms.send(writer, @bitCast(i32, @truncate(u32, std.os.linux.rename(p1.ptr(), p2.ptr())))); }, .rmdir => { const path = try comms.recvpath(reader); if (!enable_writing) { std.log.info("Server: unlink: writing with writing disabled!", .{}); try comms.send(writer, @as(i32, -std.os.EPERM)); continue; } try comms.send(writer, @bitCast(i32, @truncate(u32, std.os.linux.rmdir(path.ptr())))); }, .close => { const fd = try comms.recv(reader, i32); if (!valid_client_fd(fd)) { std.log.info("Server: write: fd misuse", .{}); try comms.send(writer, @as(i32, -std.os.EBADF)); continue; } try comms.send(writer, @bitCast(i32, @truncate(u32, std.os.linux.close(fd)))); }, // Anything else is illegal _ => std.os.exit(1), } } }
src/server.zig
const std = @import("std"); const zig_geojson = @import("main.zig"); const Parser = zig_geojson.Parser; const BBox = zig_geojson.Parser; const Point = zig_geojson.Point; test "simple feature" { const json = \\{ \\ "type": "Feature", \\ "id": "simple feature", \\ "geometry": { \\ "type": "Point", \\ "coordinates": [125.6, 10.1] \\ } \\} ; var geojson = try Parser.parse(json, std.testing.allocator); defer geojson.deinit(); try std.testing.expect(geojson.content == .feature); const feature = geojson.feature().?; try std.testing.expectEqualStrings(feature.id.?.string, "simple feature"); try std.testing.expectEqual(feature.geometry.point, Point{ 125.6, 10.1 }); } test "properties" { const json = \\{ \\ "type": "Feature", \\ "geometry": null, \\ "properties": { \\ "stringProp": "stringValue", \\ "floatProp": 1234.567, \\ "integerProp": 89, \\ "objectProp": { \\ "innerString": "innerStringValue" \\ }, \\ "arrayProp": [ \\ "stringValue", \\ 1234.567, \\ 89, \\ { \\ "innerString": "innerStringValue" \\ } \\ ] \\ } \\} ; var geojson = try Parser.parse(json, std.testing.allocator); defer geojson.deinit(); try std.testing.expect(geojson.feature() != null); const feature = geojson.feature().?; try std.testing.expect(feature.properties != null); const properties = feature.properties.?; try std.testing.expectEqualStrings(properties.get("stringProp").?.string, "stringValue"); try std.testing.expectEqual(properties.get("floatProp").?.float, 1234.567); try std.testing.expectEqual(properties.get("integerProp").?.int, 89); const object = properties.get("objectProp").?.object; try std.testing.expectEqualStrings(object.get("innerString").?.string, "innerStringValue"); const array = properties.get("arrayProp").?.array; try std.testing.expectEqualStrings(array[0].string, "stringValue"); try std.testing.expectEqual(array[1].float, 1234.567); try std.testing.expectEqual(array[2].int, 89); try std.testing.expectEqualStrings(array[3].object.get("innerString").?.string, "innerStringValue"); } test "geometries" { const json = \\{ \\ "type": "Feature", \\ "bbox": [100.0, 0.0, 103.0, 3.0], \\ "id": 7331, \\ "geometry": { \\ "type": "GeometryCollection", \\ "geometries": [ \\ { \\ "type": "Point", \\ "coordinates": [100.0, 0.0] \\ }, \\ { \\ "type": "LineString", \\ "coordinates": [ \\ [101.0, 0.0], \\ [102.0, 1.0] \\ ] \\ }, \\ { \\ "type": "Polygon", \\ "coordinates": [ \\ [ \\ [100.0, 0.0], \\ [101.0, 0.0], \\ [101.0, 1.0], \\ [100.0, 1.0], \\ [100.0, 0.0] \\ ], \\ [ \\ [100.8, 0.8], \\ [100.8, 0.2], \\ [100.2, 0.2], \\ [100.2, 0.8], \\ [100.8, 0.8] \\ ] \\ ] \\ }, \\ { \\ "type": "MultiPoint", \\ "coordinates": [ \\ [100.0, 0.0], \\ [101.0, 1.0] \\ ] \\ }, \\ { \\ "type": "MultiLineString", \\ "coordinates": [ \\ [ \\ [100.0, 0.0], \\ [101.0, 1.0] \\ ], \\ [ \\ [102.0, 2.0], \\ [103.0, 3.0] \\ ] \\ ] \\ }, \\ { \\ "type": "MultiPolygon", \\ "coordinates": [ \\ [ \\ [ \\ [102.0, 2.0], \\ [103.0, 2.0], \\ [103.0, 3.0], \\ [102.0, 3.0], \\ [102.0, 2.0] \\ ] \\ ], \\ [ \\ [ \\ [100.0, 0.0], \\ [101.0, 0.0], \\ [101.0, 1.0], \\ [100.0, 1.0], \\ [100.0, 0.0] \\ ] \\ ] \\ ] \\ } \\ ] \\ } \\} ; var geojson = try Parser.parse(json, std.heap.page_allocator); defer geojson.deinit(); const bbox = BBox{ .min = .{ 100.0, 0.0 }, .max = .{ 103.0, 3.0 } }; try std.testing.expectEqual(geojson.bbox.?, bbox); const point = Point{ 100.0, 0.0 }; const lineString = [_]Point{ .{ 101.0, 0.0 }, .{ 102.0, 1.0 }, }; const polygon = [_][5]Point{ [_]Point{ .{ 100.0, 0.0 }, .{ 101.0, 0.0 }, .{ 101.0, 1.0 }, .{ 100.0, 1.0 }, .{ 100.0, 0.0 }, }, [_]Point{ .{ 100.8, 0.8 }, .{ 100.8, 0.2 }, .{ 100.2, 0.2 }, .{ 100.2, 0.8 }, .{ 100.8, 0.8 }, }, }; const multiPoint = [_]Point{ .{ 100.0, 0.0 }, .{ 101.0, 1.0 }, }; const multiLineString = [_][2]Point{ [_]Point{ .{ 100.0, 0.0 }, .{ 101.0, 1.0 }, }, [_]Point{ .{ 102.0, 2.0 }, .{ 103.0, 3.0 }, }, }; const multiPolygon = [_][1][5]Point{ [1][5]Point{ [_]Point{ .{ 102.0, 2.0 }, .{ 103.0, 2.0 }, .{ 103.0, 3.0 }, .{ 102.0, 3.0 }, .{ 102.0, 2.0 }, }, }, [1][5]Point{ [_]Point{ .{ 100.0, 0.0 }, .{ 101.0, 0.0 }, .{ 101.0, 1.0 }, .{ 100.0, 1.0 }, .{ 100.0, 0.0 }, }, }, }; const id: i64 = 7331; const feature = geojson.feature().?; try std.testing.expectEqual(id, feature.id.?.int); for (feature.geometry.geometry_collection) |g| { switch (g) { .point => |value| try std.testing.expectEqual(point, value), .line_string => |value| try std.testing.expectEqualSlices(Point, &lineString, value), .polygon => |value| for (value) |ring, idx| try std.testing.expectEqualSlices(Point, &polygon[idx], ring), .multi_point => |value| try std.testing.expectEqualSlices(Point, &multiPoint, value), .multi_line_string => |value| for (value) |lineStr, idx| try std.testing.expectEqualSlices(Point, &multiLineString[idx], lineStr), .multi_polygon => |value| for (value) |poly, pidx| for (poly) |slice, idx| try std.testing.expectEqualSlices(Point, &multiPolygon[pidx][idx], slice), else => unreachable, } } }
src/tests.zig
pub const AsynGetDataFlag = extern enum { DoNotFlush, }; pub const Blend = extern enum { Zero = 1, One = 2, SrcColor = 3, InvSrcColor = 4, SrcAlpha = 5, InvSrcAlpha = 6, DestAlpha = 7, InvDestAlpha = 8, DestColor = 9, InvDestColor = 10, SrcAlphaSat = 11, BlendFactor = 14, InvBlendFactor = 15, Src1Color = 16, InvSrc1Color = 17, Src1Alpha = 18, InvSrc1Alpha = 19, }; pub const BlendOp = extern enum { Add = 1, Subtract = 2, RevSubtract = 3, Min = 4, Max = 5, }; pub const ClearFlag = extern enum { Depth = 1, Stencil = 2, }; pub const ColorWriteEnable = extern enum { Red = 1, Green = 2, Blue = 4, Alpha = 8, All = 15, }; pub const ComparisonFunc = extern enum { Never = 1, Less = 2, Equal = 3, LessEqual = 4, Greater = 5, NotEqual = 6, GreaterEqual = 7, Always = 8, }; pub const ConservativeRasterizationMode = extern enum { Off = 0, On = 1, }; pub const ConservativeRasterizationTier = extern enum { NotSupported = 0, One = 1, Two = 2, Three = 3, }; pub const ContextType = extern enum { All = 0, ThreeD = 1, Compute = 2, Copy = 3, Video = 4, }; pub const CopyFlags = extern enum { NoOverwrite = 1, Discard = 2, }; pub const Counter = extern enum { DeviceDependent0 = 1073741824, }; pub const CounterType = extern enum { Float32 = 0, Uint16 = 1, Uint32 = 2, Uint64 = 3, }; pub const CreateDeviceFlag = extern enum { SingleThreaded = 1, Debug = 2, SwitchToRef = 4, PreventInternalThreadingOptimizations = 8, BGRASupport = 32, Debuggable = 64, PreventAlteringLayerSettingsFromRegistry = 128, DisableGPUTimeout = 256, VideoSupport = 2048, }; pub const CreateDeviceContextStateFlag = extern enum { SingleThreaded = 1, }; pub const CullMode = extern enum { None = 1, Front = 2, Back = 3, }; pub const DepthWriteMask = extern enum { Zero = 0, All = 1, }; pub const DeviceContextType = extern enum { Immediate = 0, Deferred = 1, }; pub const Feature = extern enum { Threading = 0, Doubles = 1, FormatSupport = 2, FormatSupport2 = 3, D3D10XHardwareOptions = 4, D3D11Options = 5, ArchitectureInfo = 6, D3D9Options = 7, ShaderMinPrecisionSupport = 8, D3D9ShadowSupport = 9, D3D11Options1 = 10, D3D9SimpleInstancingSupport = 11, MarkerSupport = 12, D3D9Options1 = 13, D3D11Options2 = 14, D3D11Options3 = 15, GpuVirtualAddressSupport = 16, D3D11Options4 = 17, ShaderCache = 18, }; pub const FenceFlag = extern enum { None = 0, Shared = 2, SharedCrossAdapter = 4, NonMonitored = 8, }; pub const FillMode = extern enum { Wireframe = 2, Solid = 3, }; pub const Filter = extern enum { MinMagMipPoint = 0, MinMagPointMipLinear = 1, MinPointMagLinearMipPoint = 4, MinPointMagMipLinear = 5, MinLinearMagMipPoint = 16, MinLinearMagPointMipLinear = 17, MinMagLinearMipPoint = 20, MinMagMipLinear = 21, Anisotropic = 85, ComparisonMinMagMipPoint = 128, ComparisonMinMagPointMipLinear = 129, ComparisonMinPointMagLinearMipPoint = 132, ComparisonMinPointMagMipLinear = 133, ComparisonMinLinearMagMipPoint = 144, ComparisonMinLinearMagPointMipLinear = 145, ComparisonMinMagLinearMipPoint = 148, ComparisonMinMagMipLinear = 149, ComparisonAnisotropic = 213, }; pub const FilterType = extern enum { Point = 0, Linear = 1, }; pub const FilterReductionType = extern enum { Standard = 0, Comparison = 1, Minimum = 2, Maximum = 3, }; pub const FormatSupport = extern enum { Buffer = 1, IAVertexBuffer = 2, IAIndexBuffer = 4, SOBuffer = 8, Texture1d = 16, Texture2d = 32, Texture3d = 64, Texturecube = 128, ShaderLoad = 256, ShaderSample = 512, ShaderSampleComparison = 1024, ShaderSampleMonoText = 2048, Mip = 4096, MipAutogen = 8192, RenderTarget = 16384, Blendable = 32768, DepthStencil = 65536, CPULockable = 131072, MultisampleResolve = 262144, Display = 524288, CastWithinBitLayout = 1048576, MultisampleRendertarget = 2097152, MultisampleLoad = 4194304, ShaderGather = 8388608, BackBufferCast = 16777216, TypedUnorderedAccessView = 33554432, ShaderGatherComparison = 67108864, DecoderOutput = 134217728, VideoProcessorOutput = 268435456, VideoProcessorInput = 536870912, VideoEncoder = 1073741824, }; pub const FormatSupport2 = extern enum { UAVAtomicAdd = 1, UAVAtomicBitwiseOps = 2, UAVAtomicCompareStoreOrCompareExchange = 4, UAVAtomicExchange = 8, UAVAtomicSignedMinOrMax = 16, UAVAtomicUnsignedMinOrMax = 32, UAVTypedLoad = 64, UAVTypedStore = 128, OutputMergerLogicOp = 256, Tiled = 512, Shareable = 1024, MultiplaneOverlay = 16384, }; pub const InputClassification = extern enum { PerVertexData = 0, PerInstanceData = 1, }; pub const LogicOp = extern enum { Clear = 0, Set = 1, Copy = 2, CopyInverted = 3, Noop = 4, Invert = 5, And = 6, Nand = 7, Or = 8, Nor = 9, Xor = 10, Equiv = 11, AndReverse = 12, AndInverted = 13, OrReverse = 14, OrInverted = 15, }; pub const Primitive = extern enum { Undefined = 0, Point = 1, Line = 2, Triangle = 3, LineAdj = 6, TriangleAdj = 7, ControlPointPatch1 = 8, ControlPointPatch2 = 9, ControlPointPatch3 = 10, ControlPointPatch4 = 11, ControlPointPatch5 = 12, ControlPointPatch6 = 13, ControlPointPatch7 = 14, ControlPointPatch8 = 15, ControlPointPatch9 = 16, ControlPointPatch10 = 17, ControlPointPatch11 = 18, ControlPointPatch12 = 19, ControlPointPatch13 = 20, ControlPointPatch14 = 21, ControlPointPatch15 = 22, ControlPointPatch16 = 23, ControlPointPatch17 = 24, ControlPointPatch18 = 25, ControlPointPatch19 = 26, ControlPointPatch20 = 27, ControlPointPatch21 = 28, ControlPointPatch22 = 29, ControlPointPatch23 = 30, ControlPointPatch24 = 31, ControlPointPatch25 = 32, ControlPointPatch26 = 33, ControlPointPatch27 = 34, ControlPointPatch28 = 35, ControlPointPatch29 = 36, ControlPointPatch30 = 37, ControlPointPatch31 = 38, ControlPointPatch32 = 39, }; pub const PrimitiveTopology = extern enum { Undefined = 0, Pointlist = 1, Linelist = 2, Linestrip = 3, Trianglelist = 4, Trianglestrip = 5, LinelistAdj = 10, LinestripAdj = 11, TrianglelistAdj = 12, TrianglestripAdj = 13, ControlPointPatchlist1 = 33, ControlPointPatchlist2 = 34, ControlPointPatchlist3 = 35, ControlPointPatchlist4 = 36, ControlPointPatchlist5 = 37, ControlPointPatchlist6 = 38, ControlPointPatchlist7 = 39, ControlPointPatchlist8 = 40, ControlPointPatchlist9 = 41, ControlPointPatchlist10 = 42, ControlPointPatchlist11 = 43, ControlPointPatchlist12 = 44, ControlPointPatchlist13 = 45, ControlPointPatchlist14 = 46, ControlPointPatchlist15 = 47, ControlPointPatchlist16 = 48, ControlPointPatchlist17 = 49, ControlPointPatchlist18 = 50, ControlPointPatchlist19 = 51, ControlPointPatchlist20 = 52, ControlPointPatchlist21 = 53, ControlPointPatchlist22 = 54, ControlPointPatchlist23 = 55, ControlPointPatchlist24 = 56, ControlPointPatchlist25 = 57, ControlPointPatchlist26 = 58, ControlPointPatchlist27 = 59, ControlPointPatchlist28 = 60, ControlPointPatchlist29 = 61, ControlPointPatchlist30 = 62, ControlPointPatchlist31 = 63, ControlPointPatchlist32 = 64, }; pub const Query = extern enum { Event = 0, Occlusion = 1, Timestamp = 2, TimestampDisjoint = 3, PipelineStatistics = 4, OcclusionPredicate = 5, SOStatistics = 6, SOOverflowPredicate = 7, SOStatisticsStream0 = 8, SOOverflowPredicateStream0 = 9, SOStatisticsStream1 = 10, SOOverflowPredicateStream1 = 11, SOStatisticsStream2 = 12, SOOverflowPredicateStream2 = 13, SOStatisticsStream3 = 14, SOOverflowPredicateStream3 = 15, }; pub const QueryMiscFlag = extern enum { PredicateHint = 1, }; pub const RaiseFlag = extern enum { DriverInternalError = 1, }; pub const ShaderCacheSupportFlags = extern enum { None = 0, AutomaticInprocCache = 1, AutomaticDiskCache = 2, }; pub const MinPrecisionSupport = extern enum { Precision10Bit = 1, Precision16Bit = 2, }; pub const StencilOp = extern enum { Keep = 1, Zero = 2, Replace = 3, IncrSat = 4, DecrSat = 5, Invert = 6, Incr = 7, Decr = 8, }; pub const TextureAddressMode = extern enum { Wrap = 1, Mirror = 2, Clamp = 3, Border = 4, MirrorOnce = 5, }; pub const TextureCubeFace = extern enum { PositiveX = 0, NegativeX = 1, PositiveY = 2, NegativeY = 3, PositiveZ = 4, NegativeZ = 5, }; pub const TiledResourcesTier = extern enum { NotSupported = 0, One = 1, Two = 2, Three = 3, };
directx11/core/enum.zig
pub const heart = "\u{F004}"; pub const star = "\u{F005}"; pub const person = "\u{F007}"; pub const clock = "\u{F017}"; pub const list = "\u{F022}"; pub const flag = "\u{F024}"; pub const bookmark = "\u{F02E}"; pub const bitmap = "\u{F03E}"; pub const edit = "\u{F044}"; pub const circledCross = "\u{F057}"; pub const circledCheckmark = "\u{F058}"; pub const circledQuestionmark = "\u{F059}"; pub const eye = "\u{F06E}"; pub const eyeSlash = "\u{F070}"; pub const calendar = "\u{F073}"; pub const speechBalloon = "\u{F075}"; pub const folderClosed = "\u{F07B}"; pub const folderOpen = "\u{F07C}"; pub const chartBar = "\u{F080}"; pub const conversationBalloons = "\u{F086}"; pub const starHalf = "\u{F089}"; pub const lemon = "\u{F094}"; pub const creditCard = "\u{F09D}"; pub const hdd = "\u{F0A0}"; pub const fingerPointingRight = "\u{F0A4}"; pub const fingerPointingLeft = "\u{F0A5}"; pub const fingerPointingUp = "\u{F0A6}"; pub const fingerPointingDown = "\u{F0A7}"; pub const copy = "\u{F0C5}"; pub const save = "\u{F0C7}"; pub const boxBlank = "\u{F0C8}"; pub const mail = "\u{F0E0}"; pub const lightbulb = "\u{F0EB}"; pub const bell = "\u{F0F3}"; pub const hospital = "\u{F0F8}"; pub const boxPlus = "\u{F0FE}"; pub const circle = "\u{F111}"; pub const faceSmile = "\u{F118}"; pub const faceSad = "\u{F119}"; pub const faceNeutral = "\u{F11A}"; pub const keyboard = "\u{F11C}"; pub const calendarBlank = "\u{F133}"; pub const play = "\u{F144}"; pub const boxMinus = "\u{F146}"; pub const boxCheckmark = "\u{F14A}"; pub const boxShare = "\u{F14D}"; pub const compass = "\u{F14E}"; pub const boxDown = "\u{F150}"; pub const boxUp = "\u{F151}"; pub const boxRight = "\u{F152}"; pub const newFile = "\u{F15B}"; pub const newFileDocument = "\u{F15C}"; pub const thumbsUp = "\u{F164}"; pub const thumbsDown = "\u{F165}"; pub const settingsCog = "\u{F185}"; pub const nightMode = "\u{F186}"; pub const boxLeft = "\u{F191}"; pub const circleDot = "\u{F192}"; pub const building = "\u{F1AD}"; pub const newFilePdf = "\u{F1C1}"; pub const newFileWord = "\u{F1C2}"; pub const newFileExcel = "\u{F1C3}"; pub const newFilePowerPoint = "\u{F1C4}"; pub const newFileBitmap = "\u{F1C5}"; pub const newFileZip = "\u{F1C6}"; pub const newFileSound = "\u{F1C7}"; pub const newFileVideo = "\u{F1C8}"; pub const newFileCode = "\u{F1C9}"; pub const lifePreserver = "\u{F1CD}"; pub const paperPlane = "\u{F1D8}"; pub const football = "\u{F1E3}"; pub const newspaper = "\u{F1EA}"; pub const bellMute = "\u{F1F6}"; pub const copyright = "\u{F1F9}"; pub const closedCaptions = "\u{F20A}"; pub const group = "\u{F247}"; pub const ungroup = "\u{F248}"; pub const stickyNote = "\u{F249}"; pub const clone = "\u{F24D}"; pub const hourglass = "\u{F254}"; pub const handGrab = "\u{F255}"; pub const handNeutral = "\u{F256}"; pub const handScissor = "\u{F257}"; pub const handLizard = "\u{F258}"; pub const handSpock = "\u{F259}"; pub const handPoint = "\u{F25A}"; pub const handPeace = "\u{F25B}"; pub const registerIcon = "\u{F25D}"; pub const calendarPlus = "\u{F271}"; pub const calendarMinus = "\u{F272}"; pub const calendarCrossed = "\u{F273}"; pub const calendarCheckmark = "\u{F274}"; pub const map = "\u{F279}"; pub const speechBalloonSquared = "\u{F27A}"; pub const pause = "\u{F28B}"; pub const stop = "\u{F28D}"; pub const handShake = "\u{F2B5}"; pub const mailOpen = "\u{F2B6}"; pub const contactBook = "\u{F2B9}"; pub const contactCard = "\u{F2BB}"; pub const contactCircle = "\u{F2BD}"; pub const contactBadge = "\u{F2C1}"; pub const contactBusinessCard = "\u{F2C2}"; pub const windowMaximize = "\u{F2D0}"; pub const windowMinimize = "\u{F2D1}"; pub const windowRestore = "\u{F2D2}"; pub const snowflake = "\u{F2DC}"; pub const trash = "\u{F2ED}"; pub const imageStack = "\u{F302}"; pub const clipboard = "\u{F328}"; pub const circleDown = "\u{F358}"; pub const circleLeft = "\u{F359}"; pub const circleRight = "\u{F35A}"; pub const circleUp = "\u{F35B}"; pub const diamond = "\u{F3A5}"; pub const paperMoney = "\u{F3D1}"; pub const windowClose = "\u{F410}"; pub const speechBalloonDots = "\u{F4AD}";
src/icon.zig
const std = @import("std"); const pike = @import("pike"); const io = @import("io.zig"); const sync = @import("sync.zig"); const net = std.net; const meta = std.meta; pub const Side = packed enum(u1) { client, server, }; pub const Options = struct { max_connections_per_client: usize = 16, max_connections_per_server: usize = 128, protocol_type: type = void, message_type: type = []const u8, context_type: type = void, write_queue_size: usize = 128, read_buffer_size: usize = 4 * 1024 * 1024, write_buffer_size: usize = 4 * 1024 * 1024, }; pub fn yield() void { suspend { var task = pike.Task.init(@frame()); pike.dispatch(&task, .{ .use_lifo = true }); } } pub fn Socket(comptime side: Side, comptime opts: Options) type { return struct { const Self = @This(); pub const Reader = io.Reader(pike.Socket, opts.read_buffer_size); pub const Writer = io.Writer(pike.Socket, opts.write_buffer_size); const WriteQueue = sync.Queue(opts.message_type, opts.write_queue_size); const Protocol = opts.protocol_type; const Context = opts.context_type; inner: pike.Socket, address: net.Address, context: Context = undefined, write_queue: WriteQueue = .{}, pub fn init(inner: pike.Socket, address: net.Address) Self { return Self{ .inner = inner, .address = address }; } pub fn deinit(self: *Self) void { self.inner.deinit(); } pub inline fn unwrap(self: *Self) *pike.Socket { return &self.inner; } pub fn write(self: *Self, message: opts.message_type) !void { try self.write_queue.push(message); } pub fn run(self: *Self, protocol: Protocol) !void { var reader = Reader.init(self.unwrap()); var writer = async self.runWriter(protocol); defer { self.write_queue.close(); await writer catch {}; } yield(); try protocol.read(side, self, &reader); } fn runWriter(self: *Self, protocol: Protocol) !void { var writer = Writer.init(self.unwrap()); var queue: @TypeOf(self.write_queue.items) = undefined; while (true) { const num_items = try self.write_queue.pop(queue[0..]); try protocol.write(side, self, &writer, queue[0..num_items]); } } }; }
socket.zig
const std = @import("std"); pub const BuildOptions = struct { enable_ztracy: bool = false, enable_fibers: bool = false, }; pub const BuildOptionsStep = struct { options: BuildOptions, step: *std.build.OptionsStep, pub fn init(b: *std.build.Builder, options: BuildOptions) BuildOptionsStep { const bos = .{ .options = options, .step = b.addOptions(), }; bos.step.addOption(bool, "enable_ztracy", bos.options.enable_ztracy); return bos; } pub fn getPkg(bos: BuildOptionsStep) std.build.Pkg { return bos.step.getPackage("ztracy_options"); } fn addTo(bos: BuildOptionsStep, target_step: *std.build.LibExeObjStep) void { target_step.addOptions("ztracy_options", bos.step); } }; pub fn getPkg(dependencies: []const std.build.Pkg) std.build.Pkg { return .{ .name = "ztracy", .source = .{ .path = thisDir() ++ "/src/ztracy.zig" }, .dependencies = dependencies, }; } pub fn link(exe: *std.build.LibExeObjStep, bos: BuildOptionsStep) void { bos.addTo(exe); if (bos.options.enable_ztracy) { const enable_fibers = if (bos.options.enable_fibers) "-DTRACY_FIBERS" else ""; exe.addIncludeDir(thisDir() ++ "/libs/tracy"); exe.addCSourceFile(thisDir() ++ "/libs/tracy/TracyClient.cpp", &.{ "-DTRACY_ENABLE", enable_fibers, // MinGW doesn't have all the newfangled windows features, // so we need to pretend to have an older windows version. "-D_WIN32_WINNT=0x601", "-fno-sanitize=undefined", }); exe.linkSystemLibrary("c"); exe.linkSystemLibrary("c++"); if (exe.target.isWindows()) { exe.linkSystemLibrary("Advapi32"); exe.linkSystemLibrary("User32"); exe.linkSystemLibrary("Ws2_32"); exe.linkSystemLibrary("DbgHelp"); } } } fn thisDir() []const u8 { comptime { return std.fs.path.dirname(@src().file) orelse "."; } }
libs/ztracy/build.zig
const std = @import("std"); const stdx = @import("stdx"); const t = stdx.testing; const walk = @import("walk.zig"); const walk_iterator = @import("walk_iterator.zig"); pub const walkPre = walk.walkPre; pub const walkPost = walk.walkPost; pub const walkPreAlloc = walk.walkPreAlloc; pub const walkPrePost = walk.walkPrePost; pub const Walker = walk.Walker; pub const WalkerContext = walk.WalkerContext; pub const VisitContext = walk.VisitContext; pub const WalkIterator = walk_iterator.WalkIterator; const walk_recursive = @import("walk_recursive.zig"); pub const recursive = struct { pub const searchPreMany = walk_recursive.searchPreMany; pub const ChildArrayListSearchWalker = walk_recursive.ChildArrayListSearchWalker; pub const walkPost = walk_recursive.walkPost; pub const walkPrePost = walk_recursive.walkPrePost; pub const walkPreMany = walk_recursive.walkPreMany; pub const walkPrePostMany = walk_recursive.walkPrePostMany; pub const ChildArrayListWalker = walk_recursive.ChildArrayListWalker; pub const Walker = walk_recursive.Walker; pub const WalkContext = walk_recursive.WalkContext; }; // For binarySearch, use std.sort.binarySearch // compare function should return .lt if the target idx is before the current idx. pub fn binarySearchByIndex(len: usize, target: anytype, ctx: anytype, compare: fn (@TypeOf(ctx), @TypeOf(target), usize) std.math.Order) ?usize { var start: usize = 0; var end = len; while (start < end) { const mid = start + (end - start) / 2; switch (compare(ctx, target, mid)) { .eq => return mid, .gt => start = mid + 1, .lt => end = mid, } } return null; } /// Returns the in-order insert index that would preserve a sorted list for a given insert value. /// insert value is the first arg in less. pub fn binarySearchInsertIdx(comptime T: type, arr: []const T, value: T, ctx: anytype, less: fn (@TypeOf(ctx), T, T) bool) usize { if (arr.len == 0) { return 0; } var start: usize = 0; // end is exclusive. var end = arr.len; while (start < end) { const mid_idx = (start + end) / 2; if (less(ctx, value, arr[mid_idx])) { end = mid_idx; } else { start = mid_idx + 1; } } return start; } test "binarySearchInsertIdx" { try t.eqT(usize, binarySearchInsertIdx(u32, &[_]u32{}, 1, {}, std.sort.asc(u32)), 0); try t.eqT(usize, binarySearchInsertIdx(u32, &[_]u32{ 1, 3, 5, 7, 9 }, 0, {}, std.sort.asc(u32)), 0); try t.eqT(usize, binarySearchInsertIdx(u32, &[_]u32{ 1, 3, 5, 7, 9 }, 1, {}, std.sort.asc(u32)), 1); try t.eqT(usize, binarySearchInsertIdx(u32, &[_]u32{ 1, 3, 5, 7, 9 }, 2, {}, std.sort.asc(u32)), 1); try t.eqT(usize, binarySearchInsertIdx(u32, &[_]u32{ 1, 3, 5, 7, 9 }, 3, {}, std.sort.asc(u32)), 2); try t.eqT(usize, binarySearchInsertIdx(u32, &[_]u32{ 1, 3, 5, 7, 9 }, 4, {}, std.sort.asc(u32)), 2); try t.eqT(usize, binarySearchInsertIdx(u32, &[_]u32{ 1, 3, 5, 7, 9 }, 5, {}, std.sort.asc(u32)), 3); try t.eqT(usize, binarySearchInsertIdx(u32, &[_]u32{ 1, 3, 5, 7, 9 }, 6, {}, std.sort.asc(u32)), 3); try t.eqT(usize, binarySearchInsertIdx(u32, &[_]u32{ 1, 3, 5, 7, 9 }, 7, {}, std.sort.asc(u32)), 4); try t.eqT(usize, binarySearchInsertIdx(u32, &[_]u32{ 1, 3, 5, 7, 9 }, 8, {}, std.sort.asc(u32)), 4); try t.eqT(usize, binarySearchInsertIdx(u32, &[_]u32{ 1, 3, 5, 7, 9 }, 9, {}, std.sort.asc(u32)), 5); try t.eqT(usize, binarySearchInsertIdx(u32, &[_]u32{ 1, 3, 5, 7, 9 }, 10, {}, std.sort.asc(u32)), 5); // Returns in-order idx. try t.eqT(usize, binarySearchInsertIdx(u32, &[_]u32{ 10, 10, 10, 10 }, 10, {}, std.sort.asc(u32)), 4); try t.eqT(usize, binarySearchInsertIdx(u32, &[_]u32{ 10, 10, 10, 10 }, 9, {}, std.sort.asc(u32)), 0); try t.eqT(usize, binarySearchInsertIdx(u32, &[_]u32{ 10, 10, 10, 10 }, 11, {}, std.sort.asc(u32)), 4); }
stdx/algo/algo.zig
const std = @import("std"); const os = std.os; const windows = struct { usingnamespace std.os.windows; // docs: https://docs.microsoft.com/en-us/windows/win32/memory/creating-named-shared-memory pub extern "kernel32" fn CreateFileMappingW(hFile: HANDLE, lpFileMappingAttributes: [*c]SECURITY_ATTRIBUTES, flProtect: DWORD, dwMaximumSizeHigh: DWORD, dwMaximumSizeLow: DWORD, lpName: [*c]WCHAR) HANDLE; pub extern "kernel32" fn CreateFileMappingA(hFile: HANDLE, lpFileMappingAttributes: [*c]SECURITY_ATTRIBUTES, flProtect: DWORD, dwMaximumSizeHigh: DWORD, dwMaximumSizeLow: DWORD, lpName: [*c]CSTR) HANDLE; pub extern "kernel32" fn OpenFileMappingA(hFile: HANDLE, lpFileMappingAttributes: LPSECURITY_ATTRIBUTES, flProtect: DWORD, dwMaximumSizeHigh: DWORD, dwMaximumSizeLow: DWORD, lpName: LPCSTR) HANDLE; pub extern "kernel32" fn OpenFileMappingW(dwDesiredAccess: DWORD, bInheritHandle: BOOL, lpName: LPCWSTR) HANDLE; pub extern "kernel32" fn MapViewOfFile(hFileMappingObject: HANDLE, dwDesiredAccess: DWORD, dwFileOffsetHigh: DWORD, dwFileOffsetLow: DWORD, dwNumberOfBytesToMap: SIZE_T) [*c]align(std.mem.page_size) u8; pub extern "kernel32" fn UnmapViewOfFile(lpBaseAddress: LPCVOID) BOOL; // OpenFile const OF_READ: u32 = 0; const OF_READWRITE: u32 = 0x00000002; const OF_WRITE = 0x00000001; // from wint.h const SECTION_QUERY: u32 = 0x0001; const SECTION_MAP_WRITE: u32 = 0x0002; const SECTION_MAP_READ: u32 = 0x0004; const SECTION_MAP_EXECUTE: u32 = 0x0008; const SECTION_EXTEND_SIZE: u32 = 0x0010; const SECTION_MAP_EXECUTE_EXPLICIT: u32 = 0x0020; // not included in SECTION_ALL_ACCESS const SECTION_ALL_ACCESS: u32 = (STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_WRITE | SECTION_MAP_READ | SECTION_MAP_EXECUTE | SECTION_EXTEND_SIZE); // from memoryapi.h const FILE_MAP_WRITE: u32 = SECTION_MAP_WRITE; const FILE_MAP_READ: u32 = SECTION_MAP_READ; const FILE_MAP_ALL_ACCESS: u32 = SECTION_ALL_ACCESS; const FILE_MAP_EXECUTE: u32 = SECTION_MAP_EXECUTE_EXPLICIT; // not included in FILE_MAP_ALL_ACCESS const FILE_MAP_COPY: u32 = 0x00000001; const FILE_MAP_RESERVE: u32 = 0x80000000; const FILE_MAP_TARGETS_INVALID: u32 = 0x40000000; const FILE_MAP_LARGE_PAGES: u32 = 0x20000000; }; pub const FMapper = struct { pub const MapError = error{ InavalidFlags, CantMap }; pub const Cfg = struct { // TODO: modes havent been fully tested and might have bugs const Mode = enum { private, // copy on write pages shared, // shares mmap and file exclusive // exclusive file access, fails to open if someone else has opened it. TODO: implement }; read: bool = true, write: bool = false, //create: bool = false, // creates file if one doesnt exist mode: Mode = .shared, }; memory: ?[]align(std.mem.page_size) u8 = null, // whole file when len = 0 pub fn open(path: []const u8, cfg: Cfg, offset: usize, len_: usize) !FMapper { var len = len_; if (comptime std.Target.current.os.tag == .windows) { var flags: u32 = 0; var page_flags: u32 = 0; var map_flags: u32 = 0; if (cfg.read and cfg.write) { flags |= windows.OF_READWRITE; page_flags |= windows.PAGE_READWRITE; map_flags |= windows.FILE_MAP_ALL_ACCESS; } else if (cfg.read) { flags |= windows.OF_READ; page_flags |= windows.FILE_MAP_READ; map_flags |= windows.FILE_MAP_READ; } else if (cfg.write) { flags |= windows.OF_WRITE; page_flags |= windows.PAGE_READWRITE; map_flags |= windows.FILE_MAP_WRITE; } else return MapError.InavalidFlags; switch (cfg.mode) { Cfg.Mode.private => { page_flags |= windows.PAGE_WRITECOPY; map_flags |= windows.FILE_MAP_COPY; }, Cfg.Mode.shared => {}, Cfg.Mode.exclusive => {}, } const fd = try os.open(path, 0, 0); defer os.close(fd); if (len == 0) { const f = std.fs.File{ .handle = fd }; const stat = try f.stat(); len = stat.size; } const map_file = windows.CreateFileMappingW(fd, // use paging file @intToPtr([*c]windows.SECURITY_ATTRIBUTES, 0), // default security page_flags, // read/write access @intCast(u32, len >> 32), @intCast(u32, len & 0xFFFFFFFF), null); // name of mapping object if (map_file == windows.INVALID_HANDLE_VALUE) { const err = std.os.windows.kernel32.GetLastError(); std.debug.warn("error.Unexpected: windows.CreateFileMapping: GetLastError(): {}\n", .{err}); return MapError.CantMap; } defer windows.CloseHandle(map_file); const mapped_ptr = windows.MapViewOfFile(map_file, // handle to map object windows.FILE_MAP_ALL_ACCESS, // read/write permission @intCast(u32, offset >> 32), @intCast(u32, offset & 0xFFFFFFFF), // They must also match the memory allocation granularity of the system TODO: check and report if its invalid len); if (mapped_ptr == null) { const err = std.os.windows.kernel32.GetLastError(); std.debug.warn("error.Unexpected: windows.MapViewOfFile: GetLastError(): {}\n", .{err}); return MapError.CantMap; } const ptr = @ptrCast([*]align(std.mem.page_size) u8, mapped_ptr); return FMapper{ .memory = ptr[0..len] }; } { // std.os / posix const fd = try os.open(path, flags, mflags.mode); defer os.close(fd); if (len == 0) { const f = std.fs.File{ .handle = fd }; len = try f.stat().size; } var prot: u32 = 0; if (cfg.write) prot |= os.PROT_WRITE; if (cfg.read) prot |= os.PROT_READ; var flags: u32 = 0; mapped_ptr = os.mmap(null, len, prot, flags, fd, offset); } } pub fn close(self: FMapper) void { if (std.Target.current.os.tag == .windows) { if (self.memory) |mem| { if (windows.UnmapViewOfFile(@ptrCast(windows.LPCVOID, mem.ptr)) == 0) { windows.unexpectedError(std.os.windows.kernel32.GetLastError()) catch return; } //CloseHandle(self.fd); } return; } if (self.memory) |mem| { // std.os / posix os.unmap(mem.ptr); } } };
src/fmapper.zig
const std = @import("std"); const os = std.os; const fmt = std.fmt; const Writer = std.fs.File.Writer; pub const config = @import("./config.zig"); pub const codes = @import("./codes.zig"); pub const cursor = @import("./cursor.zig"); pub const Color = @import("./Color.zig").Color; pub const Style = @import("./Style.zig").Style; const EscapingSequence = @import("./EscapingSequence.zig").EscapingSequence; // TODO is it ok to have a global stdout? // TODO should'nt it be buffered? Is it already? const stdout = std.io.getStdOut(); // TODO Fg and Bg styling can be done with just one escaping. Improve this function to use minimal escapings pub fn fmtStyle(buf: []u8, str: []const u8, style: Style) std.fmt.BufPrintError![]u8 { var offset: usize = 0; var escapeSequence = EscapingSequence{}; if (style.fgColor) |fgColor| { try escapeSequence.appendCode(foregroundColorEscapeCode(fgColor)); } if (style.bgColor) |bgColor| { try escapeSequence.appendCode(backgroundColorEscapeCode(bgColor)); } if (style.bold) { try escapeSequence.appendCode(codes.graphics.attr.Bold); } if (style.dim) { try escapeSequence.appendCode(codes.graphics.attr.Dim); } if (style.italic) { try escapeSequence.appendCode(codes.graphics.attr.Italic); } if (style.underline) { try escapeSequence.appendCode(codes.graphics.attr.Underline); } if (style.inverse) { try escapeSequence.appendCode(codes.graphics.attr.Inverse); } if (style.hidden) { try escapeSequence.appendCode(codes.graphics.attr.Hidden); } if (style.strikethrough) { try escapeSequence.appendCode(codes.graphics.attr.Strikethrough); } return fmt.bufPrint(buf, "{s}{s}{s}{s}{s}", .{ codes.EscapePrefix, escapeSequence.toSlice(), codes.graphics.SetModeSuffix, str, codes.resetEscapeSequence(), }); } // TODO consider if we will use this function. Is that worth it? (subslicing buf and double writing to memory doesn't seem a good payoff) inline fn fmtGraphicsCode(buf: []u8, code: []const u8) std.fmt.BufPrintError![]u8 { return fmt.bufPrint(buf, "{s}{s}{s}", .{ codes.EscapePrefix, code, codes.graphics.SetModeSuffix, }); } pub fn fmtForegroundRGB(buf: []u8, r: u8, g: u8, b: u8, str: []const u8) std.fmt.BufPrintError![]u8 { var redBuf: [3]u8 = undefined; var greenBuf: [3]u8 = undefined; var blueBuf: [3]u8 = undefined; const redStr = try fmt.bufPrint(redBuf[0..], "{}", .{r}); const greenStr = try fmt.bufPrint(greenBuf[0..], "{}", .{g}); const blueStr = try fmt.bufPrint(blueBuf[0..], "{}", .{b}); return fmtForegroundRGBStr(buf, redStr, greenStr, blueStr, str); } pub fn fmtForegroundRGBStr(buf: []u8, r: []const u8, g: []const u8, b: []const u8, str: []const u8) std.fmt.BufPrintError![]u8 { var escapeSeq = EscapingSequence{}; try escapeSeq.appendCode(codes.color.fg.FgHiColorRGBPreffix); try escapeSeq.appendCode(r); try escapeSeq.appendCode(g); try escapeSeq.appendCode(b); const rgbCode: []const u8 = escapeSeq.toSlice(); return fmt.bufPrint(buf, "{s}{s}{s}{s}{s}", .{ codes.EscapePrefix, rgbCode, codes.graphics.SetModeSuffix, str, codes.resetForegroundEscapeSequence(), }); } pub fn fmtBackgroundRGB(buf: []u8, r: u8, g: u8, b: u8, str: []const u8) std.fmt.BufPrintError![]u8 { var redBuf: [3]u8 = undefined; var greenBuf: [3]u8 = undefined; var blueBuf: [3]u8 = undefined; const redStr = try fmt.bufPrint(redBuf[0..], "{}", .{r}); const greenStr = try fmt.bufPrint(greenBuf[0..], "{}", .{g}); const blueStr = try fmt.bufPrint(blueBuf[0..], "{}", .{b}); return fmtBackgroundRGBStr(buf, redStr, greenStr, blueStr, str); } // TODO consider a numeric API for this pub fn fmtBackgroundRGBStr(buf: []u8, r: []const u8, g: []const u8, b: []const u8, str: []const u8) std.fmt.BufPrintError![]u8 { var escapeSeq = EscapingSequence{}; try escapeSeq.appendCode(codes.color.bg.BgHiColorRGBPreffix); try escapeSeq.appendCode(r); try escapeSeq.appendCode(g); try escapeSeq.appendCode(b); const rgbCode: []const u8 = escapeSeq.toSlice(); return fmt.bufPrint(buf, "{s}{s}{s}{s}{s}", .{ codes.EscapePrefix, rgbCode, codes.graphics.SetModeSuffix, str, codes.resetBackgroundEscapeSequence(), }); } fn fgStyle(buf: []u8, colorCode: []const u8, str: []const u8) std.fmt.BufPrintError![]u8 { return fmt.bufPrint(buf, "{s}{s}{s}{s}{s}", .{ codes.EscapePrefix, colorCode, codes.graphics.SetModeSuffix, str, codes.resetForegroundEscapeSequence(), }); } fn bgStyle(buf: []u8, colorCode: []const u8, str: []const u8) std.fmt.BufPrintError![]u8 { return fmt.bufPrint(buf, "{s}{s}{s}{s}{s}", .{ codes.EscapePrefix, colorCode, codes.graphics.SetModeSuffix, str, codes.resetBackgroundEscapeSequence(), }); } pub inline fn black(buf: []u8, str: []const u8) std.fmt.BufPrintError![]u8 { return fgStyle(buf, codes.color.fg.Black, str); } pub inline fn bgBlack(buf: []u8, str: []const u8) std.fmt.BufPrintError![]u8 { return bgStyle(buf, codes.color.bg.Black, str); } pub inline fn red(buf: []u8, str: []const u8) std.fmt.BufPrintError![]u8 { return fgStyle(buf, codes.color.fg.Red, str); } pub inline fn bgRed(buf: []u8, str: []const u8) std.fmt.BufPrintError![]u8 { return bgStyle(buf, codes.color.bg.Red, str); } pub inline fn green(buf: []u8, str: []const u8) std.fmt.BufPrintError![]u8 { return fgStyle(buf, codes.color.fg.Green, str); } pub inline fn bgGreen(buf: []u8, str: []const u8) std.fmt.BufPrintError![]u8 { return bgStyle(buf, codes.color.bg.Green, str); } pub inline fn yellow(buf: []u8, str: []const u8) std.fmt.BufPrintError![]u8 { return fgStyle(buf, codes.color.fg.Yellow, str); } pub inline fn bgYellow(buf: []u8, str: []const u8) std.fmt.BufPrintError![]u8 { return bgStyle(buf, codes.color.bg.Yellow, str); } pub inline fn blue(buf: []u8, str: []const u8) std.fmt.BufPrintError![]u8 { return fgStyle(buf, codes.color.fg.Blue, str); } pub inline fn bgBlue(buf: []u8, str: []const u8) std.fmt.BufPrintError![]u8 { return bgStyle(buf, codes.color.bg.Blue, str); } pub inline fn magenta(buf: []u8, str: []const u8) std.fmt.BufPrintError![]u8 { return fgStyle(buf, codes.color.fg.Magenta, str); } pub inline fn bgMagenta(buf: []u8, str: []const u8) std.fmt.BufPrintError![]u8 { return bgStyle(buf, codes.color.bg.Magenta, str); } pub inline fn cyan(buf: []u8, str: []const u8) std.fmt.BufPrintError![]u8 { return fgStyle(buf, codes.color.fg.Cyan, str); } pub inline fn bgCyan(buf: []u8, str: []const u8) std.fmt.BufPrintError![]u8 { return bgStyle(buf, codes.color.bg.Cyan, str); } pub inline fn white(buf: []u8, str: []const u8) std.fmt.BufPrintError![]u8 { return fgStyle(buf, codes.color.fg.White, str); } pub inline fn bgWhite(buf: []u8, str: []const u8) std.fmt.BufPrintError![]u8 { return bgStyle(buf, codes.color.bg.White, str); } /// maybe replace this to a static table from Color enum to Color codes pub fn foregroundColorEscapeCode(color: Color) []const u8 { return switch (color) { Color.Black => codes.color.fg.Black, Color.Red => codes.color.fg.Red, Color.Green => codes.color.fg.Green, Color.Yellow => codes.color.fg.Yellow, Color.Blue => codes.color.fg.Blue, Color.Magenta => codes.color.fg.Magenta, Color.Cyan => codes.color.fg.Cyan, Color.White => codes.color.fg.White, }; } /// maybe replace this to a static table from Color enum to Color codes pub fn backgroundColorEscapeCode(color: Color) []const u8 { return switch (color) { Color.Black => codes.color.bg.Black, Color.Red => codes.color.bg.Red, Color.Green => codes.color.bg.Green, Color.Yellow => codes.color.bg.Yellow, Color.Blue => codes.color.bg.Blue, Color.Magenta => codes.color.bg.Magenta, Color.Cyan => codes.color.bg.Cyan, Color.White => codes.color.bg.White, }; } // TODO move to io module pub fn setForegroundColor(color: Color) !void { const colorCode: []const u8 = foregroundColorEscapeCode(color); const w = stdout.writer(); try w.print("{s}{s}{s}", .{ codes.EscapePrefix, colorCode, codes.graphics.SetModeSuffix, }); } // TODO move to io module pub fn setBackgroundColor(color: Color) !void { const colorCode: []const u8 = backgroundColorEscapeCode(color); const w = stdout.writer(); try w.print("{s}{s}{s}", .{ codes.EscapePrefix, colorCode, codes.graphics.SetModeSuffix, }); } // TODO writer anytype pub fn resetGraphics() !void { const escapeSequence: []const u8 = comptime codes.resetEscapeSequence(); try writeSequence(escapeSequence); } fn writeSequence(escapeSequence: []const u8) !void { const writtenBytes: usize = try stdout.write(escapeSequence); if (writtenBytes != escapeSequence.len) { return error.WriteError; } } test "foreground colors" { const w = std.io.getStdErr().writer(); try setForegroundColor(Color.Red); try w.writeAll("red"); try resetGraphics(); // TODO if this buffer is shared between an expression (for example: one w.print with multuple formats), // then this will break. var tmpBuf: [100]u8 = undefined; try w.print(" {s}", .{ try green(&tmpBuf, "green") }); try w.print(" {s}", .{ try yellow(&tmpBuf, "yellow") }); try w.print(" {s}", .{ try blue(&tmpBuf, "blue") }); try w.print(" {s}", .{ try magenta(&tmpBuf, "magenta") }); try w.print(" {s}", .{ try cyan(&tmpBuf, "cyan") }); try w.print(" {s}", .{ try white(&tmpBuf, "white") }); // TODO grey try w.print(" {s}", .{ try black(&tmpBuf, "black") }); } test "background colors" { const w = std.io.getStdErr().writer(); try setBackgroundColor(Color.Red); try w.writeAll("red"); try resetGraphics(); // TODO if this buffer is shared between an expression (for example: one w.print with multuple formats), // then this will break. var tmpBuf: [100]u8 = undefined; try w.print(" {s}", .{ try bgGreen(&tmpBuf, "bgGreen") }); try w.print(" {s}", .{ try bgYellow(&tmpBuf, "bgYellow") }); try w.print(" {s}", .{ try bgBlue(&tmpBuf, "bgBlue") }); try w.print(" {s}", .{ try bgMagenta(&tmpBuf, "bgMagenta") }); try w.print(" {s}", .{ try bgCyan(&tmpBuf, "bgCyan") }); try w.print(" {s}", .{ try bgWhite(&tmpBuf, "bgWhite") }); // TODO grey try w.print(" {s}", .{ try bgBlack(&tmpBuf, "bgBlack") }); }
src/giz.zig
//-------------------------------------------------------------------------------- // Section: Types (4) //-------------------------------------------------------------------------------- // TODO: this type is limited to platform 'windows5.0' const IID_IMarshal_Value = Guid.initString("00000003-0000-0000-c000-000000000046"); pub const IID_IMarshal = &IID_IMarshal_Value; pub const IMarshal = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, GetUnmarshalClass: fn( self: *const IMarshal, riid: ?*const Guid, pv: ?*anyopaque, dwDestContext: u32, pvDestContext: ?*anyopaque, mshlflags: u32, pCid: ?*Guid, ) callconv(@import("std").os.windows.WINAPI) HRESULT, GetMarshalSizeMax: fn( self: *const IMarshal, riid: ?*const Guid, pv: ?*anyopaque, dwDestContext: u32, pvDestContext: ?*anyopaque, mshlflags: u32, pSize: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, MarshalInterface: fn( self: *const IMarshal, pStm: ?*IStream, riid: ?*const Guid, pv: ?*anyopaque, dwDestContext: u32, pvDestContext: ?*anyopaque, mshlflags: u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, UnmarshalInterface: fn( self: *const IMarshal, pStm: ?*IStream, riid: ?*const Guid, ppv: ?*?*anyopaque, ) callconv(@import("std").os.windows.WINAPI) HRESULT, ReleaseMarshalData: fn( self: *const IMarshal, pStm: ?*IStream, ) callconv(@import("std").os.windows.WINAPI) HRESULT, DisconnectObject: fn( self: *const IMarshal, dwReserved: u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IMarshal_GetUnmarshalClass(self: *const T, riid: ?*const Guid, pv: ?*anyopaque, dwDestContext: u32, pvDestContext: ?*anyopaque, mshlflags: u32, pCid: ?*Guid) callconv(.Inline) HRESULT { return @ptrCast(*const IMarshal.VTable, self.vtable).GetUnmarshalClass(@ptrCast(*const IMarshal, self), riid, pv, dwDestContext, pvDestContext, mshlflags, pCid); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IMarshal_GetMarshalSizeMax(self: *const T, riid: ?*const Guid, pv: ?*anyopaque, dwDestContext: u32, pvDestContext: ?*anyopaque, mshlflags: u32, pSize: ?*u32) callconv(.Inline) HRESULT { return @ptrCast(*const IMarshal.VTable, self.vtable).GetMarshalSizeMax(@ptrCast(*const IMarshal, self), riid, pv, dwDestContext, pvDestContext, mshlflags, pSize); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IMarshal_MarshalInterface(self: *const T, pStm: ?*IStream, riid: ?*const Guid, pv: ?*anyopaque, dwDestContext: u32, pvDestContext: ?*anyopaque, mshlflags: u32) callconv(.Inline) HRESULT { return @ptrCast(*const IMarshal.VTable, self.vtable).MarshalInterface(@ptrCast(*const IMarshal, self), pStm, riid, pv, dwDestContext, pvDestContext, mshlflags); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IMarshal_UnmarshalInterface(self: *const T, pStm: ?*IStream, riid: ?*const Guid, ppv: ?*?*anyopaque) callconv(.Inline) HRESULT { return @ptrCast(*const IMarshal.VTable, self.vtable).UnmarshalInterface(@ptrCast(*const IMarshal, self), pStm, riid, ppv); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IMarshal_ReleaseMarshalData(self: *const T, pStm: ?*IStream) callconv(.Inline) HRESULT { return @ptrCast(*const IMarshal.VTable, self.vtable).ReleaseMarshalData(@ptrCast(*const IMarshal, self), pStm); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IMarshal_DisconnectObject(self: *const T, dwReserved: u32) callconv(.Inline) HRESULT { return @ptrCast(*const IMarshal.VTable, self.vtable).DisconnectObject(@ptrCast(*const IMarshal, self), dwReserved); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IMarshal2_Value = Guid.initString("000001cf-0000-0000-c000-000000000046"); pub const IID_IMarshal2 = &IID_IMarshal2_Value; pub const IMarshal2 = extern struct { pub const VTable = extern struct { base: IMarshal.VTable, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IMarshal.MethodMixin(T); };} pub usingnamespace MethodMixin(@This()); }; // TODO: this type is limited to platform 'windows8.0' const IID_IMarshalingStream_Value = Guid.initString("d8f2f5e6-6102-4863-9f26-389a4676efde"); pub const IID_IMarshalingStream = &IID_IMarshalingStream_Value; pub const IMarshalingStream = extern struct { pub const VTable = extern struct { base: IStream.VTable, GetMarshalingContextAttribute: fn( self: *const IMarshalingStream, attribute: CO_MARSHALING_CONTEXT_ATTRIBUTES, pAttributeValue: ?*usize, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IStream.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IMarshalingStream_GetMarshalingContextAttribute(self: *const T, attribute: CO_MARSHALING_CONTEXT_ATTRIBUTES, pAttributeValue: ?*usize) callconv(.Inline) HRESULT { return @ptrCast(*const IMarshalingStream.VTable, self.vtable).GetMarshalingContextAttribute(@ptrCast(*const IMarshalingStream, self), attribute, pAttributeValue); } };} pub usingnamespace MethodMixin(@This()); }; pub const STDMSHLFLAGS = enum(i32) { SERVER = 1, HANDLER = 2, }; pub const SMEXF_SERVER = STDMSHLFLAGS.SERVER; pub const SMEXF_HANDLER = STDMSHLFLAGS.HANDLER; //-------------------------------------------------------------------------------- // Section: Functions (121) //-------------------------------------------------------------------------------- pub extern "OLEAUT32" fn BSTR_UserSize( param0: ?*u32, param1: u32, param2: ?*?BSTR, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLEAUT32" fn BSTR_UserMarshal( param0: ?*u32, param1: ?*u8, param2: ?*?BSTR, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLEAUT32" fn BSTR_UserUnmarshal( param0: ?*u32, param1: [*:0]u8, param2: ?*?BSTR, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLEAUT32" fn BSTR_UserFree( param0: ?*u32, param1: ?*?BSTR, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "OLE32" fn HWND_UserSize( param0: ?*u32, param1: u32, param2: ?*?HWND, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLE32" fn HWND_UserMarshal( param0: ?*u32, param1: ?*u8, param2: ?*?HWND, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HWND_UserUnmarshal( param0: ?*u32, param1: [*:0]u8, param2: ?*?HWND, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HWND_UserFree( param0: ?*u32, param1: ?*?HWND, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "OLEAUT32" fn VARIANT_UserSize( param0: ?*u32, param1: u32, param2: ?*VARIANT, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLEAUT32" fn VARIANT_UserMarshal( param0: ?*u32, param1: ?*u8, param2: ?*VARIANT, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLEAUT32" fn VARIANT_UserUnmarshal( param0: ?*u32, param1: [*:0]u8, param2: ?*VARIANT, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLEAUT32" fn VARIANT_UserFree( param0: ?*u32, param1: ?*VARIANT, ) callconv(@import("std").os.windows.WINAPI) void; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "OLEAUT32" fn BSTR_UserSize64( param0: ?*u32, param1: u32, param2: ?*?BSTR, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "OLEAUT32" fn BSTR_UserMarshal64( param0: ?*u32, param1: ?*u8, param2: ?*?BSTR, ) callconv(@import("std").os.windows.WINAPI) ?*u8; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "OLEAUT32" fn BSTR_UserUnmarshal64( param0: ?*u32, param1: [*:0]u8, param2: ?*?BSTR, ) callconv(@import("std").os.windows.WINAPI) ?*u8; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "OLEAUT32" fn BSTR_UserFree64( param0: ?*u32, param1: ?*?BSTR, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "OLE32" fn HWND_UserSize64( param0: ?*u32, param1: u32, param2: ?*?HWND, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLE32" fn HWND_UserMarshal64( param0: ?*u32, param1: ?*u8, param2: ?*?HWND, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HWND_UserUnmarshal64( param0: ?*u32, param1: [*:0]u8, param2: ?*?HWND, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HWND_UserFree64( param0: ?*u32, param1: ?*?HWND, ) callconv(@import("std").os.windows.WINAPI) void; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "OLEAUT32" fn VARIANT_UserSize64( param0: ?*u32, param1: u32, param2: ?*VARIANT, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "OLEAUT32" fn VARIANT_UserMarshal64( param0: ?*u32, param1: ?*u8, param2: ?*VARIANT, ) callconv(@import("std").os.windows.WINAPI) ?*u8; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "OLEAUT32" fn VARIANT_UserUnmarshal64( param0: ?*u32, param1: [*:0]u8, param2: ?*VARIANT, ) callconv(@import("std").os.windows.WINAPI) ?*u8; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "OLEAUT32" fn VARIANT_UserFree64( param0: ?*u32, param1: ?*VARIANT, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "OLE32" fn CLIPFORMAT_UserSize( param0: ?*u32, param1: u32, param2: ?*u16, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLE32" fn CLIPFORMAT_UserMarshal( param0: ?*u32, param1: ?*u8, param2: ?*u16, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn CLIPFORMAT_UserUnmarshal( param0: ?*u32, param1: [*:0]u8, param2: ?*u16, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn CLIPFORMAT_UserFree( param0: ?*u32, param1: ?*u16, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "OLE32" fn HBITMAP_UserSize( param0: ?*u32, param1: u32, param2: ?*?HBITMAP, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLE32" fn HBITMAP_UserMarshal( param0: ?*u32, param1: ?*u8, param2: ?*?HBITMAP, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HBITMAP_UserUnmarshal( param0: ?*u32, param1: [*:0]u8, param2: ?*?HBITMAP, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HBITMAP_UserFree( param0: ?*u32, param1: ?*?HBITMAP, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "OLE32" fn HDC_UserSize( param0: ?*u32, param1: u32, param2: ?*?HDC, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLE32" fn HDC_UserMarshal( param0: ?*u32, param1: ?*u8, param2: ?*?HDC, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HDC_UserUnmarshal( param0: ?*u32, param1: [*:0]u8, param2: ?*?HDC, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HDC_UserFree( param0: ?*u32, param1: ?*?HDC, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "OLE32" fn HICON_UserSize( param0: ?*u32, param1: u32, param2: ?*?HICON, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLE32" fn HICON_UserMarshal( param0: ?*u32, param1: ?*u8, param2: ?*?HICON, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HICON_UserUnmarshal( param0: ?*u32, param1: [*:0]u8, param2: ?*?HICON, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HICON_UserFree( param0: ?*u32, param1: ?*?HICON, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "ole32" fn SNB_UserSize( param0: ?*u32, param1: u32, param2: ?*?*?*u16, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "ole32" fn SNB_UserMarshal( param0: ?*u32, param1: ?*u8, param2: ?*?*?*u16, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "ole32" fn SNB_UserUnmarshal( param0: ?*u32, param1: [*:0]u8, param2: ?*?*?*u16, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "ole32" fn SNB_UserFree( param0: ?*u32, param1: ?*?*?*u16, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "OLE32" fn STGMEDIUM_UserSize( param0: ?*u32, param1: u32, param2: ?*STGMEDIUM, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLE32" fn STGMEDIUM_UserMarshal( param0: ?*u32, param1: ?*u8, param2: ?*STGMEDIUM, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn STGMEDIUM_UserUnmarshal( param0: ?*u32, param1: [*:0]u8, param2: ?*STGMEDIUM, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn STGMEDIUM_UserFree( param0: ?*u32, param1: ?*STGMEDIUM, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "OLE32" fn CLIPFORMAT_UserSize64( param0: ?*u32, param1: u32, param2: ?*u16, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLE32" fn CLIPFORMAT_UserMarshal64( param0: ?*u32, param1: ?*u8, param2: ?*u16, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn CLIPFORMAT_UserUnmarshal64( param0: ?*u32, param1: [*:0]u8, param2: ?*u16, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn CLIPFORMAT_UserFree64( param0: ?*u32, param1: ?*u16, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "OLE32" fn HBITMAP_UserSize64( param0: ?*u32, param1: u32, param2: ?*?HBITMAP, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLE32" fn HBITMAP_UserMarshal64( param0: ?*u32, param1: ?*u8, param2: ?*?HBITMAP, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HBITMAP_UserUnmarshal64( param0: ?*u32, param1: [*:0]u8, param2: ?*?HBITMAP, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HBITMAP_UserFree64( param0: ?*u32, param1: ?*?HBITMAP, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "OLE32" fn HDC_UserSize64( param0: ?*u32, param1: u32, param2: ?*?HDC, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLE32" fn HDC_UserMarshal64( param0: ?*u32, param1: ?*u8, param2: ?*?HDC, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HDC_UserUnmarshal64( param0: ?*u32, param1: [*:0]u8, param2: ?*?HDC, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HDC_UserFree64( param0: ?*u32, param1: ?*?HDC, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "OLE32" fn HICON_UserSize64( param0: ?*u32, param1: u32, param2: ?*?HICON, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLE32" fn HICON_UserMarshal64( param0: ?*u32, param1: ?*u8, param2: ?*?HICON, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HICON_UserUnmarshal64( param0: ?*u32, param1: [*:0]u8, param2: ?*?HICON, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HICON_UserFree64( param0: ?*u32, param1: ?*?HICON, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "ole32" fn SNB_UserSize64( param0: ?*u32, param1: u32, param2: ?*?*?*u16, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "ole32" fn SNB_UserMarshal64( param0: ?*u32, param1: ?*u8, param2: ?*?*?*u16, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "ole32" fn SNB_UserUnmarshal64( param0: ?*u32, param1: [*:0]u8, param2: ?*?*?*u16, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "ole32" fn SNB_UserFree64( param0: ?*u32, param1: ?*?*?*u16, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "OLE32" fn STGMEDIUM_UserSize64( param0: ?*u32, param1: u32, param2: ?*STGMEDIUM, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLE32" fn STGMEDIUM_UserMarshal64( param0: ?*u32, param1: ?*u8, param2: ?*STGMEDIUM, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn STGMEDIUM_UserUnmarshal64( param0: ?*u32, param1: [*:0]u8, param2: ?*STGMEDIUM, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn STGMEDIUM_UserFree64( param0: ?*u32, param1: ?*STGMEDIUM, ) callconv(@import("std").os.windows.WINAPI) void; // TODO: this type is limited to platform 'windows5.0' pub extern "OLE32" fn CoGetMarshalSizeMax( pulSize: ?*u32, riid: ?*const Guid, pUnk: ?*IUnknown, dwDestContext: u32, pvDestContext: ?*anyopaque, mshlflags: u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows5.0' pub extern "OLE32" fn CoMarshalInterface( pStm: ?*IStream, riid: ?*const Guid, pUnk: ?*IUnknown, dwDestContext: u32, pvDestContext: ?*anyopaque, mshlflags: u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows5.0' pub extern "OLE32" fn CoUnmarshalInterface( pStm: ?*IStream, riid: ?*const Guid, ppv: ?*?*anyopaque, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows5.0' pub extern "OLE32" fn CoMarshalHresult( pstm: ?*IStream, hresult: HRESULT, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows5.0' pub extern "OLE32" fn CoUnmarshalHresult( pstm: ?*IStream, phresult: ?*HRESULT, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows5.0' pub extern "OLE32" fn CoReleaseMarshalData( pStm: ?*IStream, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows5.0' pub extern "OLE32" fn CoGetStandardMarshal( riid: ?*const Guid, pUnk: ?*IUnknown, dwDestContext: u32, pvDestContext: ?*anyopaque, mshlflags: u32, ppMarshal: ?*?*IMarshal, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows5.0' pub extern "OLE32" fn CoGetStdMarshalEx( pUnkOuter: ?*IUnknown, smexflags: u32, ppUnkInner: ?*?*IUnknown, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows5.0' pub extern "OLE32" fn CoMarshalInterThreadInterfaceInStream( riid: ?*const Guid, pUnk: ?*IUnknown, ppStm: ?*?*IStream, ) callconv(@import("std").os.windows.WINAPI) HRESULT; pub extern "OLEAUT32" fn LPSAFEARRAY_UserSize( param0: ?*u32, param1: u32, param2: ?*?*SAFEARRAY, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLEAUT32" fn LPSAFEARRAY_UserMarshal( param0: ?*u32, param1: ?*u8, param2: ?*?*SAFEARRAY, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLEAUT32" fn LPSAFEARRAY_UserUnmarshal( param0: ?*u32, param1: [*:0]u8, param2: ?*?*SAFEARRAY, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLEAUT32" fn LPSAFEARRAY_UserFree( param0: ?*u32, param1: ?*?*SAFEARRAY, ) callconv(@import("std").os.windows.WINAPI) void; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "OLEAUT32" fn LPSAFEARRAY_UserSize64( param0: ?*u32, param1: u32, param2: ?*?*SAFEARRAY, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "OLEAUT32" fn LPSAFEARRAY_UserMarshal64( param0: ?*u32, param1: ?*u8, param2: ?*?*SAFEARRAY, ) callconv(@import("std").os.windows.WINAPI) ?*u8; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "OLEAUT32" fn LPSAFEARRAY_UserUnmarshal64( param0: ?*u32, param1: [*:0]u8, param2: ?*?*SAFEARRAY, ) callconv(@import("std").os.windows.WINAPI) ?*u8; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "OLEAUT32" fn LPSAFEARRAY_UserFree64( param0: ?*u32, param1: ?*?*SAFEARRAY, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "OLE32" fn HACCEL_UserSize( param0: ?*u32, param1: u32, param2: ?*?HACCEL, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLE32" fn HACCEL_UserMarshal( param0: ?*u32, param1: ?*u8, param2: ?*?HACCEL, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HACCEL_UserUnmarshal( param0: ?*u32, param1: [*:0]u8, param2: ?*?HACCEL, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HACCEL_UserFree( param0: ?*u32, param1: ?*?HACCEL, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "OLE32" fn HGLOBAL_UserSize( param0: ?*u32, param1: u32, param2: ?*isize, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLE32" fn HGLOBAL_UserMarshal( param0: ?*u32, param1: ?*u8, param2: ?*isize, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HGLOBAL_UserUnmarshal( param0: ?*u32, param1: [*:0]u8, param2: ?*isize, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HGLOBAL_UserFree( param0: ?*u32, param1: ?*isize, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "OLE32" fn HMENU_UserSize( param0: ?*u32, param1: u32, param2: ?*?HMENU, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLE32" fn HMENU_UserMarshal( param0: ?*u32, param1: ?*u8, param2: ?*?HMENU, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HMENU_UserUnmarshal( param0: ?*u32, param1: [*:0]u8, param2: ?*?HMENU, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HMENU_UserFree( param0: ?*u32, param1: ?*?HMENU, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "OLE32" fn HACCEL_UserSize64( param0: ?*u32, param1: u32, param2: ?*?HACCEL, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLE32" fn HACCEL_UserMarshal64( param0: ?*u32, param1: ?*u8, param2: ?*?HACCEL, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HACCEL_UserUnmarshal64( param0: ?*u32, param1: [*:0]u8, param2: ?*?HACCEL, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HACCEL_UserFree64( param0: ?*u32, param1: ?*?HACCEL, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "OLE32" fn HGLOBAL_UserSize64( param0: ?*u32, param1: u32, param2: ?*isize, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLE32" fn HGLOBAL_UserMarshal64( param0: ?*u32, param1: ?*u8, param2: ?*isize, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HGLOBAL_UserUnmarshal64( param0: ?*u32, param1: [*:0]u8, param2: ?*isize, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HGLOBAL_UserFree64( param0: ?*u32, param1: ?*isize, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "OLE32" fn HMENU_UserSize64( param0: ?*u32, param1: u32, param2: ?*?HMENU, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLE32" fn HMENU_UserMarshal64( param0: ?*u32, param1: ?*u8, param2: ?*?HMENU, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HMENU_UserUnmarshal64( param0: ?*u32, param1: [*:0]u8, param2: ?*?HMENU, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HMENU_UserFree64( param0: ?*u32, param1: ?*?HMENU, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "OLE32" fn HPALETTE_UserSize( param0: ?*u32, param1: u32, param2: ?*?HPALETTE, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLE32" fn HPALETTE_UserMarshal( param0: ?*u32, param1: ?*u8, param2: ?*?HPALETTE, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HPALETTE_UserUnmarshal( param0: ?*u32, param1: [*:0]u8, param2: ?*?HPALETTE, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HPALETTE_UserFree( param0: ?*u32, param1: ?*?HPALETTE, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "OLE32" fn HPALETTE_UserSize64( param0: ?*u32, param1: u32, param2: ?*?HPALETTE, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "OLE32" fn HPALETTE_UserMarshal64( param0: ?*u32, param1: ?*u8, param2: ?*?HPALETTE, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HPALETTE_UserUnmarshal64( param0: ?*u32, param1: [*:0]u8, param2: ?*?HPALETTE, ) callconv(@import("std").os.windows.WINAPI) ?*u8; pub extern "OLE32" fn HPALETTE_UserFree64( param0: ?*u32, param1: ?*?HPALETTE, ) callconv(@import("std").os.windows.WINAPI) void; //-------------------------------------------------------------------------------- // Section: Unicode Aliases (0) //-------------------------------------------------------------------------------- const thismodule = @This(); pub usingnamespace switch (@import("../../zig.zig").unicode_mode) { .ansi => struct { }, .wide => struct { }, .unspecified => if (@import("builtin").is_test) struct { } else struct { }, }; //-------------------------------------------------------------------------------- // Section: Imports (16) //-------------------------------------------------------------------------------- const Guid = @import("../../zig.zig").Guid; const BSTR = @import("../../foundation.zig").BSTR; const CO_MARSHALING_CONTEXT_ATTRIBUTES = @import("../../system/com.zig").CO_MARSHALING_CONTEXT_ATTRIBUTES; const HACCEL = @import("../../ui/windows_and_messaging.zig").HACCEL; const HBITMAP = @import("../../graphics/gdi.zig").HBITMAP; const HDC = @import("../../graphics/gdi.zig").HDC; const HICON = @import("../../ui/windows_and_messaging.zig").HICON; const HMENU = @import("../../ui/windows_and_messaging.zig").HMENU; const HPALETTE = @import("../../graphics/gdi.zig").HPALETTE; const HRESULT = @import("../../foundation.zig").HRESULT; const HWND = @import("../../foundation.zig").HWND; const IStream = @import("../../system/com.zig").IStream; const IUnknown = @import("../../system/com.zig").IUnknown; const SAFEARRAY = @import("../../system/com.zig").SAFEARRAY; const STGMEDIUM = @import("../../system/com.zig").STGMEDIUM; const VARIANT = @import("../../system/com.zig").VARIANT; test { @setEvalBranchQuota( @import("std").meta.declarations(@This()).len * 3 ); // reference all the pub declarations if (!@import("builtin").is_test) return; inline for (@import("std").meta.declarations(@This())) |decl| { if (decl.is_pub) { _ = decl; } } }
win32/system/com/marshal.zig
const std = @import("std"); const zs = @import("zstack.zig"); const Timer = std.os.time.Timer; const Randomizer = zs.Randomizer; const Piece = zs.Piece; // See this thread for some useful reading: // https://tetrisconcept.net/threads/randomizer-theory.512/ // // Variances // --------- // // Memoryless: 42 // 63-bag: 34 + 82/275 = 34.29818181... // NES (ideal): 32 + 2/3 = 32.66666666... // Cultris II (sample): ~27.65 // 28-bag: 27 + 13/25 = 27.52 // 4 history 2 roll: ~20.56697 // 14-bag: 19 // 5-bag: 18 // 10-bag: 16 + 32/35 = 16.91428571... // 7 from 8: 15 + 82/175 = 15.46857142... // 1+7: 12 + 13/14 = 12.92857142... // 6-bag: 12 + 5/6 = 12.83333333... // 3 history strict: 12 // 8-bag: 11 + 43/56 = 11.76785714... // 4 history 4 roll (TGM1): 10.13757557... // 7-bag: 8 // 7-bag with seam match check: 7.5 // 4 history 6 roll (TGM2): 7.34494156... // 4 history strict: 6 // TGM3 (sample): ~5.31 const variance = struct { const memoryless = 42; const nes = 32.6666; const bag6 = 12.8333; const bag7 = 8; const bag7seamcheck = 7.5; const multibag2 = 19; const multibag4 = 27.52; const multibag9 = 34.29819; const tgm1 = 10.13757557; const tgm2 = 7.34494156; const tgm3 = 5.31; }; fn testDistribution(r: *Randomizer, target_variance: f64) !void { const limit = 1000000; // Reseed randomizer with random seed. var buf: [4]u8 = undefined; try std.os.getRandomBytes(buf[0..]); const s = std.mem.readIntSliceLittle(u32, buf[0..]); r.prng().seed(s); var seen = []u64{0} ** Piece.Id.count; var last_seen = []u64{0} ** Piece.Id.count; var variance_sum: u64 = 0; var variance_sum_sq: u64 = 0; var timer = try Timer.start(); var i: usize = 0; while (i < limit) : (i += 1) { const p = @enumToInt(r.next()); const x = i - last_seen[p]; variance_sum += x; variance_sum_sq += x * x; seen[p] += 1; last_seen[p] = i; } // NOTE: This does include some overhead from the arithmetic above, but this is the same for // each randomizer tested. const elapsed = timer.read(); std.debug.warn("\n = {} ns per call\n", elapsed / limit); std.debug.warn(" = Distribution\n"); var j: usize = 0; while (j < Piece.Id.count) : (j += 1) { const weight = @intToFloat(f64, seen[j]) * 100 / limit; std.debug.warn(" {} - {.3}%\n", @tagName(@intToEnum(Piece.Id, @intCast(u3, j))), weight); } const actual_variance = @intToFloat(f64, variance_sum_sq - (variance_sum * variance_sum) / limit) / (limit - 1); std.debug.warn(" = Variance\n"); std.debug.warn(" target = {.3}\n", target_variance); std.debug.warn(" actual = {.3}\n", actual_variance); } var seed: u32 = 0; test "variance.memoryless" { var r = Randomizer.init(.memoryless, seed); try testDistribution(&r, variance.memoryless); } test "variance.nes" { var r = Randomizer.init(.nes, seed); try testDistribution(&r, variance.nes); } test "variance.bag7" { var r = Randomizer.init(.bag7, seed); try testDistribution(&r, variance.bag7); } test "variance.bag7seamcheck" { var r = Randomizer.init(.bag7seamcheck, seed); try testDistribution(&r, variance.bag7seamcheck); } test "variance.bag6" { var r = Randomizer.init(.bag6, seed); try testDistribution(&r, variance.bag6); } test "variance.multibag2" { var r = Randomizer.init(.multibag2, seed); try testDistribution(&r, variance.multibag2); } test "variance.multibag4" { var r = Randomizer.init(.multibag4, seed); try testDistribution(&r, variance.multibag4); } test "variance.multibag9" { var r = Randomizer.init(.multibag9, seed); try testDistribution(&r, variance.multibag9); } test "variance.tgm1" { var r = Randomizer.init(.tgm1, seed); try testDistribution(&r, variance.tgm1); } test "variance.tgm2" { var r = Randomizer.init(.tgm2, seed); try testDistribution(&r, variance.tgm2); } test "variance.tgm3" { var r = Randomizer.init(.tgm3, seed); try testDistribution(&r, variance.tgm3); }
src/randomizer_test.zig
const std = @import("std"); //const tracy = @import("tracy"); const display = @import("zbox"); const build_options = @import("build_options"); // Author <NAME> (2021), released under the GPL V3 license. // // This program is an implementation of life as create by <NAME>. // // change the pattern to one of the included patterns and rebuild, // // set the directory use for zbox in build.zig // // update the pattern to animated and the number of threads to use in build.zig // // zig build -Drelease-fast run // or // zig build -Drelease-safe run (about 10% slower) // or // zig build -Drelease-fast -Dtarget=x86_64-linux-gnu -Dcpu=baseline (generic linux build) // // zbox can be cloned from: https://github.com/jessrud/zbox.git // // generation 299198(2) population 77132(11719) births 3217 deaths 3228 rate 260/s heap(8) 61286/16841 window(4) -11402,-11587 ±2048 // // The title line tells us this is generation 200198 and the (2) that we are displaying every second generation ( see +, - ) // the population is 77132 cells with (11719) cells considered active (a birth or death near the cell in the last generation) // birth and deaths as per the rules of life // generations per second. If the rate is limited (see s, f) you will see rate> indicating we can run faster. // we are using a heap size of 2^8 x 2^8 with 61286 entries and we need to check 16841 cells for the next generation. // window(16) tells us we slowed down updating the display window's position by 16 times - causes the display jump around less (see [, ]). // x,y the current display window origin // ±n shows how wide an area is considered for autotracking. To disable autotracking use the cursor keys (±0), to enable use (t or T). // // <, > : limits the generation rate, < halves the rate and > doubles it (when limited you will see rate>xxx/s ) // // +, - : only show every nth generation. + doubles n, - halves n (generation xxxx(n) ...) // // [, ] : how fast the autotracking position can move, bigger is slower // // cursor keys : allow manual positioning of the window using cursor keys (±0) // // t,T : if autotracking is disabled enabled it, if enabled decrease area monitored for tracking (t) or increase area (T) (±n). // // w : toggle window position and tracking. Often patterns have two interesting areas. This allows switching between them. // // esc, q : will exit the program // // The algorithm used here was developed in the late 70s or early 80s. I first implemented it on an OSI superboard II using // Basic and 6502 assembly. This was before algorithms like hash life were discovered. I've been using it when I want to learn a // new language environment. This version was started to learn basic zig, then valgrind came into the picture and let me get a // better idea of how zig compiles and where the program was spending its time. // // This algorithm is nothing special by todays standards, it does not use SIMD or the GPU for speed. It does use threading when // updating the display and for the generation update. Its been a good learning tool. // // How it works. We have an N x N array of pointers to cells. The indexes to the array is a hash based on the x, y cords of the cell. // Each cell has a pointer to another cell. So we have a lists of cells where hash(x,y) are the same. We size the array depending on how // loaded it becomes, at near 100% ( eg. N x N is near 2^(N+N)) we increase N. We use this structure to sum the effects of cells on each // other. We also track 4 x 4 areas ( eg hash(x|3, y|3)) flagging each area static if no births or deaths occur in the area. Any cells // in a static area survive into the next generation. We still have to add the effect of these cell on any cell in an ajoining non // static area. The effect of all this is to drasticly limit the number of cells we need to work with. Once we finsh processing // the alive arraylist (processAlive), we start a thread to update the display and more to process the cells list (processCells) to // update the alive[] lists for the next generation. To make being thread safe easier we keep alive[threads] lists of alive points. // ProcessCells in designed to be thread safe, and just as important, it balances the alive lists and updates the static 4x4 area flags // when we find a birth or death. It also gathers data to allow autotracking of activity. // // The way the cells are added in AddCell and AddNear is interesting. At the start of the process we record the cells head of list. // If the cell does not exist in the list we try to add it. In the multithreaded case, another thread may have already done this, // and will have updated the head of list, the @cmpxchgStrong detects this, which case we just retry with the new head of list. // Typically this happen a few times per generation. The process would also work with @cmpxchgWeak, but I do not see much, if any, // differences in benchmarks. (currently it uses Strong - speed is about the same might be using a little less CPU). // // Sometimes optimization is not at all obvious. It is possibe to create a list of cells that might contain a birth or death while // processing the alive lists. This gives us a subset of cells to check usually containing 25-35% of cells. Normally this would // help since scanning less is good. However because we spend most of our time in processAlive in addCell and addNear the overhead // to track these cells actually ends up costing us 2-5%. I used this optimization before the addition of the static cell logic. // which reduces the number of cells to process by about 70-90%, that changed the balance so the checkList was no longer helping. // // What AtomicOrder is required? I was pointed at: https://en.cppreference.com/w/c/atomic/memory_order // which I've found to be a very good guide. Using this it seems that for what we do here .Release will suffice as quoted below: // // Release sequence // If some atomic is store-released and several other threads perform read-modify-write operations on that atomic, a // "release sequence" is formed: all threads that perform the read-modify-writes to the same atomic synchronize with the first thread // and each other even if they have no memory_order_release semantics. This makes single producer - multiple consumers situations // possible without imposing unnecessary synchronization between individual consumer threads. // // set the pattern to run in ../build.zig const pattern = build_options.pattern; // get setting from build.zig const Threads:MaxIndex = build_options.Threads; // Threads to use from build.zig const staticSize = build_options.staticSize; // static tiles are staticSize x staticSize. Must be a power of 2. const chunkSize = build_options.chunkSize; // number of cells to use when balancing alive arrays. const numChunks = build_options.numChunks; // initial memory allocations for cells and alive[Threads] arrayLists const origin = build_options.origin; // number is so important, it position cells for middle squares to work well const Coord = u32; // size of x & y coords const MaxIndex = u32; // Maximum index usable in cells (limits population to about std.math.maxInt(maxIndex)/8) const timeOut = std.math.maxInt(u64); // Time out in ns for Futex wait // with p_95_206_595mS on an i7-4770k at 3.5GHz (4 cores, 8 hyperthreads) // // Threads gen rate cpu // 1 100,000 440s 15% // 2 100,000 430s 27% using rmw in addCell and addNear seems to be the reason for this // 3 100,000 540/s 37% // 4 100,000 580/s 47% // 5 100,100 640/s 57% // 6 100,000 710/s 67% // 7 100,000 830/s 75% // 8 100,000 740/s 75% The update threads + display thread > CPU threads so we take longer in processCells/displayUqpdate // // operf with 6 threads reports (anything over 1%): // //CPU: Intel Haswell microarchitecture, speed 4000 MHz (estimated) //Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 100000 //samples % symbol name //15881082 81.1178 processAlive //3088177 15.7739 processCells //479568 2.4495 worker const print = std.debug.print; fn panic(msg: []const u8, error_return_trace: ?*std.builtin.StackTrace) noreturn { display.deinit(); std.io.getStdOut().writeAll("\x1b[2J") catch {}; std.io.getStdOut().writeAll("\x1b[H") catch {}; std.builtin.default_panic(msg, error_return_trace); } const Point = packed struct { // cell coords (packed so we can bitCast a Point to a u64) x: Coord align(16), y: Coord, const m = staticSize-1; const active = [_]@TypeOf(middle){lowerLeftA, lowerA, lowerRightA, leftA, middleA, rightA, topLeftA, topA, topRightA}; // const active = [_]@TypeOf(middle){other, other, other, other, middleA, other, other, other, other}; // try with small l2 cache const static = [_]@TypeOf(middle){lowerLeft, lower, lowerRight, left, middle, right, topLeft, top, topRight}; // const static = [_]@TypeOf(middle){other, other, other, other, middle, other, other, other, other}; const Self = @This(); fn middle(_: *Self) void { } fn lower(p: *Self) void { // .{ysc, xs_, xa2 } const list = .{ysc, .{xs_, xa2 }}; if (list[0](p)) { grid.addCell(p.*,1); inline for (list[1]) |next| { next(p); grid.addCell(p.*,1); } } } fn left(p: *Self) void { // .{xsc, ys_, ya2 } const list = .{xsc, .{ys_, ya2 }}; if (list[0](p)) { grid.addCell(p.*,1); inline for (list[1]) |next| { next(p); grid.addCell(p.*,1); } } } fn right(p: *Self) void { // .{xac, ys_, ya2 } const list = .{xac, .{ys_, ya2 }}; if (list[0](p)) { grid.addCell(p.*,1); inline for (list[1]) |next| { next(p); grid.addCell(p.*,1); } } } fn top(p: *Self) void { // .{yac, xs_, xa2 } const list = .{yac, .{xs_, xa2 }}; if (list[0](p)) { grid.addCell(p.*,1); inline for (list[1]) |next| { next(p); grid.addCell(p.*,1); } } } fn lowerLeft(p: *Self) void { inline for (.{ .{ysc, .{xa_}}, .{xs2c, .{}}, .{yac, .{ya_}} }) |list| { if (list[0](p)) { grid.addCell(p.*,1); inline for (list[1]) |next| { next(p); grid.addCell(p.*,1); } } else inline for (list[1]) |next| { next(p); } } } fn lowerRight(p: *Self) void { inline for (.{ .{xac, .{ya_}}, .{ys2c, .{}}, .{xsc, .{xs_}} }) |list| { if (list[0](p)) { grid.addCell(p.*,1); inline for (list[1]) |next| { next(p); grid.addCell(p.*,1); } } else inline for (list[1]) |next| { next(p); } } } fn topLeft(p: *Self) void { inline for (.{ .{xsc, .{ys_}}, .{ya2c, .{}}, .{xac, .{xa_}} }) |list| { if (list[0](p)) { grid.addCell(p.*,1); inline for (list[1]) |next| { next(p); grid.addCell(p.*,1); } } else inline for (list[1]) |next| { next(p); } } } fn topRight(p: *Self) void { inline for (.{ .{yac, .{xs_}}, .{xa2c, .{}}, .{ysc, .{ys_}} }) |list| { if (list[0](p)) { grid.addCell(p.*,1); inline for (list[1]) |next| { next(p); grid.addCell(p.*,1); } } else inline for (list[1]) |next| { next(p); } } } // const mA = [_]vec{xa_, ya_, xs_, xs_, ys_, ys_, xa_, xa_ }; fn middleA(p: *Self) void { inline for (.{xa_, ya_, xs_, xs_, ys_, ys_, xa_, xa_ }) |next| { next(p); grid.addCell(p.*,1); } } // const mA = [_]vec{xa_, ya_, xs_, xs_, ys_, ys_, xa_, xa_ }; fn other(p: *Self) void { inline for (.{xa_, ya_, xs_, xs_, ys_, ys_, xa_, xa_ }) |next| { next(p); if (grid.active[grid.index(p.x|m, p.y|m)]) grid.addCell(p.*,1); } } // const bA = [_]vec{xst, ya_, xa_, xa_, ys_, ysc, xs_, xs_ }; fn lowerA(p: *Self) void { inline for ( .{ .{xst, .{ya_, xa_, xa_, ys_}}, .{ysc, .{xs_, xs_}} }) |list| { if (list[0](p)) { grid.addCell(p.*,1); inline for (list[1]) |next| { next(p); grid.addCell(p.*,1); } } } } // const lA = [_]vec{yat, xa_, ys_, ys_, xs_, xsc, ya_, ya_ }; fn leftA(p: *Self) void { inline for ( .{ .{yat, .{xa_, ys_, ys_, xs_}}, .{xsc, .{ya_, ya_ }} }) |list| { if (list[0](p)) { grid.addCell(p.*,1); inline for (list[1]) |next| { next(p); grid.addCell(p.*,1); } } } } // const rA = [_]vec{yst, xs_, ya_, ya_, xa_, xac, ys_, ys_ }; fn rightA(p: *Self) void { inline for ( .{ .{yst, .{xs_, ya_, ya_, xa_}}, .{xac, .{ys_, ys_ }} }) |list| { if (list[0](p)) { grid.addCell(p.*,1); inline for (list[1]) |next| { next(p); grid.addCell(p.*,1); } } } } // const tA = [_]vec{xst, ys_, xa_, xa_, ya_, yac, xs_, xs_ }; fn topA(p: *Self) void { inline for ( .{ .{xst, .{ys_, xa_, xa_, ya_}}, .{yac, .{xs_, xs_}} }) |list| { if (list[0](p)) { grid.addCell(p.*,1); inline for (list[1]) |next| { next(p); grid.addCell(p.*,1); } } } } // const blA = [_]vec{yat, xa_, ys_, ysc, xs_, xsc, yac, ya_ }; fn lowerLeftA(p: *Self) void { inline for (.{ .{yat, .{xa_, ys_}}, .{ysc, .{xs_}}, .{xsc, .{}}, .{yac, .{ya_}} }) |list| { if (list[0](p)) { grid.addCell(p.*,1); inline for (list[1]) |next| { next(p); grid.addCell(p.*,1); } } else { inline for (list[1]) |next| { next(p); } } } } // const brA = [_]vec{xst, ya_, xa_, xac, ys_, ysc, xsc, xs_ }; fn lowerRightA(p: *Self) void { inline for (.{ .{xst, .{ya_, xa_}}, .{xac, .{ys_}}, .{ysc, .{}}, .{xsc, .{xs_}} }) |list| { if (list[0](p)) { grid.addCell(p.*,1); inline for (list[1]) |next| { next(p); grid.addCell(p.*,1); } } else { inline for (list[1]) |next| { next(p); } } } } // const tlA = [_]vec{xat, ys_, xs_, xsc, ya_, yac, xac, xa_ }; fn topLeftA(p: *Self) void { inline for (.{ .{xat, .{ys_, xs_}}, .{xsc, .{ya_}}, .{yac, .{}}, .{xac, .{xa_}} }) |list| { if (list[0](p)) { grid.addCell(p.*,1); inline for (list[1]) |next| { next(p); grid.addCell(p.*,1); } } else { inline for (list[1]) |next| { next(p); } } } } // const trA = [_]vec{yst, xs_, ya_, yac, ya_, yac, xsc, xs_ }; fn topRightA(p: *Self) void { inline for (.{ .{yst, .{xs_, ya_}}, .{yac, .{xa_}}, .{xac, .{}}, .{ysc, .{ys_}} }) |list| { if (list[0](p)) { grid.addCell(p.*,1); inline for (list[1]) |next| { next(p); grid.addCell(p.*,1); } } else { inline for (list[1]) |next| { next(p); } } } } fn xa_(p: *Self) callconv(.Inline) void { p.x +%= 1; } fn xat(p: *Self) callconv(.Inline) bool { p.x +%= 1; return true; } fn xac(p: *Self) callconv(.Inline) bool { p.x +%= 1; return grid.active[grid.index(p.x|m, p.y|m)]; } fn xa2(p: *Self) callconv(.Inline) void { p.x +%= 2; } fn xa2c(p: *Self) callconv(.Inline) bool { p.x +%= 2; return grid.active[grid.index(p.x|m, p.y|m)]; } fn xs_(p: *Self) callconv(.Inline) void { p.x -%= 1; } fn xst(p: *Self) callconv(.Inline) bool { p.x -%= 1; return true; } fn xsc(p: *Self) callconv(.Inline) bool { p.x -%= 1; return grid.active[grid.index(p.x|m, p.y|m)]; } fn xs2c(p: *Self) callconv(.Inline) bool { p.x -%= 2; return grid.active[grid.index(p.x|m, p.y|m)]; } fn ya_(p: *Self) callconv(.Inline) void { p.y +%= 1; } fn yat(p: *Self) callconv(.Inline) bool { p.y +%= 1; return true; } fn yac(p: *Self) callconv(.Inline) bool { p.y +%= 1; return grid.active[grid.index(p.x|m, p.y|m)]; } fn ya2(p: *Self) callconv(.Inline) void { p.y +%= 2; } fn ya2c(p: *Self) callconv(.Inline) bool { p.y +%= 2; return grid.active[grid.index(p.x|m, p.y|m)]; } fn ys_(p: *Self) callconv(.Inline) void { p.y -%= 1; } fn yst(p: *Self) callconv(.Inline) bool { p.y -%= 1; return true; } fn ysc(p: *Self) callconv(.Inline) bool { p.y -%= 1; return grid.active[grid.index(p.x|m, p.y|m)]; } fn ys2c(p: *Self) callconv(.Inline) bool { p.y -%= 2; return grid.active[grid.index(p.x|m, p.y|m)]; } }; // // const mA = [_]vec{xa_, ya_, xs_, xs_, ys_, ys_, xa_, xa_ }; // // const bA = [_]vec{xs_, ya_, xa_, xa_, ys_, ysc, xs_, xs_ }; // // const lA = [_]vec{ya_, xa_, ys_, ys_, xs_, xsc, ya_, ya_ }; // // const rA = [_]vec{ys_, xs_, ya_, ya_, xa_, xac, ys_, ys_ }; // // const tA = [_]vec{xs_, ys_, xa_, xa_, ya_, yac, xs_, xs_ }; // // const blA = [_]vec{ya_, xa_, ys_, ysc, xs_, xsc, yac, ya_ }; // // const brA = [_]vec{xs_, ya_, xa_, xac, ys_, ysc, xsc, xs_ }; // // const tlA = [_]vec{xa_, ys_, xs_, xsc, ya_, yac, xac, xa_ }; // // const trA = [_]vec{ys_, xs_, ya_, yac, ya_, yac, xsc, xs_ }; // // //const mI = [_]vec{}; // skip (25% of a 4x4 area) // //const bI = [_]vec{ysc, xs_, xa2 }; // 1 test, three checks (12.5% or 4x4 area) // //const lI = [_]vec{xsc, ys_, ya2 }; // 1 test, three checks (12.5% or 4x4 area) // //const rI = [_]vec{xac, ys_, ya2 }; // 1 test, three checks (12.5% or 4x4 area) // //const tI = [_]vec{yac, xs_, xa2 }; // 1 test, three checks (12.5% or 4x4 area) // //const blI = [_]vec{ysc, xa_, xs2c, yac, ya_ }; // 3 tests, 5 checks (6.25% of 4x4 area) // //const brI = [_]vec{xac, ya_, ys2c, xsc, xs_ }; // 3 tests, 5 checks (6.25% of 4x4 area) // //const tlI = [_]vec{xsc, ys_, ya2c, xac, xa_ }; // 3 tests, 5 checks (6.25% of 4x4 area) // //const trI = [_]vec{yac, xs_, xa2c, ysc, ys_ }; // 3 tests, 5 checks (6.25% of 4x4 area) const Cell = packed struct { p: Point, // point for this cell n: MaxIndex, // index for the next cell in the same hash chain (index is faster than using pointers) v: u8, // cells value }; var theSize:usize = 0; const Hash = struct { hash: []MaxIndex, // pointers into the cells arraylist (2^order x 2^order hash table) active: []bool, // flag if 4x4 area is static // mask:u32, order:u5, // hash size is 2^(order+order), u5 for << and >> with usize and a var shift:u5, // avoid a subtraction in index fn init(size:usize) !Hash { // log2 of the population from the last iteration. The ammount of memory used is a tradeoff // between the length of the hash/heap chains and the time taken to clear the hash array. if (size < theSize/2 or size > theSize) // reduce order bouncing and (re)allocates theSize = size; const o = @intCast(u5,std.math.clamp(31-@clz(@TypeOf(theSize),theSize+1)/2+1, 6, 12)); return Hash{ .hash=undefined, .active=undefined, // .mask=(@as(u32,1)<<o)-1, .order = o, .shift = @intCast(u5,31-o+1), // 32-o fails with a comiplier error... }; } fn assign(self:*Hash,s:Hash) !void { if (self.order != s.order) { self.order = s.order; self.shift = s.shift; // self.mask = s.mask; allocator.free(self.hash); self.hash = try allocator.alloc(MaxIndex,@as(u32,1)<<2*self.order); } // clear the hash table pointers // from valgrind, only @memset is using the os memset call // for (self.hash) |*c| c.* = null; // std.mem.set(?*Cell,self.hash,null); @memset(@ptrCast([*]u8,self.hash),0,@sizeOf(MaxIndex)*@as(u32,1)<<2*self.order); self.active = s.active; } fn takeStatic(self:*Hash,s:*Hash) !void { if (self.order != s.order) { allocator.free(s.active); s.active = try allocator.alloc(bool,@as(u32,1)<<2*self.order); // this is accessed via hashing so making it smaller } // causes more collision and its slower self.active = s.active; // mark all tiles as static to start // from valgrind, only @memset uses the os memset // for (self.active) |*t| t.* = false; // std.mem.set(bool,self.active,false); @memset(@ptrCast([*]u8,self.active),0,@sizeOf(bool)*@as(u32,1)<<2*self.order); } fn deinit(self:Hash) void { allocator.free(self.hash); allocator.free(self.active); } fn setActive(self:*Hash,p:Point) callconv(.Inline) void { // Collisions are ignored here, more tiles will be flagged as active which is okay //const ttt = tracy.trace(@src()); //defer ttt.end(); const i = staticSize; // global is not faster, must be 2^N const m:Coord = staticSize-1; // 2^N-1 is a binary mask of N ones. //const mask = @bitCast(u64,Point{.x=m, .y=m}); //const t = @bitCast(Point,@bitCast(u64,p)|mask); //const a = @bitCast(Point,@bitCast(u64,p)&mask); var t = Point{.x=p.x|m, .y=p.y|m}; // using a const for t and var tx=t.x, ty=t.y is slower // using masks instead of shifting is also faster const x = p.x & m; const y = p.y & m; // 4x4 tiles are optimal, 2x2 and 8x8 also work but not as well self.active[self.index(t.x, t.y)] = true; if (x==m ) self.active[self.index(t.x+%i, t.y )] = true; // this is faster than iterating around the point if (x==m and y==m) self.active[self.index(t.x+%i, t.y+%i)] = true; // as we do with the Area struct if ( y==m) self.active[self.index(t.x , t.y+%i)] = true; if (x==0 and y==m) self.active[self.index(t.x-%i, t.y+%i)] = true; if (x==0 ) self.active[self.index(t.x-%i, t.y )] = true; if (x==0 and y==0) self.active[self.index(t.x-%i, t.y-%i)] = true; if ( y==0) self.active[self.index(t.x , t.y-%i)] = true; if (x==m and y==0) self.active[self.index(t.x+%i, t.y-%i)] = true; } // use the middle bits of the square of the coord to create the index. No need // to add a seed since this is not used for a sequence (see: Middle Square Weyl) // valgrind shows the low 32bits of the 64bit product is saved. So we use the // high bits from the 32bits to generate the index. // passing x, y instead of a point lets the compiler generate beter code (~25% faster) and speed counts here fn index(self:Hash, x:u32, y:u32) callconv(.Inline) u32 { // this faster than bitCast a point to u64 and hashing with that value return (( x*%x >> self.shift) ^ ( y*%y >> self.shift << self.order)); } // fn index(self:Hash, x:u32, y:u32) callconv(.Inline) u32 { // only use if there is no hw multiply // return (( x & self.mask) ^ // ( y & self.mask << self.order)); // } // find a Cell in the heap and increment its value, if not known, link it in and set its initial value //fn addCell(self:*Hash, p:Point, v:u8) callconv(.Inline) void { fn addCell(self:*Hash, p:Point, v:u8) void { //const ttt = tracy.trace(@src()); //defer ttt.end(); const h = &self.hash[self.index(p.x, p.y)]; // zig does not have 2D dynamic arrays so we fake it... (using const x=p.x etc is no faster) var i:MaxIndex = h.*; // index of the current Cell, 0 implies EOL while (true) { // loop until we have added or updated the cell const head = i; // save the current index at the head of the hash chain (h), for linking & retries while (i!=0) { // using an index is faster (and smaller) than using pointers const c = &cells.items[i]; if (@bitCast(u64,p) == @bitCast(u64,c.p)) { // is this our target cell? (@bitCast(u64... is faster) if (Threads == 1) c.v += v // add value to existing cell else _ = @atomicRmw(u8,&c.v,.Add,v,.Monotonic); return; } i = c.n; } cells.items[iCells] = Cell{.p=p, .n=head, .v=v}; // cell not in heap, add it. Note iCells is threadlocal. if (Threads == 1) { h.* = iCells; // link to head of list iCells += Threads; // commit the cell std.debug.assert(iCells < cells.capacity); return; } else { i = @cmpxchgStrong(MaxIndex, h, head, iCells, .Release, .Monotonic) orelse { // weak iis not measurabily faster iCells += Threads; // commit the cell std.debug.assert(iCells < cells.capacity); return; }; } } } }; var screen:*display.Buffer = undefined; var cbx:u32 = undefined; // starting center of activity var cby:u32 = undefined; var cbx_:u32 = undefined; // alternate center of activity (toggle with w) var cby_:u32 = undefined; var xl:u32 = origin; // window at origin to start, size to be set var xh:u32 = 0; var yl:u32 = origin; var yh:u32 = 0; const Track = 11; // ±262144k to ±256 var dx:i32 = 0; // used to track activity for autotracking var ix:i32 = 0; var dy:i32 = 0; var iy:i32 = 0; var tg:isize = 1; // number of generations used for autotracking, if negitive autotracking is disabled var tg_:isize = 1; // alternate toggle (for w command) var zn:usize = 0; // generation of next display window switch var b:u32 = 0; // births and deaths var d:u32 = 0; var gpa = std.heap.GeneralPurposeAllocator(.{}) {}; const allocator = &gpa.allocator; //const allocator = std.heap.c_allocator; var alive = [_]std.ArrayList(Point){undefined} ** Threads; // alive cells, static cell stay in this list var cells = std.ArrayList(Cell).init(allocator); // could be part of Hash structure, deallocation is easier this way var grid:Hash = undefined; // the current hash containing cells and the static tiles mask array var newgrid:Hash = undefined; // what will be come the next grid hash var cellsLen=[_]u32{undefined} ** Threads; // array to record iCells values when exiting threads var work = std.atomic.Atomic(u32).init(1); // threads waiting to start working wait here var fini = std.atomic.Atomic(u32).init(1); // thread done working wait here var ready = std.atomic.Atomic(u32).init(1); // used to notify main thread when all worker threads are ready var done = std.atomic.Atomic(u32).init(1); // used to notify main thread when all worker threads are done var working = std.atomic.Atomic(u32).init(0); // active worker threads var checking = processAlive; // controls what processing is done by worker threads var going:bool = true; // false when quitting var disp = std.atomic.Atomic(u32).init(1); // used to notify display thread to start var pushing:?*display.Buffer = null; // buffer to push or null threadlocal var iCells:MaxIndex = undefined; // index to cells thead partitionthreadlocal var flag:bool = undefined; var cellsMax:u32 = 0; // largest length of the cellLen subarrays var staticMax:u32 = 0; pub fn pushScreen() void { // Thread for display (lazy) updates //const ttt = tracy.trace(@src()); //defer ttt.end(); //var dw = disp.acquire(); // we own this mutex while (going) { pushing = null; // tell main loop we are ready to display std.Thread.Futex.wait(&disp,1,timeOut) catch unreachable; // wait for main thread to wake us disp.store(1,.Release); if (pushing) |pushIt| // main loop sets pushing with the buffer to push to the display display.push(pushIt.*) catch unreachable; } } pub fn worker(t:MaxIndex) void { // worker threads for generation updates use this function while (going) { if (working.fetchAdd(1, .AcqRel) == Threads-1) { // notify main thread when all workers are ready ready.store(0, .Release); std.Thread.Futex.wake(&ready,1); } std.Thread.Futex.wait(&work,1,timeOut) catch unreachable; // wait for main thread to wake us if (going) checking(t); // call worker function if (working.fetchSub(1, .AcqRel) == 1) { // notify main thead when workers are all doen done.store(0, .Release); std.Thread.Futex.wake(&done,1); } std.Thread.Futex.wait(&fini,1,timeOut) catch unreachable; // wait for main thread to wake us } } pub fn processAlive(t:MaxIndex) void { // process cells in alive[t] adding to cells //const ttt = tracy.trace(@src()); //defer ttt.end(); const yw = [_]u8{0} ++ ([_]u8{3}**(staticSize-2)) ++ [_]u8{6}; const xw = [_]u8{0} ++ ([_]u8{1}**(staticSize-2)) ++ [_]u8{2}; const list = &alive[t]; // extacting x and y and using them does not add more speed here const m = staticSize-1; iCells = if (t!=0) t else Threads; // Zero indicates a EOL. Threadlocal var, we trade memory for thread safey // and speed treating the arrayList as a group of dynamic arrays. var i:u32 = 0; while (i < list.items.len) { // add cells to the hash to enable next generation calculation var p = list.items[i]; // add point to surrounding area // if cell is within the display window update the screen buffer if (p.y > yl and p.y <= yh and p.x >= xl and p.x <= xh) { // p.y > yl to avoid writing on the status line screen.cellRef(p.y-yl, p.x-xl).char = 'O'; } const x = p.x&m; const y = p.y&m; if (grid.active[grid.index(p.x|m, p.y|m)]) { // active flag list.items[i] = list.items[list.items.len-1]; // swap and remove last item ( optimized list.swapRemove(i); ) list.items.len -= 1; grid.addCell(p,10); // add the effects of the cell //Point.otherA(&p); Point.active[yw[y]+xw[x]](&p); } else { i += 1; // keep static cells in alive list - they are stable, but may have effects Point.static[yw[y]+xw[x]](&p); } } cellsLen[t] = iCells; // save the size of the cell partition for this thread } pub fn processCells(t:MaxIndex) void { // this only gets called in threaded mode when checkMax exceed the cellsThreading threshold //const ttt = tracy.trace(@src()); //defer ttt.end(); alive[t].ensureCapacity(staticMax+cellsMax/Threads/2) catch unreachable; const sub:u32 = @as(u32,0b00001000_00000000_00000000) >> @intCast(u5,std.math.absCast(tg)); // 2^20 shifted by abs(tg), larger tg smaller area. var _ix:i32 = 0; // use local copies so tracking works (the updates can race and, if it happens too often, tracking fails) var _iy:i32 = 0; var _dx:i32 = 0; var _dy:i32 = 0; var k:u32 = t; // thread to use for this chunk (think of cells as 2D [Threads,m] with m different for each thread) var i:u32 = k; // thread index into cells, used to loop through a chunk's cells for a given thread [k,i], [k,i+Threads...] var l:u32 = Threads; // number of chunks running (m exceeded) for k(th) thread var p:u32 = Threads*chunkSize; // start of next chunk [0, Threads*chunkSize*n] where n is 0,1,2,... var h=[_]bool{false} ** Threads; // true when thread's partition is finished (count once...) while (l > 0) : ({ k = (k+1)%Threads; i = p+k; p += Threads*chunkSize; }) { if (h[k]) continue; while (i < p) : (i += Threads) { if (i>=cellsLen[k]) { l -= 1; h[k] = true; break; } const c = cells.items[i]; if (c.v < 10) { if (c.v == 3) { std.debug.assert(alive[t].items.len < alive[t].capacity); alive[t].appendAssumeCapacity(c.p); // birth so add to alive list & flag tile(s) as active newgrid.setActive(c.p); if (c.p.x > cbx) { const tmp = c.p.x-cbx; if (tmp < sub and tmp > 0) // the tmp > 0 is so stable patterns do not drift with autotracking _ix += @intCast(i32,@clz(u32,tmp)); } else { const tmp = cbx-c.p.x; if (tmp < sub and tmp > 0) _dx += @intCast(i32,@clz(u32,tmp)); } if (c.p.y > cby) { const tmp = c.p.y-cby; if (tmp < sub and tmp > 0) _iy += @intCast(i32,@clz(u32,tmp)); } else { const tmp = cby-c.p.y; if (tmp < sub and tmp > 0) _dy += @intCast(i32,@clz(u32,tmp)); } b += 1; // can race, not critical } } else if (c.v == 12 or c.v == 13) { // active cell that survives std.debug.assert(alive[t].items.len < alive[t].capacity); alive[t].appendAssumeCapacity(c.p); } else { newgrid.setActive(c.p); if (c.p.x > cbx) { const tmp = c.p.x-cbx; if (tmp < sub and tmp > 0) _ix -= @intCast(i32,@clz(u32,tmp)); } else { const tmp = cbx-c.p.x; if (tmp < sub and tmp > 0) _dx -= @intCast(i32,@clz(u32,tmp)); } if (c.p.y > cby) { const tmp = c.p.y-cby; if (tmp < sub and tmp > 0) _iy -= @intCast(i32,@clz(u32,tmp)); } else { const tmp = cby-c.p.y; if (tmp < sub and tmp > 0) _dy -= @intCast(i32,@clz(u32,tmp)); } d += 1; // can race, not critical } } } ix += _ix; // if this races once in a blue moon its okay iy += _iy; dx += _dx; dy += _dy; } // pub fn ReturnOf(comptime func: anytype) type { // return switch (@typeInfo(@TypeOf(func))) { // .Fn, .BoundFn => |fn_info| fn_info.return_type.?, // else => unreachable, // }; // } pub fn main() !void { var t:MaxIndex = 0; // used for iterating up to Threads while (t<Threads) : ( t+=1 ) { alive[t] = std.ArrayList(Point).init(allocator); defer alive[t].deinit(); } // make sure to cleanup the arrayList(s) defer cells.deinit(); try cells.ensureCapacity((8+Threads)*chunkSize*numChunks); defer grid.deinit(); // this also cleans up newgrid's storage //const stdout = std.io.getStdOut().writer(); try display.init(allocator); // setup zbox display defer display.deinit(); errdefer display.deinit(); try display.setTimeout(0); // do not wait for keypresses try display.handleSignalInput(); try display.cursorHide(); // hide the cursor defer display.cursorShow() catch {}; errdefer display.cursorShow() catch {}; try display.clear(); // be sure to start with a clean display var size = try display.size(); var cols:u32 = @intCast(u32,size.width); var rows:u32 = @intCast(u32,size.height); var s0 = try display.Buffer.init(allocator, size.height, size.width); defer s0.deinit(); var s1 = try display.Buffer.init(allocator, size.height, size.width); defer s1.deinit(); var gen: u32 = 0; // generation var pop:u32 = 0; // poputlation var static:u32 = 0; // static cells // rle pattern decoding var X:Coord = origin; var Y:Coord = origin; var count:Coord = 0; t = 0; for (pattern) |c| { switch (c) { 'b' => {if (count==0) {X+=1;} else {X+=count; count=0;}}, 'o' => { if (count==0) count=1; while (count>0):(count-=1) { if (Threads != 1) { if (alive[t].items.len & 0xf == 0) { t = if (t<Threads-1) t+1 else 0; } } try alive[t].append(Point{.x=X, .y=Y}); X+=1; pop+=1; } }, '0'...'9' => {count=count*10+(c-'0');}, '$' => {X=origin; if (count==0) {Y+=1;} else {Y+=count; count=0;}}, '!' => {break;}, else => {}, } if (X>xh) xh=X; } yh=Y; // set initial display window var s:u32 = 0; // update display even 2^s generations var inc:u32 = 20; // max ammount to move the display window at a time cbx = (xh-origin)/2+origin; // starting center of activity cby = (yh-origin)/2+origin; cbx_ = cbx; // and the alternate (for w command) cby_ = cby; xl = cbx - cols/2; // starting display window xh = xl + cols - 1; yl = cby - rows/2; yh = yl + rows - 1; var yl_:u32 = yl; // saved yl, used to optimize screen updated screen = &s0; // starting buffer screen.clear(); // initial grid. The cells arrayList is sized so it will not grow during a calcuation so pointers are stable grid = try Hash.init(9*pop); // this sets the order of the Hash (no allocations are done) grid.hash = try allocator.alloc(MaxIndex,1); // initialize with dummy allocations for .takeStatic and .assign to free grid.active = try allocator.alloc(bool,1); newgrid = try Hash.init(9*pop); // set the order for the generation grid.order = 0; // this forces grid.assign & newgrid.takeStatic to reallocate storage for hash and static. try newgrid.takeStatic(&grid); t = 0; while (t<Threads) : ( t+=1 ) { // for all threads for (alive[t].items) |p| // set all tiles active for the first generation { newgrid.setActive(p); } try alive[t].ensureCapacity(chunkSize*numChunks); } b = @intCast(u32,pop); // everything is a birth at the start var ogen:u32 = 0; // info for rate calculations var rate:usize = 1; var rtime:i64 = std.time.milliTimestamp()+1_000; var rk:f32 = 0; var pk:f32 = 0; var r10k:f32 = 0; var limit:usize = 65536; // optimistic rate limit var sRate:usize = 1; var sRate_ = sRate; var delay:usize = 0; //var w = work.acquire(); // block processing/check update theads t = 0; while (t<Threads) : ( t+=1 ) { // start the workers const h = try std.Thread.spawn(.{},worker,.{t}); h.detach(); // or h.join() to wait } { const h = try std.Thread.spawn(.{},pushScreen,.{}); // start display thread h.detach(); } // main event/life loop while (going) { //var i:u32 = 0; // var for loops try grid.assign(newgrid); // assign newgrid to grid (if order changes reallocate hash storage) cells.clearRetainingCapacity(); // will help when resizing an empty arrayList avoids a mem.copy try cells.ensureCapacity((pop-static)*(8+Threads)); cells.expandToCapacity(); // arrayList length to max // populate hash & heap from alive lists pop = Threads; // sum to get the population t = 0; while (t<Threads) : ( t+=1 ) { pop += @intCast(u32,alive[t].items.len); } checking = processAlive; // tell workers to use processAlive std.Thread.Futex.wait(&ready,1,timeOut) catch unreachable; // wait for workers to be ready ready.store(1,.Release); fini.store(1,.Release); // start the workers work.store(0,.Release); std.Thread.Futex.wake(&work,Threads+1); { const e = (try display.nextEvent()).?; // get and process any user input switch (e) { .up => { cby += inc; zn=gen; if (tg>0) tg = -tg; }, // manually position the display window .down => { cby -= inc; zn=gen; if (tg>0) tg = -tg; }, .left => { cbx += inc; zn=gen; if (tg>0) tg = -tg; }, .right => { cbx -= inc; zn=gen; if (tg>0) tg = -tg; }, .escape => { going=false; }, .other => |data| { const eql = std.mem.eql; if (eql(u8,"t",data) or eql(u8,"T",data)) { if (tg>0) { tg += if (eql(u8,"T",data)) @as(i32,-1) else 1; tg = if (tg > Track) Track else if (tg == 0) 1 else tg; } else tg = -tg; } if (eql(u8,"<",data)) limit = if (limit>1) limit/2 else limit; // limit generation rate if (eql(u8,">",data)) limit = if (limit<16384) limit*2 else limit; if (eql(u8,"[",data)) sRate = if (sRate>1) sRate/2 else sRate; // how fast screen window moves if (eql(u8,"]",data)) sRate = if (sRate<64) sRate*2 else sRate; if (eql(u8,"w",data)) { const t1=cbx; cbx=cbx_; cbx_=t1; // toggle active window const t2=cby; cby=cby_; cby_=t2; const t3=tg; tg=tg_; tg_=t3; const t4=sRate; sRate=sRate_; sRate_=t4; zn = gen; } if (eql(u8,"+",data)) s += 1; // update every 2^s generation if (eql(u8,"-",data)) s = if (s>0) s-1 else s; if (eql(u8,"q",data) or eql(u8,"Q",data)) { going=false; } }, else => {}, } } std.Thread.Futex.wait(&done,1,timeOut) catch unreachable; // wait till all workers are done done.store(1,.Release); work.store(1,.Release); // tell workers to enter ready state fini.store(0,.Release); std.Thread.Futex.wake(&fini,Threads+1); yl = yl_; // restore saved yl (can be used to stop screen updates) if (!going) { work.store(0,.Release); std.Thread.Futex.wake(&work,Threads+1); //w.release(); // quit, we need to doing this when workers are waiting if (pushing==null) { disp.store(0,.Release); std.Thread.Futex.wake(&disp,1); // make sure display thread also ends } return; } // gather stats needed for display and sizing cells, check and alive[] arrayLists cellsMax = 0; static = 0; staticMax = 0; t = 0; while (t<Threads) : ( t+=1 ) { static += @intCast(u32,alive[t].items.len); staticMax = std.math.max(staticMax,@intCast(u32,alive[t].items.len)); cellsMax = std.math.max(cellsMax,cellsLen[t]); } // track births and deaths and info so we can center the display on active Cells const bb = b; // save for screen update const dd = d; b = 0; // zero for processCells d = 0; newgrid = try Hash.init(cellsMax); // newgrid hash fn based on size (use cellsMax to get the order correct) try newgrid.takeStatic(&grid); // if same order, reuse static array from grid otherwise reallocate it checking = processCells; // tell worker to use processCells std.Thread.Futex.wait(&ready,1,timeOut) catch unreachable; // wait for workers to enter ready state ready.store(1,.Release); fini.store(1,.Release); // start the workers work.store(0,.Release); std.Thread.Futex.wake(&work,Threads+1); //f = fini.acquire(); // wait for all worker threads to start //begin.wait(&work); // release work mutex and wait for workers to start and signal //f.release(); // let threads record completions { // use this thread too, at least a little if (std.time.milliTimestamp() >= rtime) { // adjust delay to limit rate as user requests. Results are approximate rtime = std.time.milliTimestamp()+1_000; rate = gen-ogen; ogen = gen; const a = rate*1_000_000_000/(if (500_000_000>delay*rate) 1_000_000_000-delay*rate else 1); // rate without delay (if any) if (a>limit) // if allows "a" to converge on limit delay = 1_000_000_000/limit-1_000_000_000/a else delay = 0; const rr = @intToFloat(f32,(rate*1_000_000_000)/(1_000_000_000-delay*rate)); // first order kalman predictor if (rk!=0) { const kk = pk/(pk+0.4); // kalman gain rk += kk*(rr-rk); // rate prediction pk = (1-kk)*pk + 0.1; // error covariance } else { rk = rr; // initial prediction pk = rr*rr; // and error } } // show the results for this generation (y,x coords) { const tt = if (delay>0) ">" else " "; // needed due compiler buglet with if in print const gg = if (tg<0) 0 else @as(i32,0b00001000_00000000_00000000) >> @intCast(u5,tg); if (gen%10000 == 0) { r10k = rk; } _ = try screen.cursorAt(0,0).writer().print("generation {}({}) population {}({}) births {d:<6} deaths {d:<6} rate{s}{}/s heap({}) {} window({}) {},{} ±{} {d:<5.0}", .{gen, std.math.shl(u32,1,s), pop, pop-static, bb, dd, tt, rate, grid.order, cellsMax, sRate, @intCast(i64,xl)-origin, @intCast(i64,yl)-origin, gg, r10k}); } if (pushing==null and gen%std.math.shl(u32,1,s)==0) { // can we display and do we want to? //const dw = disp.acquire(); pushing = screen; // update with new buffer to push disp.store(0,.Release); std.Thread.Futex.wake(&disp,1); //push.signal(); // signal display pushing thread to start // dw.release(); if (screen == &s0) // switch to alternate buffer for next display cycle screen = &s1 else screen = &s0; if (gen == 0) // briefly show the starting pattern std.time.sleep(1_000_000_000); } gen += 1; if (tg<0) { // switch focus of center of activity as per user or autotracking xl = cbx - cols/2; xh = xl + cols - 1; yl = cby - rows/2; yh = yl + rows - 1; } else if (gen>=zn) { if (std.math.absCast(xl +% cols/2 -% cbx) > 2*cols/3) { xl = cbx - cols/2; xh = xl + cols - 1; } if (std.math.absCast(yl +% rows/2 -% cby) > 2*rows/3) { yl = cby - rows/2; yh = yl + rows - 1; } zn = gen+sRate*rate/std.math.clamp(62-@clz(@TypeOf(rate),rate+1),1,10); // 1/10 second above 8192/s down to 1s at 8/s } // update the size of screen buffer size = try display.size(); if (size.width != screen.width or size.height != screen.height) try screen.resize(size.height, size.width); if (size.width != cols or size.height != rows) { cols = @intCast(u32,size.width); rows = @intCast(u32,size.height); xl = cbx - cols/2; xh = xl + cols - 1; yl = cby - rows/2; yh = yl + rows - 1; } // clear the internal screen display buffer yl_ = yl; // save yl incase we set it to maxInt if (gen%std.math.shl(u32,1,s)==0) screen.clear() // prep buffer else yl = std.math.maxInt(u32); // ignore buffer (add nothing to screen buffer) // higher rates yield smaller increments inc = std.math.max(@clz(@TypeOf(rate),rate+1)-16,1); // move autotracking faster with lower rates } std.Thread.Futex.wait(&done,1,timeOut) catch unreachable; // wait for all workers to be done done.store(1,.Release); work.store(1,.Release); // tell workers to get ready fini.store(0,.Release); std.Thread.Futex.wake(&fini,Threads+1); if (delay>0) // delay to limit the rate std.time.sleep(delay); // adjust cbx for an eventually move of the display window. if (tg>0) { dx = std.math.absInt(dx) catch unreachable; ix = std.math.absInt(ix) catch unreachable; if (std.math.absCast(ix-dx) >= inc) { if (ix > dx) cbx += inc else if (ix < dx) cbx -= inc; } } // adjust cby for an eventually move of the display window. if (tg>0) { dy = std.math.absInt(dy) catch unreachable; iy = std.math.absInt(iy) catch unreachable; if (std.math.absCast(iy-dy) >= inc) { if (iy > dy) cby += inc else if (iy < dy) cby -= inc; } } // clear counters for tracking info in the next generation dx = 0; ix = 0; dy = 0; iy = 0; } }
src/life.zig
const os = @import("root").os; const std = @import("std"); const builtin = std.builtin; const atmcqueue = os.lib.atmcqueue; const thread = os.thread; const kepler = os.kepler; /// Note is the object that represents a notification. /// They are allocated in place in other types, such as /// .Stream or .Endpoint pub const Note = struct { /// Type of the notification pub const Type = enum { /// Sent to server's notification queue when a new request /// to create a new stream on the owned endpoint was issued. /// Once recieved, a stream object is mapped to the object /// space of the server thread in a pending state RequestPending, /// Sent to client's notification queue when its request /// to make a stream was accepted. Once recieved, kernel /// performs the work needed for it to be used to exchange /// further notifications RequestAccepted, /// Sent to client's notification queue when its request /// to make a stream was denied. Once recieved, kernel /// transfers consumer to the .Denied state, in which /// the only valid call on the stream would be close() RequestDenied, /// Sent to server's notification queue with the intent /// to notify the server that more tasks are available /// for it to handle. TasksAvailable, /// Sent to client's notification queue with the intent /// to notify the client that some of the task were /// completed and their results are available to the client ResultsAvailable, /// Sent to the server's notification queue when client leaves /// to notify the server that client has abandoned the stream ConsumerLeft, /// Sent to the client's notification queue when server leaves /// to notify the client that server has abandoned the stream ProducerLeft, /// Sent to the server's notification queue to indicate that /// all endpoints are lost. The intent is to allow server /// to cleanup all the structures that were used for the endpoint EndpointUnreachable, /// Sent to the driver whenever owned InterruptObject /// raises interrupt InterruptRaised, /// Get peer type from the note type (whether this note is directed /// to producer or consumer) pub fn to_peer_type(self: @This()) Stream.Peer { return switch (self) { .RequestPending, .TasksAvailable, .ConsumerLeft, .EndpointUnreachable => .Producer, .RequestAccepted, .RequestDenied, .ResultsAvailable, .ProducerLeft => .Consumer, .InterruptRaised => @panic("to_peer_type called on a wrong message type"), }; } }; /// Hook for the atomic queue in NoteQueue hook: atmcqueue.Node = undefined, /// Type of the notification typ: Type, /// Borrowed reference to the owner owner_ref: union { /// For all the note types except for .EndpointUnreachable, this /// field stores reference to the stream object over which message was sent stream: *Stream, /// For the .EndpointUnreachable, this field stores the reference to the endpoint, /// all references to which are already lost endpoint: *Endpoint, /// For the .interruptRaised, this field stores the reference to the InterruptObject /// that has raised the interrupt interrupt: *kepler.interrupts.InterruptObject, }, /// Drop reference from the note. pub fn drop(self: *@This()) void { if (self.typ == .EndpointUnreachable) { self.owner_ref.endpoint.drop(); } else if (self.typ == .InterruptRaised) { self.owner_ref.interrupt.drop(); } else { self.owner_ref.stream.drop(); } } /// Determine if note is up to date, meaning that this /// notification would have any worth to queue owner. /// The meaning of that depends on the note typpe fn is_active(self: *@This()) bool { switch (self.typ) { // For .RequestPending type, we need to check // that endpoint client tries to connect to // is still up .RequestPending => { if (!self.owner_ref.stream.endpoint.is_active()) { return false; } }, // For .EndpointUnreachable, we need to check that // endpoint is still up .EndpointUnreachable => { if (!self.owner_ref.endpoint.is_active()) { return false; } }, // For .RequestDenied and .RequestAccepted types, we need to check that // we still have pending stream object unclosed .RequestDenied, .RequestAccepted => { if (!self.owner_ref.stream.assert_status(.Consumer, .Pending)) { return false; } }, // For .TasksAvailable/.ResultsAvailable/.ConsumerLeft/.ProducerLeft // just check that we are still connected to the stream .TasksAvailable, .ResultsAvailable, .ConsumerLeft, .ProducerLeft => { const peer = self.typ.to_peer_type(); if (!self.owner_ref.stream.assert_status(peer, .Connected)) { return false; } }, // For .InterruptRaised, check if new interrupts are still being // waited for .InterruptRaised => { if (!self.owner_ref.interrupt.is_active()) { return false; } }, } return true; } }; /// NoteQueue is the object that represents a notification queue for a thread pub const NoteQueue = struct { /// Notification queue state pub const State = enum(usize) { /// but it will handle all the ones sent Up, Down }; /// Atomic queue that acts as a contatiner for the messages queue: atmcqueue.MPSCUnboundedQueue(Note, "hook"), /// Event object to listen for incoming messages event: thread.SingleListener, /// Refernce count ref_count: usize, /// State of the notification queue state: State, /// Allocator used to allocate the queue allocator: *std.mem.Allocator, /// Create notification stream object pub fn create(allocator: *std.mem.Allocator) !*@This() { const instance = try allocator.create(@This()); instance.queue.init(); instance.ref_count = 1; instance.state = .Up; instance.allocator = allocator; instance.event = thread.SingleListener.init(); return instance; } /// Borrow reference to the queue pub fn borrow(self: *@This()) *@This() { _ = @atomicRmw(usize, &self.ref_count, .Add, 1, .AcqRel); return self; } /// Drop reference to the queue pub fn drop(self: *@This()) void { if (@atomicRmw(usize, &self.ref_count, .Sub, 1, .AcqRel) > 1) { return; } self.deinit(); } /// Dispose queue fn deinit(self: *@This()) void { self.allocator.destroy(self); } /// Send note to the queue pub fn send(self: *@This(), note: *Note) !void { // Check queue state for the first time if (@atomicLoad(State, &self.state, .Acquire) != .Up) { return error.ThreadUnreachable; } // Notify queue owner about a new message if (!self.event.trigger()) { return error.ThreadUnreachable; } // Add note to the queue self.queue.enqueue(note); } /// Try to get a note from the queue pub fn try_recv(self: *@This()) ?*Note { retry: while (self.event.try_ack()) { // Poll until we get the message while (true) { const note = self.queue.dequeue() orelse continue; // Dispose note if its useless if (!note.is_active()) { note.drop(); break :retry; } return note; } } return null; } /// Wait for new notes pub fn wait(self: *@This()) void { self.event.wait(); } /// Terminate the queue pub fn terminate(self: *@This()) void { // Prevent messages in the long run @atomicStore(State, &self.state, .Down, .Release); self.event.block(); // Poll until we deallocate everything while (self.event.try_ack()) { const note = self.queue.dequeue() orelse continue; note.drop(); } // Drop reference to this queue self.drop(); } }; /// Endpoint is the object that listens for new incoming connections pub const Endpoint = struct { /// Note queue endpoint is attached to queue: *NoteQueue, /// Non-owning reference count non_own_ref_count: usize, /// Owning reference count /// +1 for connected server /// +1 if any client is connected own_ref_count: usize, /// Set to true if owner has dropped the endpoint dying: bool, /// Allocator used to allocate the endpoint allocator: *std.mem.Allocator, /// Note that will be sent to the owner's notification queue /// when all references to the endpoint are lost death_note: Note, /// Set to true if death note was already sent death_note_sent: bool, /// Create an endpoint pub fn create(allocator: *std.mem.Allocator, queue: *NoteQueue) !*@This() { const instance = try allocator.create(@This()); instance.queue = queue.borrow(); instance.non_own_ref_count = 0; instance.own_ref_count = 2; instance.death_note_sent = false; instance.dying = false; instance.allocator = allocator; return instance; } /// Send a join request fn send_request(self: *@This(), note: *Note) !void { if (!self.is_active()) { return error.EndpointUnreachable; } try self.queue.send(note); } /// Borrow non-owning reference to the endpoint pub fn borrow(self: *@This()) *@This() { _ = @atomicRmw(usize, &self.non_own_ref_count, .Add, 1, .AcqRel); return self; } /// Drop non-owning reference to the endpoint pub fn drop(self: *@This()) void { if (@atomicRmw(usize, &self.non_own_ref_count, .Sub, 1, .AcqRel) > 1) { return; } // At this point, all non-owning references are lost // If death note was already sent, we can decrement owning count // as no more client references will be sent if (@atomicLoad(bool, &self.death_note_sent, .Acquire)) { self.decrement_internal(); return; } // If it wasn't set, we don't want to decrement owning-refcount, // as note will still store client (non-ownning) references to the object @atomicStore(bool, &self.death_note_sent, true, .Release); // Check if server is already dead. If it die later, // server notification queue will clean everything up anyways if (@atomicLoad(bool, &self.dying, .Acquire)) { // If we can't send a reference, just terminate self.decrement_internal(); return; } // Send ping of death note self.death_note.typ = .EndpointUnreachable; self.death_note.owner_ref = .{ .endpoint = self.borrow() }; // If send failed, we can just ignore the failure // drop() called in send() will see that message was already sent // and will terminate self.queue.send(&self.death_note) catch {}; } /// Drop owning reference to the endpoint pub fn shutdown(self: *@This()) void { // Indicate that we shut down the server @atomicStore(bool, &self.dying, true, .Release); // Decrement internal reference count self.decrement_internal(); } /// Decrement internal owning reference count fn decrement_internal(self: *@This()) void { if (@atomicRmw(usize, &self.own_ref_count, .Sub, 1, .AcqRel) > 1) { return; } self.deinit(); } /// Dispose endpoint object fn deinit(self: *@This()) void { self.queue.drop(); self.allocator.destroy(self); } /// Return true if endpoint still listens for incoming connections fn is_active(self: *const @This()) bool { return !@atomicLoad(bool, &self.dying, .Acquire); } }; /// Stream is an object that allows two peers to exchange /// notification with each other. Each stream has only two peers - /// .Producer and .Consumer pub const Stream = struct { /// Peer type pub const Peer = enum(u1) { /// Consumer is the peer that initially sent a request /// to make a stream Consumer = 0, /// Producer is the peer that accepted request to make /// a stream Producer = 1, // Convert to index pub fn idx(self: Peer) u1 { return @enumToInt(self); } // Get enum member for other peer pub fn other(self: Peer) Peer { return @intToEnum(Peer, 1 - self.idx()); } }; /// Peer connection status /// https://github.com/ziglang/zig/issues/7976 pub const PeerStatus = enum(usize) { /// Peer connection is still pending Pending, /// (Producer-only) Producer has already sent a message ResponseSent, /// Peer is going to accept all incoming notifications Connected, /// Peer is no longer connected to the stream Abandoned, }; /// Stream info exposed to userspace pub const UserspaceInfo = struct { /// Size of virtual memory for a consumer-rw producer-ro buffer consumer_rw_buf_size: usize, /// Size of virtual memory for a producer-rw consumer-ro buffer producer_rw_buf_size: usize, /// Size of object mailbox obj_mailbox_size: usize, }; /// Notes that will be used to notify /// producer/consumer about more data to process notes: [2]Note, /// Notification queues of producer and consumer note_queues: [2]*NoteQueue, /// Set to true if a corresponding note can be resent ready_to_resend: [2]bool, /// Peers' connecivity status status: [2]PeerStatus, /// Notes that are used to notify about /// consumer/producer abandoning the stream death_notes: [2]Note, /// Reference count of the stream ref_count: usize, /// Allocator that was used to allocate the stream allocator: *std.mem.Allocator, /// Endpoint stream is attached to endpoint: *Endpoint, /// Memory objects for buffers memory_objs: [2]*kepler.memory.MemoryObject, /// Mailbox object for passing references mailbox: kepler.objects.ObjectRefMailbox, /// Info for userspace info: UserspaceInfo, /// Create stream object /// All stored resources are borrowed pub fn create(allocator: *std.mem.Allocator, consumer_queue: *NoteQueue, endpoint: *Endpoint, info: UserspaceInfo) !*@This() { // Allocate all structures as requested by the stream // Producer RW buffer const producer_rw_object = try kepler.memory.MemoryObject.create(allocator, info.producer_rw_buf_size); errdefer producer_rw_object.drop(); // Consumer RW buffer const consumer_rw_object = try kepler.memory.MemoryObject.create(allocator, info.consumer_rw_buf_size); errdefer consumer_rw_object.drop(); // Mailbox const mailbox = try kepler.objects.ObjectRefMailbox.init(allocator, info.obj_mailbox_size); errdefer mailbox.drop(); // Create the instance and fill out fields const instance = try allocator.create(@This()); errdefer allocator.destroy(instance); instance.ready_to_resend = [2]bool{ false, false }; instance.ref_count = 1; instance.status = [2]PeerStatus{ .Pending, .Pending }; instance.allocator = allocator; instance.info = info; // and queues instance.note_queues = [2]*NoteQueue{ consumer_queue.borrow(), endpoint.queue.borrow() }; errdefer consumer_queue.drop(); errdefer endpoint.queue.drop(); // and endpoint instance.endpoint = endpoint.borrow(); errdefer endpoint.drop(); // and info instance.info = info; // and objects instance.mailbox = mailbox; instance.memory_objs[Peer.Producer.idx()] = producer_rw_object; instance.memory_objs[Peer.Consumer.idx()] = consumer_rw_object; // Prepare message instance.notes[Peer.Producer.idx()].typ = .RequestPending; instance.notes[Peer.Producer.idx()].owner_ref = .{ .stream = instance.borrow() }; // No need to drop instance on errdefer, that will be collected anyway // Send request endpoint.send_request(&instance.notes[Peer.Producer.idx()]) catch |err| { return err; }; return instance; } /// React to the join request by sending accept/request note fn react(self: *@This(), typ: Note.Type) !void { // Check that consumer and producer both have pending status if (!self.is_pending()) { // If we have sent a response already, return // .ResponseAlreadySent error if (self.assert_status(.Producer, .ResponseSent)) { return error.ResponseAlreadySent; } return error.ConnectionEstablished; } // Transition to .ResponseAlreadySent state @atomicStore(PeerStatus, &self.status[Peer.Producer.idx()], .ResponseSent, .Release); // Send message self.notes[Peer.Consumer.idx()].typ = typ; self.notes[Peer.Consumer.idx()].owner_ref = .{ .stream = self.borrow() }; self.note_queues[Peer.Consumer.idx()].send(&self.notes[Peer.Consumer.idx()]) catch |err| { return err; }; } /// Finalize accept/request sequence pub fn finalize_connection(self: *@This()) void { // Allow both threads to exchange messages @atomicStore(bool, &self.ready_to_resend[0], true, .Release); @atomicStore(bool, &self.ready_to_resend[1], true, .Release); // Set states @atomicStore(PeerStatus, &self.status[0], .Connected, .Release); @atomicStore(PeerStatus, &self.status[1], .Connected, .Release); } /// Allow peer to resend notification pub fn unblock(self: *@This(), peer: Peer) void { @atomicStore(bool, &self.ready_to_resend[peer.idx()], true, .Release); } /// Accept join request pub fn accept(self: *@This()) !void { try self.react(.RequestAccepted); } /// Notify other peer about this peer abandoning the stream fn notify_term(self: *@This(), peer: Peer) !void { const target = peer.other(); // Other thread already left, no need to notify if (self.assert_status(target, .Abandoned)) { return; } self.notes[target.idx()].typ = if (peer == .Producer) .ProducerLeft else .ConsumerLeft; self.notes[target.idx()].owner_ref = .{ .stream = self.borrow() }; try self.note_queues[target.idx()].send(&self.notes[target.idx()]); } /// Abandon connection from a given peer's side pub fn abandon(self: *@This(), peer: Peer) void { @atomicStore(PeerStatus, &self.status[peer.idx()], .Abandoned, .Release); if (self.is_pending()) { if (peer == .Producer) { self.react(.RequestDenied) catch {}; } } else { if (!self.assert_status(peer.other(), .Abandoned)) { self.notify_term(peer) catch {}; } } self.drop(); } /// Notify producer or consumer about more tasks /// or more results being available pub fn notify(self: *@This(), peer: Peer) !void { if (!self.is_established()) { return error.ConnectionNotEstablished; } // If notificaton was already sent and not yet handled, just ignore if (!@atomicLoad(bool, &self.ready_to_resend[peer.idx()], .Acquire)) { return; } @atomicStore(bool, &self.ready_to_resend[peer.idx()], false, .Release); // Send notifiaction self.notes[peer.idx()].typ = if (peer == .Consumer) .ResultsAvailable else .TasksAvailable; self.notes[peer.idx()].owner_ref = .{ .stream = self.borrow() }; try self.note_queues[peer.idx()].send(&self.notes[peer.idx()]); } /// Borrow reference to the stream pub fn borrow(self: *@This()) *@This() { _ = @atomicRmw(usize, &self.ref_count, .Add, 1, .AcqRel); return self; } /// Drop non-owning reference to the stream pub fn drop(self: *@This()) void { if (@atomicRmw(usize, &self.ref_count, .Sub, 1, .AcqRel) > 1) { return; } self.deinit(); } /// Dispose queue object pub fn deinit(self: *@This()) void { self.note_queues[0].drop(); self.note_queues[1].drop(); self.endpoint.drop(); self.memory_objs[0].drop(); self.memory_objs[1].drop(); self.mailbox.drop(); self.allocator.destroy(self); } /// Returns true if status of a peer equals to the given one fn assert_status(self: *const @This(), peer: Peer, status: PeerStatus) bool { return @atomicLoad(PeerStatus, &self.status[peer.idx()], .Acquire) == status; } /// Returns true if connection is established fn is_established(self: *const @This()) bool { return self.assert_status(.Consumer, .Connected) and self.assert_status(.Producer, .Connected); } /// Returns true if connection status on both sides is pending fn is_pending(self: *const @This()) bool { return self.assert_status(.Consumer, .Pending) and self.assert_status(.Producer, .Pending); } };
src/kepler/ipc.zig
const std = @import("std"); const eql = std.mem.eql; const print = std.debug.print; const testing = std.testing; const tokenize = std.mem.tokenize; var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; const gpa = gpa_impl.allocator(); const input = @embedFile("./input.txt"); const Nodes = std.StringHashMap(bool); const Graph = std.StringHashMap(Nodes); pub fn main() anyerror!void { print("--- Part One ---\n", .{}); print("Result: {d}\n", .{part1()}); print("--- Part Two ---\n", .{}); print("Result: {d}\n", .{part2()}); } /// /// --- Part One --- /// fn part1() !u32 { var start = "start"; var end = "end"; var graph = try parseGraph(start, end); defer graph.deinit(); var seen = Nodes.init(gpa); defer seen.deinit(); return countPaths(graph, start, end, &seen, false, false); } test "day12.part1" { try testing.expectEqual(@as(u32, 5958), try part1()); } /// /// --- Part Two --- /// fn part2() !u32 { var start = "start"; var end = "end"; var graph = try parseGraph(start, end); defer graph.deinit(); var seen = Nodes.init(gpa); defer seen.deinit(); return countPaths(graph, start, end, &seen, true, false); } test "day12.part2" { try testing.expectEqual(@as(u32, 150426), try part2()); } /// /// parseGraph parses the input into a Graph /// fn parseGraph(start: []const u8, end: []const u8) !Graph { var graph = Graph.init(gpa); var input_iter = tokenize(u8, input, "\n"); while (input_iter.next()) |edge| { var edge_iter = tokenize(u8, edge, "-"); var u = edge_iter.next().?; var v = edge_iter.next().?; if (!graph.contains(u)) { try graph.put(u, Nodes.init(gpa)); } if (!graph.contains(v)) { try graph.put(v, Nodes.init(gpa)); } if (!eql(u8, u, end) and !eql(u8, v, start)) { try graph.getPtr(u).?.put(v, true); } if (!eql(u8, u, start) and !eql(u8, v, end)) { try graph.getPtr(v).?.put(u, true); } } return graph; } /// /// countPaths counts the number of paths in a Graph from start to end /// fn countPaths(g: Graph, start: []const u8, end: []const u8, seen: *Nodes, allow_dupe: bool, is_dupe: bool) u32 { var paths: u32 = 0; var it = g.getPtr(start).?.keyIterator(); while (it.next()) |n| { var neigh = n.*; if (eql(u8, neigh, end)) { paths += 1; continue; } if (seen.contains(neigh) and (!allow_dupe or is_dupe)) { continue; } if (allow_dupe and seen.contains(neigh)) { paths += countPaths(g, neigh, end, seen, allow_dupe, true); continue; } if (neigh[0] >= 'a') { seen.put(neigh, true) catch continue; } paths += countPaths(g, neigh, end, seen, allow_dupe, is_dupe); _ = seen.remove(neigh); } return paths; }
src/day12/day12.zig
const std = @import("std"); usingnamespace (@import("../machine.zig")); usingnamespace (@import("../util.zig")); test "add / adc / and / cmp / or / sbb / sub / xor" { const m32 = Machine.init(.x86_32); const m64 = Machine.init(.x64); debugPrint(false); { const op1 = Operand.register(.AL); const op2 = Operand.immediate8(0x00); testOp2(m64, .ADD, op1, op2, "04 00"); testOp2(m64, .ADC, op1, op2, "14 00"); testOp2(m64, .AND, op1, op2, "24 00"); testOp2(m64, .OR, op1, op2, "0c 00"); testOp2(m64, .SBB, op1, op2, "1c 00"); testOp2(m64, .SUB, op1, op2, "2c 00"); testOp2(m64, .XOR, op1, op2, "34 00"); testOp2(m64, .CMP, op1, op2, "3c 00"); testOp2(m64, .TEST,op1, op2, "A8 00"); } { const op1 = Operand.register(.AX); const op2 = Operand.immediate16(0x00); testOp2(m64, .ADD, op1, op2, "66 05 00 00"); testOp2(m64, .ADC, op1, op2, "66 15 00 00"); testOp2(m64, .AND, op1, op2, "66 25 00 00"); testOp2(m64, .OR, op1, op2, "66 0d 00 00"); testOp2(m64, .SBB, op1, op2, "66 1d 00 00"); testOp2(m64, .SUB, op1, op2, "66 2d 00 00"); testOp2(m64, .XOR, op1, op2, "66 35 00 00"); testOp2(m64, .CMP, op1, op2, "66 3d 00 00"); testOp2(m64, .TEST,op1, op2, "66 A9 00 00"); } { const op1 = Operand.register(.EAX); const op2 = Operand.immediate32(0x00); testOp2(m64, .ADD, op1, op2, "05 00 00 00 00"); testOp2(m64, .ADC, op1, op2, "15 00 00 00 00"); testOp2(m64, .AND, op1, op2, "25 00 00 00 00"); testOp2(m64, .OR, op1, op2, "0d 00 00 00 00"); testOp2(m64, .SBB, op1, op2, "1d 00 00 00 00"); testOp2(m64, .SUB, op1, op2, "2d 00 00 00 00"); testOp2(m64, .XOR, op1, op2, "35 00 00 00 00"); testOp2(m64, .CMP, op1, op2, "3d 00 00 00 00"); testOp2(m64, .TEST,op1, op2, "A9 00 00 00 00"); } { const op1 = Operand.register(.RAX); const op2 = Operand.immediate32(0x00); testOp2(m64, .ADD, op1, op2, "48 05 00 00 00 00"); testOp2(m64, .ADC, op1, op2, "48 15 00 00 00 00"); testOp2(m64, .AND, op1, op2, "48 25 00 00 00 00"); testOp2(m64, .OR, op1, op2, "48 0d 00 00 00 00"); testOp2(m64, .SBB, op1, op2, "48 1d 00 00 00 00"); testOp2(m64, .SUB, op1, op2, "48 2d 00 00 00 00"); testOp2(m64, .XOR, op1, op2, "48 35 00 00 00 00"); testOp2(m64, .CMP, op1, op2, "48 3d 00 00 00 00"); testOp2(m64, .TEST,op1, op2, "48 A9 00 00 00 00"); } { const op1 = Operand.register(.RAX); const op2 = Operand.immediate8(0x00); testOp2(m64, .ADD, op1, op2, "48 83 c0 00"); testOp2(m64, .ADC, op1, op2, "48 83 d0 00"); testOp2(m64, .AND, op1, op2, "48 83 e0 00"); testOp2(m64, .OR, op1, op2, "48 83 c8 00"); testOp2(m64, .SBB, op1, op2, "48 83 d8 00"); testOp2(m64, .SUB, op1, op2, "48 83 e8 00"); testOp2(m64, .XOR, op1, op2, "48 83 f0 00"); testOp2(m64, .CMP, op1, op2, "48 83 f8 00"); } { const op1 = Operand.register(.EAX); const op2 = Operand.immediate8(0x00); testOp2(m64, .ADD, op1, op2, "83 c0 00"); testOp2(m64, .ADC, op1, op2, "83 d0 00"); testOp2(m64, .AND, op1, op2, "83 e0 00"); testOp2(m64, .OR, op1, op2, "83 c8 00"); testOp2(m64, .SBB, op1, op2, "83 d8 00"); testOp2(m64, .SUB, op1, op2, "83 e8 00"); testOp2(m64, .XOR, op1, op2, "83 f0 00"); testOp2(m64, .CMP, op1, op2, "83 f8 00"); } { const op1 = Operand.register(.EAX); const op2 = Operand.immediate8(0x00); testOp2(m64, .ADD, op1, op2, "83 c0 00"); testOp2(m64, .ADC, op1, op2, "83 d0 00"); testOp2(m64, .AND, op1, op2, "83 e0 00"); testOp2(m64, .OR, op1, op2, "83 c8 00"); testOp2(m64, .SBB, op1, op2, "83 d8 00"); testOp2(m64, .SUB, op1, op2, "83 e8 00"); testOp2(m64, .XOR, op1, op2, "83 f0 00"); testOp2(m64, .CMP, op1, op2, "83 f8 00"); } { const op1 = Operand.register(.AX); const op2 = Operand.immediate8(0x00); testOp2(m64, .ADD, op1, op2, "66 83 c0 00"); testOp2(m64, .ADC, op1, op2, "66 83 d0 00"); testOp2(m64, .AND, op1, op2, "66 83 e0 00"); testOp2(m64, .OR, op1, op2, "66 83 c8 00"); testOp2(m64, .SBB, op1, op2, "66 83 d8 00"); testOp2(m64, .SUB, op1, op2, "66 83 e8 00"); testOp2(m64, .XOR, op1, op2, "66 83 f0 00"); testOp2(m64, .CMP, op1, op2, "66 83 f8 00"); } { const op1 = Operand.registerRm(.R8B); const op2 = Operand.immediate8(0x00); testOp2(m64, .ADD, op1, op2, "41 80 c0 00"); testOp2(m64, .ADC, op1, op2, "41 80 d0 00"); testOp2(m64, .AND, op1, op2, "41 80 e0 00"); testOp2(m64, .OR, op1, op2, "41 80 c8 00"); testOp2(m64, .SBB, op1, op2, "41 80 d8 00"); testOp2(m64, .SUB, op1, op2, "41 80 e8 00"); testOp2(m64, .XOR, op1, op2, "41 80 f0 00"); testOp2(m64, .CMP, op1, op2, "41 80 f8 00"); testOp2(m64, .TEST,op1, op2, "41 F6 c0 00"); } { const op1 = Operand.registerRm(.R8W); const op2 = Operand.immediate16(0x00); testOp2(m64, .ADD, op1, op2, "66 41 81 c0 00 00"); testOp2(m64, .ADC, op1, op2, "66 41 81 d0 00 00"); testOp2(m64, .AND, op1, op2, "66 41 81 e0 00 00"); testOp2(m64, .OR, op1, op2, "66 41 81 c8 00 00"); testOp2(m64, .SBB, op1, op2, "66 41 81 d8 00 00"); testOp2(m64, .SUB, op1, op2, "66 41 81 e8 00 00"); testOp2(m64, .XOR, op1, op2, "66 41 81 f0 00 00"); testOp2(m64, .CMP, op1, op2, "66 41 81 f8 00 00"); testOp2(m64, .TEST,op1, op2, "66 41 F7 c0 00 00"); } { const op1 = Operand.registerRm(.R8D); const op2 = Operand.immediate32(0x00); testOp2(m64, .ADD, op1, op2, "41 81 c0 00 00 00 00"); testOp2(m64, .ADC, op1, op2, "41 81 d0 00 00 00 00"); testOp2(m64, .AND, op1, op2, "41 81 e0 00 00 00 00"); testOp2(m64, .OR, op1, op2, "41 81 c8 00 00 00 00"); testOp2(m64, .SBB, op1, op2, "41 81 d8 00 00 00 00"); testOp2(m64, .SUB, op1, op2, "41 81 e8 00 00 00 00"); testOp2(m64, .XOR, op1, op2, "41 81 f0 00 00 00 00"); testOp2(m64, .CMP, op1, op2, "41 81 f8 00 00 00 00"); testOp2(m64, .TEST,op1, op2, "41 F7 c0 00 00 00 00"); } { const op1 = Operand.registerRm(.R8); const op2 = Operand.immediate32(0x00); testOp2(m64, .ADD, op1, op2, "49 81 c0 00 00 00 00"); testOp2(m64, .ADC, op1, op2, "49 81 d0 00 00 00 00"); testOp2(m64, .AND, op1, op2, "49 81 e0 00 00 00 00"); testOp2(m64, .OR, op1, op2, "49 81 c8 00 00 00 00"); testOp2(m64, .SBB, op1, op2, "49 81 d8 00 00 00 00"); testOp2(m64, .SUB, op1, op2, "49 81 e8 00 00 00 00"); testOp2(m64, .XOR, op1, op2, "49 81 f0 00 00 00 00"); testOp2(m64, .CMP, op1, op2, "49 81 f8 00 00 00 00"); testOp2(m64, .TEST,op1, op2, "49 F7 c0 00 00 00 00"); } { const op1 = Operand.registerRm(.AL); const op2 = Operand.register(.AL); testOp2(m64, .ADD, op1, op2, "00 c0"); testOp2(m64, .ADC, op1, op2, "10 c0"); testOp2(m64, .AND, op1, op2, "20 c0"); testOp2(m64, .OR, op1, op2, "08 c0"); testOp2(m64, .SBB, op1, op2, "18 c0"); testOp2(m64, .SUB, op1, op2, "28 c0"); testOp2(m64, .XOR, op1, op2, "30 c0"); testOp2(m64, .CMP, op1, op2, "38 c0"); testOp2(m64, .TEST,op1, op2, "84 c0"); } { const op1 = Operand.registerRm(.AX); const op2 = Operand.register(.AX); testOp2(m64, .ADD, op1, op2, "66 01 c0"); testOp2(m64, .ADC, op1, op2, "66 11 c0"); testOp2(m64, .AND, op1, op2, "66 21 c0"); testOp2(m64, .OR, op1, op2, "66 09 c0"); testOp2(m64, .SBB, op1, op2, "66 19 c0"); testOp2(m64, .SUB, op1, op2, "66 29 c0"); testOp2(m64, .XOR, op1, op2, "66 31 c0"); testOp2(m64, .CMP, op1, op2, "66 39 c0"); testOp2(m64, .TEST,op1, op2, "66 85 c0"); } { const op1 = Operand.registerRm(.EAX); const op2 = Operand.register(.EAX); testOp2(m64, .ADD, op1, op2, "01 c0"); testOp2(m64, .ADC, op1, op2, "11 c0"); testOp2(m64, .AND, op1, op2, "21 c0"); testOp2(m64, .OR, op1, op2, "09 c0"); testOp2(m64, .SBB, op1, op2, "19 c0"); testOp2(m64, .SUB, op1, op2, "29 c0"); testOp2(m64, .XOR, op1, op2, "31 c0"); testOp2(m64, .CMP, op1, op2, "39 c0"); testOp2(m64, .TEST,op1, op2, "85 c0"); } { const op1 = Operand.registerRm(.RAX); const op2 = Operand.register(.RAX); testOp2(m64, .ADD, op1, op2, "48 01 c0"); testOp2(m64, .ADC, op1, op2, "48 11 c0"); testOp2(m64, .AND, op1, op2, "48 21 c0"); testOp2(m64, .OR, op1, op2, "48 09 c0"); testOp2(m64, .SBB, op1, op2, "48 19 c0"); testOp2(m64, .SUB, op1, op2, "48 29 c0"); testOp2(m64, .XOR, op1, op2, "48 31 c0"); testOp2(m64, .CMP, op1, op2, "48 39 c0"); testOp2(m64, .TEST,op1, op2, "48 85 c0"); } { const op1 = Operand.register(.AL); const op2 = Operand.registerRm(.AL); testOp2(m64, .ADD, op1, op2, "02 c0"); testOp2(m64, .ADC, op1, op2, "12 c0"); testOp2(m64, .AND, op1, op2, "22 c0"); testOp2(m64, .OR, op1, op2, "0A c0"); testOp2(m64, .SBB, op1, op2, "1A c0"); testOp2(m64, .SUB, op1, op2, "2A c0"); testOp2(m64, .XOR, op1, op2, "32 c0"); testOp2(m64, .CMP, op1, op2, "3A c0"); } { const op1 = Operand.register(.AX); const op2 = Operand.registerRm(.AX); testOp2(m64, .ADD, op1, op2, "66 03 c0"); testOp2(m64, .ADC, op1, op2, "66 13 c0"); testOp2(m64, .AND, op1, op2, "66 23 c0"); testOp2(m64, .OR, op1, op2, "66 0B c0"); testOp2(m64, .SBB, op1, op2, "66 1B c0"); testOp2(m64, .SUB, op1, op2, "66 2B c0"); testOp2(m64, .XOR, op1, op2, "66 33 c0"); testOp2(m64, .CMP, op1, op2, "66 3B c0"); } { const op1 = Operand.register(.EAX); const op2 = Operand.registerRm(.EAX); testOp2(m64, .ADD, op1, op2, "03 c0"); testOp2(m64, .ADC, op1, op2, "13 c0"); testOp2(m64, .AND, op1, op2, "23 c0"); testOp2(m64, .OR, op1, op2, "0B c0"); testOp2(m64, .SBB, op1, op2, "1B c0"); testOp2(m64, .SUB, op1, op2, "2B c0"); testOp2(m64, .XOR, op1, op2, "33 c0"); testOp2(m64, .CMP, op1, op2, "3B c0"); } { const op1 = Operand.register(.RAX); const op2 = Operand.registerRm(.RAX); testOp2(m64, .ADD, op1, op2, "48 03 c0"); testOp2(m64, .ADC, op1, op2, "48 13 c0"); testOp2(m64, .AND, op1, op2, "48 23 c0"); testOp2(m64, .OR, op1, op2, "48 0B c0"); testOp2(m64, .SBB, op1, op2, "48 1B c0"); testOp2(m64, .SUB, op1, op2, "48 2B c0"); testOp2(m64, .XOR, op1, op2, "48 33 c0"); testOp2(m64, .CMP, op1, op2, "48 3B c0"); } } test "idiv / div / mul / imul" { const m32 = Machine.init(.x86_32); const m64 = Machine.init(.x64); debugPrint(false); { { const op1 = Operand.registerRm(.AL); testOp1(m32, .IDIV, op1, "F6 F8"); testOp1(m32, .DIV, op1, "F6 F0"); testOp1(m32, .MUL, op1, "F6 E0"); testOp1(m32, .IMUL, op1, "F6 E8"); testOp1(m64, .IDIV, op1, "F6 F8"); testOp1(m64, .DIV, op1, "F6 F0"); testOp1(m64, .MUL, op1, "F6 E0"); testOp1(m64, .IMUL, op1, "F6 E8"); } { const op1 = Operand.registerRm(.AX); testOp1(m32, .IDIV, op1, "66 F7 F8"); testOp1(m32, .DIV, op1, "66 F7 F0"); testOp1(m32, .MUL, op1, "66 F7 E0"); testOp1(m32, .IMUL, op1, "66 F7 E8"); testOp1(m64, .IDIV, op1, "66 F7 F8"); testOp1(m64, .DIV, op1, "66 F7 F0"); testOp1(m64, .MUL, op1, "66 F7 E0"); testOp1(m64, .IMUL, op1, "66 F7 E8"); } { const op1 = Operand.registerRm(.EAX); testOp1(m32, .IDIV, op1, "F7 F8"); testOp1(m32, .DIV, op1, "F7 F0"); testOp1(m32, .MUL, op1, "F7 E0"); testOp1(m32, .IMUL, op1, "F7 E8"); testOp1(m64, .IDIV, op1, "F7 F8"); testOp1(m64, .DIV, op1, "F7 F0"); testOp1(m64, .MUL, op1, "F7 E0"); testOp1(m64, .IMUL, op1, "F7 E8"); } { const op1 = Operand.registerRm(.RAX); testOp1(m32, .IDIV, op1, AsmError.InvalidOperand); testOp1(m32, .DIV, op1, AsmError.InvalidOperand); testOp1(m32, .MUL, op1, AsmError.InvalidOperand); testOp1(m32, .IMUL, op1, AsmError.InvalidOperand); testOp1(m64, .IDIV, op1, "48 F7 F8"); testOp1(m64, .DIV, op1, "48 F7 F0"); testOp1(m64, .MUL, op1, "48 F7 E0"); testOp1(m64, .IMUL, op1, "48 F7 E8"); } } { { const op1 = Operand.register(.AL); const op2 = Operand.register(.AL); const op3 = Operand.immediate(0x11); testOp3(m32, .IMUL, op1, op2, op3, AsmError.InvalidOperand); testOp3(m64, .IMUL, op1, op2, op3, AsmError.InvalidOperand); } { const op1 = Operand.register(.AX); const op2 = Operand.register(.AX); const op3 = Operand.immediate(0x11); testOp3(m32, .IMUL, op1, op2, op3, "66 6B C0 11"); testOp3(m64, .IMUL, op1, op2, op3, "66 6B C0 11"); } { const op1 = Operand.register(.AX); const op2 = Operand.register(.AX); const op3 = Operand.immediate(0x80); testOp3(m32, .IMUL, op1, op2, op3, "66 69 C0 80 00"); testOp3(m64, .IMUL, op1, op2, op3, "66 69 C0 80 00"); } { const op1 = Operand.register(.AX); const op2 = Operand.register(.AX); const op3 = Operand.immediateSigned(-1); testOp3(m32, .IMUL, op1, op2, op3, "66 6B C0 ff"); testOp3(m64, .IMUL, op1, op2, op3, "66 6B C0 ff"); } { const op1 = Operand.register(.AX); const op2 = Operand.register(.AX); const op3 = Operand.immediateSigned16(-1); testOp3(m32, .IMUL, op1, op2, op3, "66 69 C0 ff ff"); testOp3(m64, .IMUL, op1, op2, op3, "66 69 C0 ff ff"); } { const op1 = Operand.register(.EAX); const op2 = Operand.register(.EAX); const op3 = Operand.immediate(0x11); testOp3(m32, .IMUL, op1, op2, op3, "6B C0 11"); testOp3(m64, .IMUL, op1, op2, op3, "6B C0 11"); } { const op1 = Operand.register(.EAX); const op2 = Operand.register(.EAX); const op3 = Operand.immediate32(0x11); testOp3(m32, .IMUL, op1, op2, op3, "69 C0 11 00 00 00"); testOp3(m64, .IMUL, op1, op2, op3, "69 C0 11 00 00 00"); } { const op1 = Operand.register(.RAX); const op2 = Operand.register(.RAX); const op3 = Operand.immediate(0x11); testOp3(m32, .IMUL, op1, op2, op3, AsmError.InvalidOperand); testOp3(m64, .IMUL, op1, op2, op3, "48 6B C0 11"); } { const op1 = Operand.register(.RAX); const op2 = Operand.register(.RAX); const op3 = Operand.immediate32(0x11); testOp3(m32, .IMUL, op1, op2, op3, AsmError.InvalidOperand); testOp3(m64, .IMUL, op1, op2, op3, "48 69 C0 11 00 00 00"); } { const op1 = Operand.register(.RAX); const op2 = Operand.register(.RAX); const op3 = Operand.immediate64(0x11); testOp3(m32, .IMUL, op1, op2, op3, AsmError.InvalidOperand); testOp3(m64, .IMUL, op1, op2, op3, AsmError.InvalidOperand); } { const op1 = Operand.register(.RAX); const op2 = Operand.register(.RAX); const op3 = Operand.immediate(0x80); testOp3(m32, .IMUL, op1, op2, op3, AsmError.InvalidOperand); testOp3(m64, .IMUL, op1, op2, op3, "48 69 C0 80 00 00 00"); } { const op1 = Operand.register(.RAX); const op2 = Operand.register(.RAX); const op3 = Operand.immediate(0x80000000); testOp3(m32, .IMUL, op1, op2, op3, AsmError.InvalidOperand); testOp3(m64, .IMUL, op1, op2, op3, AsmError.InvalidOperand); } { const op1 = Operand.register(.RAX); const op2 = Operand.register(.RAX); const op3 = Operand.immediateSigned(@bitCast(i32, @as(u32, 0x80000000))); testOp3(m32, .IMUL, op1, op2, op3, AsmError.InvalidOperand); testOp3(m64, .IMUL, op1, op2, op3, "48 69 C0 00 00 00 80"); } } }
src/x86/tests/math_8086.zig
const proto = @import("../proto.zig"); pub const FrameHeader = extern struct { escape_byte: u8 = proto.escape_byte, current_el: u8, pad: [6]u8 = undefined, }; pub const EL3Regs = extern struct { // Exception handling ELR_EL3: u64, SPSR_EL3: u64, FAR_EL3: u64, ESR_EL3: u64, // Paging TTBR0_EL3: u64, TCR_EL3: u64, MAIR_EL3: u64, // System control SCTLR_EL3: u64, // Secure monitor SCR_EL3: u64, }; pub const EL2Regs = extern struct { // Exception handling ELR_EL2: u64, SPSR_EL2: u64, FAR_EL2: u64, ESR_EL2: u64, // Paging TTBR0_EL2: u64, TCR_EL2: u64, MAIR_EL2: u64, // System control SCTLR_EL2: u64, // Hypervisor control HCR_EL2: u64, CPTR_EL2: u64, HSTR_EL2: u64, CPACR_EL1: u64, // Hypervisor timer control CNTHCTL_EL2: u64, CNTVOFF_EL2: u64, // Hypervisor guest paging //VTTBR0_EL2: u64, VTCR_EL2: u64, }; pub const EL1Regs = extern struct { // Exception handling ELR_EL1: u64, SPSR_EL1: u64, FAR_EL1: u64, ESR_EL1: u64, // Paging TTBR0_EL1: u64, TTBR1_EL1: u64, TCR_EL1: u64, MAIR_EL1: u64, // System control SCTLR_EL1: u64, }; pub const GPRs = extern struct { SP: u64, X30: u64, X28: u64, X29: u64, X26: u64, X27: u64, X24: u64, X25: u64, X22: u64, X23: u64, X20: u64, X21: u64, X18: u64, X19: u64, X16: u64, X17: u64, X14: u64, X15: u64, X12: u64, X13: u64, X10: u64, X11: u64, X8: u64, X9: u64, X6: u64, X7: u64, X4: u64, X5: u64, X2: u64, X3: u64, X0: u64, X1: u64, }; pub fn ElFrame(comptime el: comptime_int) type { return switch (el) { 1 => extern struct { header: FrameHeader, el1: EL1Regs, gpr: GPRs, }, 2 => extern struct { header: FrameHeader, el1: EL1Regs, el2: EL2Regs, gpr: GPRs, }, 3 => extern struct { header: FrameHeader, el1: EL1Regs, el2: EL2Regs, el3: EL3Regs, gpr: GPRs, }, else => unreachable, }; }
src/proto/arch/aarch64.zig
const zm = @import("zetamath"); usingnamespace @import("zetarender"); const std = @import("std"); test "shader" { std.debug.print("\n", .{}); var shader = try backend.Shader.init(std.heap.c_allocator, "render/test/shaders/vert.spv"); defer shader.deinit(); } const Vertex = packed struct { const Self = @This(); pos: zm.Vec2f, color: zm.Vec3f, pub fn new(pos: zm.Vec2f, color: zm.Vec3f) Self { return Self{ .pos = pos, .color = color, }; } }; const SimplePipeline = program.pipeline.State(.{ .render_pass = .{ .attachments = &[_]program.renderpass.Attachment{.{ .format = .r8g8b8a8_unorm, .samples = .{ .@"1_bit" = true }, .load_op = .clear, .store_op = .store, .stencil_load_op = .dont_care, .stencil_store_op = .dont_care, .initial_layout = .@"undefined", .final_layout = .present_src_khr, }}, .subpasses = &[_]program.renderpass.SubPass{.{ .bind_point = .graphics, .color_attachments = &[_]program.renderpass.SubPass.Dependency{.{ .index = 0, .layout = .color_attachment_optimal, }}, .resolve_attachments = &[_]program.renderpass.SubPass.Dependency{}, }}, }, .layout = .{ .set_layouts = &[_]program.descriptor.SetLayout{}, }, .shader_stages = &[_]program.pipeline.ShaderStage{ .{ .stage = .{ .vertex_bit = true }, .shader = .{ .path = "render/test/shaders/vert.spv" }, .entrypoint = "main", }, .{ .stage = .{ .fragment_bit = true }, .shader = .{ .path = "render/test/shaders/frag.spv" }, .entrypoint = "main", }, }, .vertex_input_state = .{ .input_rate = .vertex, .bindings = &[_]type{Vertex}, }, .input_assembly_state = .{ .topology = .triangle_list, .primitive_restart = false, }, .rasterizer_state = .{ .cull_mode = .{ .back_bit = true }, .front_face = .clockwise, .polygon_mode = .fill, }, .multisample_state = null, .depth_stencil_state = null, .color_blend_state = .{}, }); test "render" { std.debug.print("\n", .{}); var testWindow = windowing.Window.new("Vulkan Test", .{ .width = 1280, .height = 720 }); try testWindow.init(); defer testWindow.deinit(); var render = Render.new(std.heap.c_allocator, &testWindow); try render.init(); defer render.deinit(); const simple_pipeline = try SimplePipeline.build(&render.backend.context); const simple_program = program.Program{ .steps = &[_]program.Step{ program.Step{ .pipeline_state = &simple_pipeline.state, }, }, }; try simple_program.execute(); while (testWindow.isRunning()) { testWindow.update(); } }
render/test/test.zig
const std = @import("std"); const meta = @import("meta.zig"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; pub fn Node(comptime K: type, comptime V: type, comptime B: u32) type { return struct { const Self = @This(); keys: [2 * B - 1]K, values: [2 * B - 1]V, len: usize, edges: [2 * B]?*Self, // Return Type for Node's search method. pub const SearchResult = struct { found: bool, index: usize, }; pub const KV = struct { key: K, value: V, }; const KVE = struct { key: K, value: V, edge: ?*Self, }; const Entry = struct { key_ptr: *K, value_ptr: *V, }; pub fn createEmpty(allocator: Allocator) !*Self { var out = try allocator.create(Self); out.* = Self{ .keys = [_]K{undefined} ** (2 * B - 1), .values = [_]V{undefined} ** (2 * B - 1), .len = 0, .edges = [_]?*Self{null} ** (2 * B), }; return out; } pub fn createFromKV(allocator: Allocator, key: K, value: V) !*Self { var out = try Self.createEmpty(allocator); out.keys[0] = key; out.values[0] = value; out.len = 1; return out; } /// Searches the node for a key. Returns a struct with two fields: /// 1) .found: bool -> Wether the key was found or not. /// 2) .index: usize -> The index of the found key or, if no key was found, /// the index of the edge where the search path continues. pub fn search(self: Self, key: K) SearchResult { var i: usize = 0; while (i < self.len) : (i += 1) { if (meta.eq(key, self.keys[i])) { return SearchResult{ .found = true, .index = i, }; } else if (meta.lt(key, self.keys[i])) { return .{ .found = false, .index = i, }; } } return .{ .found = false, .index = self.len, }; } /// Insert KVE if node has room. Return null in this case. /// If node is full, take out the median KV and split off the the right part /// into a new node and return this new node together with the median KV. pub fn insertOrSplit( self: *Self, allocator: Allocator, index: usize, key: K, value: V, edge: ?*Self, ) !?KVE { if (self.isFull()) { // Node is full. Split Node. var split_result = try self.split(allocator); if (index < B) { // Insert KVE in original node. self.insert(index, key, value, edge); } else { // Insert KVE in the split off node. split_result.edge.?.insert(index - B, key, value, edge); } return split_result; } else { // No split necessary. self.insert(index, key, value, edge); return null; } } /// Swap value at index. pub fn swapValue(self: *Self, index: usize, value: V) V { const out = self.values[index]; self.values[index] = value; return out; } /// Swap KV at index. pub fn swapKV(self: *Self, index: usize, key: K, value: V) KV { const out = KV{ .key = self.keys[index], .value = self.values[index], }; self.values[index] = value; self.keys[index] = key; return out; } /// Remove and return KVE at index. /// The removed edge is right of the KV. pub fn remove(self: *Self, index: usize) KVE { const out = KVE{ .key = self.keys[index], .value = self.values[index], .edge = self.edges[index + 1], }; std.mem.copy( K, self.keys[index..], self.keys[index + 1 .. self.len], ); std.mem.copy( V, self.values[index..], self.values[index + 1 .. self.len], ); self.keys[self.len - 1] = undefined; self.values[self.len - 1] = undefined; if (!self.isLeaf()) { std.mem.copy( ?*Self, self.edges[index + 1 ..], self.edges[index + 2 .. self.len + 1], ); self.edges[self.len] = null; } self.len -= 1; return out; } /// Remove and return most right KVE. fn removeFromEnd(self: *Self) KVE { return self.remove(self.len - 1); } /// Remove and return most left KV and Edge. /// Contrary to the methods above, this removes the edge left of the KV. fn removeFromBeginning(self: *Self) KVE { const out = KVE{ .key = self.keys[0], .value = self.values[0], .edge = self.edges[0], }; std.mem.copy( K, self.keys[0..], self.keys[1..self.len], ); std.mem.copy( V, self.values[0..], self.values[1..self.len], ); self.keys[self.len - 1] = undefined; self.values[self.len - 1] = undefined; if (!self.isLeaf()) { std.mem.copy( ?*Self, self.edges[0..], self.edges[1 .. self.len + 1], ); self.edges[self.len] = null; } self.len -= 1; return out; } // Shifts the arrays right after index and inserts new KVE. // The new edge is right of the new KV. // Does not check if insertion is at the correct position/node has space. fn insert(self: *Self, index: usize, key: K, value: V, edge: ?*Self) void { std.mem.copyBackwards( K, self.keys[index + 1 .. self.len + 1], self.keys[index..self.len], ); self.keys[index] = key; std.mem.copyBackwards( V, self.values[index + 1 .. self.len + 1], self.values[index..self.len], ); self.values[index] = value; if (!self.isLeaf()) { std.mem.copyBackwards( ?*Self, self.edges[index + 2 .. self.len + 2], self.edges[index + 1 .. self.len + 1], ); self.edges[index + 1] = edge; } self.len += 1; } /// Does not check if insertion is at the correct position/node has space. fn insertAtEnd(self: *Self, key: K, value: V, edge: ?*Self) void { self.keys[self.len] = key; self.values[self.len] = value; self.edges[self.len + 1] = edge; self.len += 1; } /// This is different from the other inserts methods because it inserts the edge /// left of the KV. I.e. it also puts the edge in the first position. /// Does not check if insertion is at the correct position/node has space. fn insertAtBeginning(self: *Self, key: K, value: V, edge: ?*Self) void { std.mem.copyBackwards( K, self.keys[1 .. self.len + 1], self.keys[0..self.len], ); self.keys[0] = key; std.mem.copyBackwards( V, self.values[1 .. self.len + 1], self.values[0..self.len], ); self.values[0] = value; if (!self.isLeaf()) { std.mem.copyBackwards( ?*Self, self.edges[1 .. self.len + 2], self.edges[0 .. self.len + 1], ); self.edges[0] = edge; } self.len += 1; } /// The borrowing methods happen from the perspective of the parent. /// This means, the parent distributes from one edge to another. /// The edge at `index` is underflowed and needs compensation. /// Try to borrow from the edge at one side of `index` and rotate. /// Returns true on success, else false. pub fn borrowFromRight(self: *Self, index: usize) bool { // No edge right of index. if (index == self.len) return false; var giver = self.edges[index + 1].?; if (giver.len > B - 1) { // Right edge can spare one. var taker = self.edges[index].?; const from_giver: KVE = giver.removeFromBeginning(); taker.insertAtEnd(self.keys[index], self.values[index], from_giver.edge); _ = self.swapKV(index, from_giver.key, from_giver.value); return true; } else return false; } /// The borrowing methods happen from the perspective of the parent. /// This means, the parent distributes from one edge to another. /// The edge at `index` is underflowed and needs compensation. /// Try to borrow from the edge at one side of `index` and rotate. /// Returns true on success, else false. pub fn borrowFromLeft(self: *Self, index: usize) bool { // No edge left of index. if (index == 0) return false; var giver = self.edges[index - 1].?; if (giver.len > B - 1) { // Right edge can spare one. var taker = self.edges[index].?; const from_giver: KVE = giver.removeFromEnd(); taker.insertAtBeginning(self.keys[index - 1], self.values[index - 1], from_giver.edge); _ = self.swapKV(index - 1, from_giver.key, from_giver.value); return true; } else return false; } /// Merging happend from the perspective of the parent. /// It merges two edges together and puts the middle KV of the parent in between. /// The right node is merged into the left and the right is destroyed afterwards. pub fn mergeEdges(self: *Self, allocator: Allocator, left_edge_index: usize) void { var left = self.edges[left_edge_index].?; const removed = self.remove(left_edge_index); left.insertAtEnd(removed.key, removed.value, null); std.mem.copyBackwards( K, left.keys[left.len..], removed.edge.?.keys[0..removed.edge.?.len], ); std.mem.copyBackwards( V, left.values[left.len..], removed.edge.?.values[0..removed.edge.?.len], ); std.mem.copyBackwards( ?*Self, left.edges[left.len..], removed.edge.?.edges[0 .. removed.edge.?.len + 1], ); left.len += removed.edge.?.len; allocator.destroy(removed.edge.?); } /// Split operation for a full node. /// Returns a struct with three fields: /// 1) and 2) -> Key and value of the median. /// 3) -> The right part of the median as a new node (pointer). /// These parts are erased from the original node. fn split(self: *Self, allocator: Allocator) !KVE { const median: usize = B - 1; var new_key = self.keys[median]; var new_value = self.values[median]; var new_node = try Self.createFromSlices( allocator, self.keys[median + 1 .. self.len], self.values[median + 1 .. self.len], self.edges[median + 1 .. self.len + 1], ); // shrink original node std.mem.set(K, self.keys[median..], undefined); std.mem.set(V, self.values[median..], undefined); std.mem.set(?*Self, self.edges[median + 1 ..], null); self.len = median; return KVE{ .key = new_key, .value = new_value, .edge = new_node, }; } fn createFromSlices(allocator: Allocator, keys: []K, values: []V, edges: []?*Self) !*Self { var out = try Self.createEmpty(allocator); std.mem.copyBackwards(K, out.keys[0..], keys); std.mem.copyBackwards(V, out.values[0..], values); std.mem.copyBackwards(?*Self, out.edges[0..], edges); out.len = keys.len; return out; } pub fn isLeaf(self: Self) bool { return self.edges[0] == null; } pub fn isFull(self: Self) bool { return self.len == 2 * B - 1; } pub fn isLacking(self: Self) bool { return self.len < B - 1; } /// This is intended for testing and debugging. fn assertValidityExceptLength(self: *const Self) void { // Keys increasing for (self.keys[0 .. self.len - 1]) |_, i| { assert(meta.lt(self.keys[i], self.keys[i + 1])); } // Number of edges var count: u32 = 0; var encountered_null = false; for (self.edges) |edge| { if (edge) |_| { assert(encountered_null == false); count += 1; } else { encountered_null = true; } } assert(count == self.len + 1 or count == 0); // If node is leaf we are done here. if (self.isLeaf()) return; // Edges left smaller and right larger for (self.keys[0..self.len]) |key, i| { const left_edge = self.edges[i].?; const imm_left_key = left_edge.keys[left_edge.len - 1]; assert(meta.gt(key, imm_left_key)); const right_edge = self.edges[i + 1].?; const imm_right_key = right_edge.keys[0]; assert(meta.lt(key, imm_right_key)); } } pub fn assertValidity(self: *const Self) void { // Length assert(self.len <= 2 * B - 1); assert(self.len >= B - 1); self.assertValidityExceptLength(); } pub fn assertValidityRoot(self: *const Self) void { // Length assert(self.len <= 2 * B - 1); self.assertValidityExceptLength(); } }; }
src/node.zig
const std = @import("std.zig"); const Allocator = std.mem.Allocator; const debug = std.debug; const expect = std.testing.expect; const expectEqual = std.testing.expectEqual; /// Priority queue for storing generic data. Initialize with `init`. pub fn PriorityQueue(comptime T: type) type { return struct { const Self = @This(); items: []T, len: usize, allocator: *Allocator, compareFn: fn (a: T, b: T) bool, /// Initialize and return a priority queue. Provide /// `compareFn` that returns `true` when its first argument /// should get popped before its second argument. For example, /// to make `pop` return the minimum value, provide /// /// `fn lessThan(a: T, b: T) bool { return a < b; }` pub fn init(allocator: *Allocator, compareFn: fn (a: T, b: T) bool) Self { return Self{ .items = [_]T{}, .len = 0, .allocator = allocator, .compareFn = compareFn, }; } /// Free memory used by the queue. pub fn deinit(self: Self) void { self.allocator.free(self.items); } /// Insert a new element, maintaining priority. pub fn add(self: *Self, elem: T) !void { try ensureCapacity(self, self.len + 1); addUnchecked(self, elem); } fn addUnchecked(self: *Self, elem: T) void { self.items[self.len] = elem; var child_index = self.len; while (child_index > 0) { var parent_index = ((child_index - 1) >> 1); const child = self.items[child_index]; const parent = self.items[parent_index]; if (!self.compareFn(child, parent)) break; self.items[parent_index] = child; self.items[child_index] = parent; child_index = parent_index; } self.len += 1; } /// Add each element in `items` to the queue. pub fn addSlice(self: *Self, items: []const T) !void { try self.ensureCapacity(self.len + items.len); for (items) |e| { self.addUnchecked(e); } } /// Look at the highest priority element in the queue. Returns /// `null` if empty. pub fn peek(self: *Self) ?T { return if (self.len > 0) self.items[0] else null; } /// Pop the highest priority element from the queue. Returns /// `null` if empty. pub fn removeOrNull(self: *Self) ?T { return if (self.len > 0) self.remove() else null; } pub fn remove(self: *Self) T { const first = self.items[0]; const last = self.items[self.len - 1]; self.items[0] = last; self.len -= 1; siftDown(self, 0); return first; } /// Return the number of elements remaining in the priority /// queue. pub fn count(self: Self) usize { return self.len; } /// Return the number of elements that can be added to the /// queue before more memory is allocated. pub fn capacity(self: Self) usize { return self.items.len; } fn siftDown(self: *Self, start_index: usize) void { var index = start_index; const half = self.len >> 1; while (true) { var left_index = (index << 1) + 1; var right_index = left_index + 1; var left = if (left_index < self.len) self.items[left_index] else null; var right = if (right_index < self.len) self.items[right_index] else null; var smallest_index = index; var smallest = self.items[index]; if (left) |e| { if (self.compareFn(e, smallest)) { smallest_index = left_index; smallest = e; } } if (right) |e| { if (self.compareFn(e, smallest)) { smallest_index = right_index; smallest = e; } } if (smallest_index == index) return; self.items[smallest_index] = self.items[index]; self.items[index] = smallest; index = smallest_index; if (index >= half) return; } } /// PriorityQueue takes ownership of the passed in slice. The slice must have been /// allocated with `allocator`. /// Deinitialize with `deinit`. pub fn fromOwnedSlice(allocator: *Allocator, compareFn: fn (a: T, b: T) bool, items: []T) Self { var queue = Self{ .items = items, .len = items.len, .allocator = allocator, .compareFn = compareFn, }; const half = (queue.len >> 1) - 1; var i: usize = 0; while (i <= half) : (i += 1) { queue.siftDown(half - i); } return queue; } pub fn ensureCapacity(self: *Self, new_capacity: usize) !void { var better_capacity = self.capacity(); if (better_capacity >= new_capacity) return; while (true) { better_capacity += better_capacity / 2 + 8; if (better_capacity >= new_capacity) break; } self.items = try self.allocator.realloc(self.items, better_capacity); } pub fn resize(self: *Self, new_len: usize) !void { try self.ensureCapacity(new_len); self.len = new_len; } pub fn shrink(self: *Self, new_len: usize) void { // TODO take advantage of the new realloc semantics assert(new_len <= self.len); self.len = new_len; } const Iterator = struct { queue: *PriorityQueue(T), count: usize, fn next(it: *Iterator) ?T { if (it.count > it.queue.len - 1) return null; const out = it.count; it.count += 1; return it.queue.items[out]; } fn reset(it: *Iterator) void { it.count = 0; } }; /// Return an iterator that walks the queue without consuming /// it. Invalidated if the heap is modified. pub fn iterator(self: *Self) Iterator { return Iterator{ .queue = self, .count = 0, }; } fn dump(self: *Self) void { warn("{{ "); warn("items: "); for (self.items) |e, i| { if (i >= self.len) break; warn("{}, ", e); } warn("array: "); for (self.items) |e, i| { warn("{}, ", e); } warn("len: {} ", self.len); warn("capacity: {}", self.capacity()); warn(" }}\n"); } }; } fn lessThan(a: u32, b: u32) bool { return a < b; } fn greaterThan(a: u32, b: u32) bool { return a > b; } const PQ = PriorityQueue(u32); test "std.PriorityQueue: add and remove min heap" { var queue = PQ.init(debug.global_allocator, lessThan); defer queue.deinit(); try queue.add(54); try queue.add(12); try queue.add(7); try queue.add(23); try queue.add(25); try queue.add(13); expectEqual(@as(u32, 7), queue.remove()); expectEqual(@as(u32, 12), queue.remove()); expectEqual(@as(u32, 13), queue.remove()); expectEqual(@as(u32, 23), queue.remove()); expectEqual(@as(u32, 25), queue.remove()); expectEqual(@as(u32, 54), queue.remove()); } test "std.PriorityQueue: add and remove same min heap" { var queue = PQ.init(debug.global_allocator, lessThan); defer queue.deinit(); try queue.add(1); try queue.add(1); try queue.add(2); try queue.add(2); try queue.add(1); try queue.add(1); expectEqual(@as(u32, 1), queue.remove()); expectEqual(@as(u32, 1), queue.remove()); expectEqual(@as(u32, 1), queue.remove()); expectEqual(@as(u32, 1), queue.remove()); expectEqual(@as(u32, 2), queue.remove()); expectEqual(@as(u32, 2), queue.remove()); } test "std.PriorityQueue: removeOrNull on empty" { var queue = PQ.init(debug.global_allocator, lessThan); defer queue.deinit(); expect(queue.removeOrNull() == null); } test "std.PriorityQueue: edge case 3 elements" { var queue = PQ.init(debug.global_allocator, lessThan); defer queue.deinit(); try queue.add(9); try queue.add(3); try queue.add(2); expectEqual(@as(u32, 2), queue.remove()); expectEqual(@as(u32, 3), queue.remove()); expectEqual(@as(u32, 9), queue.remove()); } test "std.PriorityQueue: peek" { var queue = PQ.init(debug.global_allocator, lessThan); defer queue.deinit(); expect(queue.peek() == null); try queue.add(9); try queue.add(3); try queue.add(2); expectEqual(@as(u32, 2), queue.peek().?); expectEqual(@as(u32, 2), queue.peek().?); } test "std.PriorityQueue: sift up with odd indices" { var queue = PQ.init(debug.global_allocator, lessThan); defer queue.deinit(); const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 }; for (items) |e| { try queue.add(e); } const sorted_items = [_]u32{ 1, 2, 5, 6, 7, 7, 11, 12, 13, 14, 15, 15, 16, 21, 22, 24, 24, 25 }; for (sorted_items) |e| { expectEqual(e, queue.remove()); } } test "std.PriorityQueue: addSlice" { var queue = PQ.init(debug.global_allocator, lessThan); defer queue.deinit(); const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 }; try queue.addSlice(items[0..]); const sorted_items = [_]u32{ 1, 2, 5, 6, 7, 7, 11, 12, 13, 14, 15, 15, 16, 21, 22, 24, 24, 25 }; for (sorted_items) |e| { expectEqual(e, queue.remove()); } } test "std.PriorityQueue: fromOwnedSlice" { const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 }; const heap_items = try std.mem.dupe(debug.global_allocator, u32, items[0..]); var queue = PQ.fromOwnedSlice(debug.global_allocator, lessThan, heap_items[0..]); defer queue.deinit(); const sorted_items = [_]u32{ 1, 2, 5, 6, 7, 7, 11, 12, 13, 14, 15, 15, 16, 21, 22, 24, 24, 25 }; for (sorted_items) |e| { expectEqual(e, queue.remove()); } } test "std.PriorityQueue: add and remove max heap" { var queue = PQ.init(debug.global_allocator, greaterThan); defer queue.deinit(); try queue.add(54); try queue.add(12); try queue.add(7); try queue.add(23); try queue.add(25); try queue.add(13); expectEqual(@as(u32, 54), queue.remove()); expectEqual(@as(u32, 25), queue.remove()); expectEqual(@as(u32, 23), queue.remove()); expectEqual(@as(u32, 13), queue.remove()); expectEqual(@as(u32, 12), queue.remove()); expectEqual(@as(u32, 7), queue.remove()); } test "std.PriorityQueue: add and remove same max heap" { var queue = PQ.init(debug.global_allocator, greaterThan); defer queue.deinit(); try queue.add(1); try queue.add(1); try queue.add(2); try queue.add(2); try queue.add(1); try queue.add(1); expectEqual(@as(u32, 2), queue.remove()); expectEqual(@as(u32, 2), queue.remove()); expectEqual(@as(u32, 1), queue.remove()); expectEqual(@as(u32, 1), queue.remove()); expectEqual(@as(u32, 1), queue.remove()); expectEqual(@as(u32, 1), queue.remove()); } test "std.PriorityQueue: iterator" { var queue = PQ.init(debug.global_allocator, lessThan); var map = std.AutoHashMap(u32, void).init(debug.global_allocator); defer { queue.deinit(); map.deinit(); } const items = [_]u32{ 54, 12, 7, 23, 25, 13 }; for (items) |e| { _ = try queue.add(e); _ = try map.put(e, {}); } var it = queue.iterator(); while (it.next()) |e| { _ = map.remove(e); } expectEqual(@as(usize, 0), map.count()); }
lib/std/priority_queue.zig
const std = @import("std"); const mem = std.mem; const io = std.io; const fs = std.fs; const fmt = std.fmt; const testing = std.testing; const Target = std.Target; const CrossTarget = std.zig.CrossTarget; const assert = std.debug.assert; const SparcCpuinfoImpl = struct { model: ?*const Target.Cpu.Model = null, is_64bit: bool = false, const cpu_names = .{ .{ "SuperSparc", &Target.sparc.cpu.supersparc }, .{ "HyperSparc", &Target.sparc.cpu.hypersparc }, .{ "SpitFire", &Target.sparc.cpu.ultrasparc }, .{ "BlackBird", &Target.sparc.cpu.ultrasparc }, .{ "Sabre", &Target.sparc.cpu.ultrasparc }, .{ "Hummingbird", &Target.sparc.cpu.ultrasparc }, .{ "Cheetah", &Target.sparc.cpu.ultrasparc3 }, .{ "Jalapeno", &Target.sparc.cpu.ultrasparc3 }, .{ "Jaguar", &Target.sparc.cpu.ultrasparc3 }, .{ "Panther", &Target.sparc.cpu.ultrasparc3 }, .{ "Serrano", &Target.sparc.cpu.ultrasparc3 }, .{ "UltraSparc T1", &Target.sparc.cpu.niagara }, .{ "UltraSparc T2", &Target.sparc.cpu.niagara2 }, .{ "UltraSparc T3", &Target.sparc.cpu.niagara3 }, .{ "UltraSparc T4", &Target.sparc.cpu.niagara4 }, .{ "UltraSparc T5", &Target.sparc.cpu.niagara4 }, .{ "LEON", &Target.sparc.cpu.leon3 }, }; fn line_hook(self: *SparcCpuinfoImpl, key: []const u8, value: []const u8) !bool { if (mem.eql(u8, key, "cpu")) { inline for (cpu_names) |pair| { if (mem.indexOfPos(u8, value, 0, pair[0]) != null) { self.model = pair[1]; break; } } } else if (mem.eql(u8, key, "type")) { self.is_64bit = mem.eql(u8, value, "sun4u") or mem.eql(u8, value, "sun4v"); } return true; } fn finalize(self: *const SparcCpuinfoImpl, arch: Target.Cpu.Arch) ?Target.Cpu { // At the moment we only support 64bit SPARC systems. assert(self.is_64bit); const model = self.model orelse Target.Cpu.Model.generic(arch); return Target.Cpu{ .arch = arch, .model = model, .features = model.features, }; } }; const SparcCpuinfoParser = CpuinfoParser(SparcCpuinfoImpl); test "cpuinfo: SPARC" { const mock_cpuinfo = \\cpu : UltraSparc T2 (Niagara2) \\fpu : UltraSparc T2 integrated FPU \\pmu : niagara2 \\type : sun4v ; var fbs = io.fixedBufferStream(mock_cpuinfo); const r = SparcCpuinfoParser.parse(.sparcv9, fbs.reader()) catch unreachable; testing.expectEqual(&Target.sparc.cpu.niagara2, r.?.model); testing.expect(Target.sparc.cpu.niagara2.features.eql(r.?.features)); } // The generic implementation of a /proc/cpuinfo parser. // For every line it invokes the line_hook method with the key and value strings // as first and second parameters. Returning false from the hook function stops // the iteration without raising an error. // When all the lines have been analyzed the finalize method is called. fn CpuinfoParser(comptime impl: anytype) type { return struct { fn parse(arch: Target.Cpu.Arch, reader: anytype) anyerror!?Target.Cpu { var line_buf: [1024]u8 = undefined; var obj: impl = .{}; while (true) { const line = (try reader.readUntilDelimiterOrEof(&line_buf, '\n')) orelse break; const colon_pos = mem.indexOfScalar(u8, line, ':') orelse continue; const key = mem.trimRight(u8, line[0..colon_pos], " \t"); const value = mem.trimLeft(u8, line[colon_pos + 1 ..], " \t"); if (!try obj.line_hook(key, value)) break; } return obj.finalize(arch); } }; } pub fn detectNativeCpuAndFeatures() ?Target.Cpu { var f = fs.openFileAbsolute("/proc/cpuinfo", .{ .intended_io_mode = .blocking }) catch |err| switch (err) { else => return null, }; defer f.close(); switch (std.Target.current.cpu.arch) { .sparcv9 => return SparcCpuinfoParser.parse(.sparcv9, f.reader()) catch null, else => {}, } return null; }
lib/std/zig/system/linux.zig
const std = @import("std"); const mem = std.mem; const OtherLowercase = @This(); allocator: *mem.Allocator, array: []bool, lo: u21 = 170, hi: u21 = 43871, pub fn init(allocator: *mem.Allocator) !OtherLowercase { var instance = OtherLowercase{ .allocator = allocator, .array = try allocator.alloc(bool, 43702), }; mem.set(bool, instance.array, false); var index: u21 = 0; instance.array[0] = true; instance.array[16] = true; index = 518; while (index <= 526) : (index += 1) { instance.array[index] = true; } index = 534; while (index <= 535) : (index += 1) { instance.array[index] = true; } index = 566; while (index <= 570) : (index += 1) { instance.array[index] = true; } instance.array[667] = true; instance.array[720] = true; index = 7298; while (index <= 7360) : (index += 1) { instance.array[index] = true; } instance.array[7374] = true; index = 7409; while (index <= 7445) : (index += 1) { instance.array[index] = true; } instance.array[8135] = true; instance.array[8149] = true; index = 8166; while (index <= 8178) : (index += 1) { instance.array[index] = true; } index = 8390; while (index <= 8405) : (index += 1) { instance.array[index] = true; } index = 9254; while (index <= 9279) : (index += 1) { instance.array[index] = true; } index = 11218; while (index <= 11219) : (index += 1) { instance.array[index] = true; } index = 42482; while (index <= 42483) : (index += 1) { instance.array[index] = true; } instance.array[42694] = true; index = 42830; while (index <= 42831) : (index += 1) { instance.array[index] = true; } index = 43698; while (index <= 43701) : (index += 1) { instance.array[index] = true; } // Placeholder: 0. Struct name, 1. Code point kind return instance; } pub fn deinit(self: *OtherLowercase) void { self.allocator.free(self.array); } // isOtherLowercase checks if cp is of the kind Other_Lowercase. pub fn isOtherLowercase(self: OtherLowercase, cp: u21) bool { if (cp < self.lo or cp > self.hi) return false; const index = cp - self.lo; return if (index >= self.array.len) false else self.array[index]; }
src/components/autogen/PropList/OtherLowercase.zig
const std = @import("std"); const mem = std.mem; const SpacingMark = @This(); allocator: *mem.Allocator, array: []bool, lo: u21 = 2307, hi: u21 = 119154, pub fn init(allocator: *mem.Allocator) !SpacingMark { var instance = SpacingMark{ .allocator = allocator, .array = try allocator.alloc(bool, 116848), }; mem.set(bool, instance.array, false); var index: u21 = 0; instance.array[0] = true; instance.array[56] = true; index = 59; while (index <= 61) : (index += 1) { instance.array[index] = true; } index = 70; while (index <= 73) : (index += 1) { instance.array[index] = true; } index = 75; while (index <= 76) : (index += 1) { instance.array[index] = true; } index = 127; while (index <= 128) : (index += 1) { instance.array[index] = true; } index = 187; while (index <= 189) : (index += 1) { instance.array[index] = true; } index = 196; while (index <= 197) : (index += 1) { instance.array[index] = true; } index = 200; while (index <= 201) : (index += 1) { instance.array[index] = true; } instance.array[212] = true; instance.array[256] = true; index = 315; while (index <= 317) : (index += 1) { instance.array[index] = true; } instance.array[384] = true; index = 443; while (index <= 445) : (index += 1) { instance.array[index] = true; } instance.array[454] = true; index = 456; while (index <= 457) : (index += 1) { instance.array[index] = true; } index = 511; while (index <= 512) : (index += 1) { instance.array[index] = true; } instance.array[571] = true; instance.array[573] = true; index = 580; while (index <= 581) : (index += 1) { instance.array[index] = true; } index = 584; while (index <= 585) : (index += 1) { instance.array[index] = true; } instance.array[596] = true; index = 699; while (index <= 700) : (index += 1) { instance.array[index] = true; } index = 702; while (index <= 703) : (index += 1) { instance.array[index] = true; } index = 707; while (index <= 709) : (index += 1) { instance.array[index] = true; } index = 711; while (index <= 713) : (index += 1) { instance.array[index] = true; } instance.array[724] = true; index = 766; while (index <= 768) : (index += 1) { instance.array[index] = true; } index = 830; while (index <= 833) : (index += 1) { instance.array[index] = true; } index = 895; while (index <= 896) : (index += 1) { instance.array[index] = true; } instance.array[955] = true; index = 957; while (index <= 961) : (index += 1) { instance.array[index] = true; } index = 964; while (index <= 965) : (index += 1) { instance.array[index] = true; } index = 967; while (index <= 968) : (index += 1) { instance.array[index] = true; } index = 978; while (index <= 979) : (index += 1) { instance.array[index] = true; } index = 1023; while (index <= 1024) : (index += 1) { instance.array[index] = true; } index = 1083; while (index <= 1085) : (index += 1) { instance.array[index] = true; } index = 1091; while (index <= 1093) : (index += 1) { instance.array[index] = true; } index = 1095; while (index <= 1097) : (index += 1) { instance.array[index] = true; } instance.array[1108] = true; index = 1151; while (index <= 1152) : (index += 1) { instance.array[index] = true; } index = 1228; while (index <= 1230) : (index += 1) { instance.array[index] = true; } index = 1237; while (index <= 1244) : (index += 1) { instance.array[index] = true; } index = 1263; while (index <= 1264) : (index += 1) { instance.array[index] = true; } index = 1595; while (index <= 1596) : (index += 1) { instance.array[index] = true; } instance.array[1660] = true; index = 1832; while (index <= 1833) : (index += 1) { instance.array[index] = true; } instance.array[1838] = true; instance.array[1845] = true; index = 1848; while (index <= 1849) : (index += 1) { instance.array[index] = true; } index = 1875; while (index <= 1876) : (index += 1) { instance.array[index] = true; } index = 1887; while (index <= 1889) : (index += 1) { instance.array[index] = true; } index = 1892; while (index <= 1898) : (index += 1) { instance.array[index] = true; } index = 1920; while (index <= 1921) : (index += 1) { instance.array[index] = true; } index = 1924; while (index <= 1929) : (index += 1) { instance.array[index] = true; } instance.array[1932] = true; index = 1943; while (index <= 1945) : (index += 1) { instance.array[index] = true; } instance.array[3763] = true; index = 3771; while (index <= 3778) : (index += 1) { instance.array[index] = true; } index = 3780; while (index <= 3781) : (index += 1) { instance.array[index] = true; } index = 4128; while (index <= 4131) : (index += 1) { instance.array[index] = true; } index = 4134; while (index <= 4136) : (index += 1) { instance.array[index] = true; } index = 4141; while (index <= 4142) : (index += 1) { instance.array[index] = true; } index = 4144; while (index <= 4149) : (index += 1) { instance.array[index] = true; } index = 4374; while (index <= 4375) : (index += 1) { instance.array[index] = true; } instance.array[4434] = true; instance.array[4436] = true; instance.array[4446] = true; index = 4448; while (index <= 4449) : (index += 1) { instance.array[index] = true; } index = 4458; while (index <= 4463) : (index += 1) { instance.array[index] = true; } instance.array[4609] = true; instance.array[4658] = true; instance.array[4664] = true; index = 4666; while (index <= 4670) : (index += 1) { instance.array[index] = true; } index = 4672; while (index <= 4673) : (index += 1) { instance.array[index] = true; } instance.array[4735] = true; instance.array[4766] = true; index = 4771; while (index <= 4772) : (index += 1) { instance.array[index] = true; } instance.array[4775] = true; instance.array[4836] = true; index = 4839; while (index <= 4841) : (index += 1) { instance.array[index] = true; } instance.array[4843] = true; index = 4847; while (index <= 4848) : (index += 1) { instance.array[index] = true; } index = 4897; while (index <= 4904) : (index += 1) { instance.array[index] = true; } index = 4913; while (index <= 4914) : (index += 1) { instance.array[index] = true; } instance.array[5086] = true; instance.array[5108] = true; index = 10027; while (index <= 10028) : (index += 1) { instance.array[index] = true; } index = 40736; while (index <= 40737) : (index += 1) { instance.array[index] = true; } instance.array[40740] = true; index = 40829; while (index <= 40830) : (index += 1) { instance.array[index] = true; } index = 40881; while (index <= 40896) : (index += 1) { instance.array[index] = true; } index = 41039; while (index <= 41040) : (index += 1) { instance.array[index] = true; } instance.array[41088] = true; index = 41137; while (index <= 41138) : (index += 1) { instance.array[index] = true; } index = 41143; while (index <= 41144) : (index += 1) { instance.array[index] = true; } index = 41147; while (index <= 41149) : (index += 1) { instance.array[index] = true; } index = 41260; while (index <= 41261) : (index += 1) { instance.array[index] = true; } index = 41264; while (index <= 41265) : (index += 1) { instance.array[index] = true; } instance.array[41290] = true; instance.array[41336] = true; instance.array[41338] = true; instance.array[41448] = true; index = 41451; while (index <= 41452) : (index += 1) { instance.array[index] = true; } instance.array[41458] = true; index = 41696; while (index <= 41697) : (index += 1) { instance.array[index] = true; } index = 41699; while (index <= 41700) : (index += 1) { instance.array[index] = true; } index = 41702; while (index <= 41703) : (index += 1) { instance.array[index] = true; } instance.array[41705] = true; instance.array[67325] = true; instance.array[67327] = true; instance.array[67455] = true; index = 67501; while (index <= 67503) : (index += 1) { instance.array[index] = true; } index = 67508; while (index <= 67509) : (index += 1) { instance.array[index] = true; } instance.array[67625] = true; index = 67650; while (index <= 67651) : (index += 1) { instance.array[index] = true; } instance.array[67711] = true; index = 67760; while (index <= 67762) : (index += 1) { instance.array[index] = true; } index = 67772; while (index <= 67773) : (index += 1) { instance.array[index] = true; } instance.array[67787] = true; index = 67881; while (index <= 67883) : (index += 1) { instance.array[index] = true; } index = 67887; while (index <= 67888) : (index += 1) { instance.array[index] = true; } instance.array[67890] = true; index = 68061; while (index <= 68063) : (index += 1) { instance.array[index] = true; } index = 68095; while (index <= 68096) : (index += 1) { instance.array[index] = true; } index = 68155; while (index <= 68156) : (index += 1) { instance.array[index] = true; } index = 68158; while (index <= 68161) : (index += 1) { instance.array[index] = true; } index = 68164; while (index <= 68165) : (index += 1) { instance.array[index] = true; } index = 68168; while (index <= 68170) : (index += 1) { instance.array[index] = true; } instance.array[68180] = true; index = 68191; while (index <= 68192) : (index += 1) { instance.array[index] = true; } index = 68402; while (index <= 68404) : (index += 1) { instance.array[index] = true; } index = 68413; while (index <= 68414) : (index += 1) { instance.array[index] = true; } instance.array[68418] = true; index = 68525; while (index <= 68527) : (index += 1) { instance.array[index] = true; } instance.array[68534] = true; index = 68536; while (index <= 68539) : (index += 1) { instance.array[index] = true; } instance.array[68542] = true; index = 68780; while (index <= 68782) : (index += 1) { instance.array[index] = true; } index = 68789; while (index <= 68792) : (index += 1) { instance.array[index] = true; } instance.array[68795] = true; index = 68909; while (index <= 68911) : (index += 1) { instance.array[index] = true; } index = 68920; while (index <= 68921) : (index += 1) { instance.array[index] = true; } instance.array[68923] = true; instance.array[69033] = true; index = 69035; while (index <= 69036) : (index += 1) { instance.array[index] = true; } instance.array[69043] = true; index = 69149; while (index <= 69150) : (index += 1) { instance.array[index] = true; } instance.array[69155] = true; index = 69417; while (index <= 69419) : (index += 1) { instance.array[index] = true; } instance.array[69429] = true; index = 69677; while (index <= 69682) : (index += 1) { instance.array[index] = true; } index = 69684; while (index <= 69685) : (index += 1) { instance.array[index] = true; } instance.array[69690] = true; instance.array[69693] = true; instance.array[69695] = true; index = 69838; while (index <= 69840) : (index += 1) { instance.array[index] = true; } index = 69849; while (index <= 69852) : (index += 1) { instance.array[index] = true; } instance.array[69857] = true; instance.array[69942] = true; index = 69972; while (index <= 69973) : (index += 1) { instance.array[index] = true; } instance.array[70036] = true; instance.array[70444] = true; instance.array[70459] = true; instance.array[70566] = true; instance.array[70574] = true; instance.array[70577] = true; index = 70791; while (index <= 70795) : (index += 1) { instance.array[index] = true; } index = 70800; while (index <= 70801) : (index += 1) { instance.array[index] = true; } instance.array[70803] = true; index = 71154; while (index <= 71155) : (index += 1) { instance.array[index] = true; } index = 91726; while (index <= 91780) : (index += 1) { instance.array[index] = true; } index = 91885; while (index <= 91886) : (index += 1) { instance.array[index] = true; } index = 116834; while (index <= 116835) : (index += 1) { instance.array[index] = true; } index = 116842; while (index <= 116847) : (index += 1) { instance.array[index] = true; } // Placeholder: 0. Struct name, 1. Code point kind return instance; } pub fn deinit(self: *SpacingMark) void { self.allocator.free(self.array); } // isSpacingMark checks if cp is of the kind Spacing_Mark. pub fn isSpacingMark(self: SpacingMark, cp: u21) bool { if (cp < self.lo or cp > self.hi) return false; const index = cp - self.lo; return if (index >= self.array.len) false else self.array[index]; }
src/components/autogen/DerivedGeneralCategory/SpacingMark.zig
const std = @import("std"); const u = @import("index.zig"); const yaml = @import("./yaml.zig"); // // const b = 1; const kb = b * 1024; const mb = kb * 1024; pub const ModFile = struct { const Self = @This(); alloc: *std.mem.Allocator, id: []const u8, name: []const u8, main: []const u8, c_include_dirs: [][]const u8, c_source_flags: [][]const u8, c_source_files: [][]const u8, deps: []u.Dep, yaml: yaml.Mapping, pub fn init(alloc: *std.mem.Allocator, fpath: []const u8) !Self { // const mpath = try std.fs.realpathAlloc(alloc, fpath); const file = try std.fs.openFileAbsolute(mpath, .{}); defer file.close(); const input = try file.reader().readAllAlloc(alloc, mb); const doc = try yaml.parse(alloc, input); return from_mapping(alloc, doc.mapping); } pub fn from_mapping(alloc: *std.mem.Allocator, mapping: yaml.Mapping) anyerror!Self { const id = mapping.get_string("id"); const name = mapping.get("name").?.string; const main = mapping.get_string("main"); const dep_list = &std.ArrayList(u.Dep).init(alloc); if (mapping.get("dependencies")) |dep_seq| { if (dep_seq == .sequence) { for (dep_seq.sequence) |item| { var dtype: []const u8 = undefined; var path: []const u8 = undefined; var version: ?[]const u8 = null; if (item.mapping.get("src")) |val| { var src_iter = std.mem.tokenize(val.string, " "); dtype = src_iter.next().?; path = src_iter.next().?; if (src_iter.next()) |dver| { version = dver; } } else { dtype = item.mapping.get("type").?.string; path = item.mapping.get("path").?.string; } if (item.mapping.get("version")) |verv| { version = verv.string; } if (version == null) { version = ""; } const dep_type = std.meta.stringToEnum(u.DepType, dtype).?; try dep_list.append(u.Dep{ .type = dep_type, .path = path, .id = item.mapping.get_string("id"), .name = item.mapping.get_string("name"), .main = item.mapping.get_string("main"), .version = version.?, .c_include_dirs = try item.mapping.get_string_array(alloc, "c_include_dirs"), .c_source_flags = try item.mapping.get_string_array(alloc, "c_source_flags"), .c_source_files = try item.mapping.get_string_array(alloc, "c_source_files"), .only_os = try u.list_remove(try u.split(item.mapping.get_string("only_os"), ","), ""), .except_os = try u.list_remove(try u.split(item.mapping.get_string("except_os"), ","), ""), .yaml = item.mapping, }); } } } return Self{ .alloc = alloc, .id = if (id.len == 0) try u.random_string(48) else id, .name = name, .main = main, .c_include_dirs = try mapping.get_string_array(alloc, "c_include_dirs"), .c_source_flags = try mapping.get_string_array(alloc, "c_source_flags"), .c_source_files = try mapping.get_string_array(alloc, "c_source_files"), .deps = dep_list.items, .yaml = mapping, }; } };
src/util/modfile.zig
const std = @import("std"); const utils = @import("utils.zig"); const Field = utils.Field; const Instruction = struct { instr: union(enum) { // Logical ALU mov: AluInstr, mvn: AluInstr, orr: AluInstr, eor: AluInstr, and_: AluInstr, bic: AluInstr, tst: AluInstr, teq: AluInstr, // Arithmetic ALU add: AluInstr, adc: AluInstr, sub: AluInstr, sbc: AluInstr, rsb: AluInstr, rsc: AluInstr, cmp: AluInstr, cmn: AluInstr, // Multiply mul: MulInstr, mla: MulInstr, umull: MulInstr, umlal: MulInstr, smull: MulInstr, smlal: MulInstr, // Load/Store ldr: SDTransferInstr, ldm: BDTransferInstr, str: SDTransferInstr, stm: BDTransferInstr, swp: SDSwapInstr, // Jump b: BranchInstr, bl: BranchInstr, bx: BranchExInstr, mrs: PSRTransferInstr, msr: PSRTransferInstr, swi, undef, nop, }, cond: Cond, }; pub const Register = u4; const Cond = enum(u4) { eq = 0x0, ne = 0x1, cs = 0x2, cc = 0x3, mi = 0x4, pl = 0x5, vs = 0x6, vc = 0x7, hi = 0x8, ls = 0x9, ge = 0xA, lt = 0xB, gt = 0xC, le = 0xD, al = 0xE, nev = 0xF, }; const Op2 = union(enum) { reg: struct { shift_by: union(enum) { imm: u4, reg: Register, }, shift_type: enum(u2) { lsl = 0x0, lsr = 0x1, asr = 0x2, ror = 0x3, }, reg: u4, }, imm: struct { rot: u4, imm: u8, }, }; fn parseOp2(op: u32) Op2 { const imm = (op & 0x02000000) >> 25 == 1; if (imm) { return .{ .imm = .{ .rot = @truncate(u4, (op & 0x00000F00) >> 8), .imm = @truncate(u8, op & 0x000000FF), } }; } else { return .{ .reg = .{ .shift_by = blk: { if (op & 0x00000010 == 1) { break :blk .{ .imm = @truncate(u4, (op & 0x00000F80) >> 7) }; } else { std.debug.assert(op & 0x00000F00 == 0); break :blk .{ .reg = @truncate(u4, (op & 0x00000F00) >> 8) }; } }, // TODO: ew .shift_type = @intToEnum(Field(Field(Op2, .reg), .shift_type), (op & 0x00000060) >> 5), .reg = @truncate(u4, op & 0x0000000F), }, }; } } pub fn parseOpcode(op: u32) Instruction { return .{ .instr = switch (((op & 0x0FF00000) >> 16) | ((op & 0xF0) >> 4)) { // Logical ALU // zig fmt: off 0x1A0...0x1A8, 0x1AA, 0x1AC, 0x1AE, 0x1B0...0x1B8, 0x1BA, 0x1BC, 0x1BE, 0x3A0...0x3BF, => .{ .mov = parseAlu(op, .mov) }, 0x1E0...0x1E8, 0x1EA, 0x1EC, 0x1EE, 0x1F0...0x1F8, 0x1FA, 0x1FC, 0x1FE, 0x3E0...0x3FF, => .{ .mvn = parseAlu(op, .mvn) }, 0x180...0x188, 0x18A, 0x18C, 0x18E, 0x190...0x198, 0x19A, 0x19C, 0x19E, 0x380...0x39F, => .{ .orr = parseAlu(op, .orr) }, 0x020...0x028, 0x02A, 0x02C, 0x02E, 0x030...0x038, 0x03A, 0x03C, 0x03E, 0x220...0x23F, => .{ .eor = parseAlu(op, .eor) }, 0x000...0x008, 0x00A, 0x00C, 0x00E, 0x010...0x018, 0x01A, 0x01C, 0x01E, 0x200...0x21F, => .{ .and_ = parseAlu(op, .and_) }, 0x1C0...0x1C8, 0x1CA, 0x1CC, 0x1CE, 0x1D0...0x1D8, 0x1DA, 0x1DC, 0x1DE, 0x3C0...0x3DF, => .{ .bic = parseAlu(op, .bic) }, 0x110...0x118, 0x11A, 0x11C, 0x11E, 0x310...0x31F, => .{ .tst = parseAlu(op, .tst) }, 0x130...0x138, 0x13A, 0x13C, 0x13E, 0x330...0x33F, => .{ .teq = parseAlu(op, .teq) }, // zig fmt: on // Arithmetic ALU // zig fmt: off 0x080...0x088, 0x08A, 0x08C, 0x08E, 0x090...0x098, 0x09A, 0x09C, 0x09E, 0x280...0x29F, => .{ .add = parseAlu(op, .add) }, 0x0A0...0x0A8, 0x0AA, 0x0AC, 0x0AE, 0x0B0...0x0B8, 0x0BA, 0x0BC, 0x0BE, 0x2A0...0x2BF, => .{ .adc = parseAlu(op, .adc) }, 0x040...0x048, 0x04A, 0x04C, 0x04E, 0x050...0x058, 0x05A, 0x05C, 0x05E, 0x240...0x25F, => .{ .sub = parseAlu(op, .sub) }, 0x0C0...0x0C8, 0x0CA, 0x0CC, 0x0CE, 0x0D0...0x0D8, 0x0DA, 0x0DC, 0x0DE, 0x2C0...0x2DF, => .{ .sbc = parseAlu(op, .sbc) }, 0x060...0x068, 0x06A, 0x06C, 0x06E, 0x070...0x078, 0x07A, 0x07C, 0x07E, 0x260...0x27F, => .{ .rsb = parseAlu(op, .rsb) }, 0x0E0...0x0E8, 0x0EA, 0x0EC, 0x0EE, 0x0F0...0x0F8, 0x0FA, 0x0FC, 0x0FE, 0x2E0...0x2FF, => .{ .rsc = parseAlu(op, .rsc) }, 0x150...0x158, 0x15A, 0x15C, 0x15E, 0x350...0x35F, => .{ .cmp = parseAlu(op, .cmp) }, 0x170...0x178, 0x17A, 0x17C, 0x17E, 0x370...0x37F, => .{ .cmn = parseAlu(op, .cmn) }, // zig fmt: on //Multiply // zig fmt: off 0x009, 0x019, => .{ .mul = parseMul(op, .mul) }, 0x029, 0x039, => .{ .mla = parseMul(op, .mla) }, 0x089, 0x099, => .{ .umull = parseMul(op, .umull) }, 0x0A9, 0x0B9, => .{ .umlal = parseMul(op, .umlal) }, 0x0C9, 0x0D9, => .{ .smull = parseMul(op, .smull) }, 0x0E9, 0x0F9, => .{ .smlal = parseMul(op, .smlal) }, // zig fmt: on // Load/Store // zig fmt: off 0x00D, 0x02D, 0x04D, 0x06D, 0x08D, 0x10D, 0x12D, 0x14D, 0x16D, 0x18D, 0x01B, 0x01D, 0x01F, 0x03B, 0x03D, 0x03F, 0x05B, 0x05D, 0x05F, 0x07B, 0x07D, 0x07F, 0x09B, 0x09D, 0x09F, 0x11B, 0x11D, 0x11F, 0x13B, 0x13D, 0x13F, 0x15B, 0x15D, 0x15F, 0x17B, 0x17D, 0x17F, 0x19B, 0x19D, 0x19F, 0x410...0x41F, 0x430...0x43F, 0x450...0x45F, 0x470...0x47F, 0x490...0x49F, 0x510...0x51F, 0x530...0x53F, 0x550...0x55F, 0x570...0x57F, 0x590...0x59F, 0x610, 0x612, 0x614, 0x616, 0x618, 0x61A, 0x61C, 0x61E, 0x630, 0x632, 0x634, 0x636, 0x638, 0x63A, 0x63C, 0x63E, 0x650, 0x652, 0x654, 0x656, 0x658, 0x65A, 0x65C, 0x65E, 0x670, 0x672, 0x674, 0x676, 0x678, 0x67A, 0x67C, 0x67E, 0x690, 0x692, 0x694, 0x696, 0x698, 0x69A, 0x69C, 0x69E, 0x710, 0x712, 0x714, 0x716, 0x718, 0x71A, 0x71C, 0x71E, 0x730, 0x732, 0x734, 0x736, 0x738, 0x73A, 0x73C, 0x73E, 0x750, 0x752, 0x754, 0x756, 0x758, 0x75A, 0x75C, 0x75E, 0x770, 0x772, 0x774, 0x776, 0x778, 0x77A, 0x77C, 0x77E, 0x790, 0x792, 0x794, 0x796, 0x798, 0x79A, 0x79C, 0x79E, 0x7B0, 0x7B2, 0x7B4, 0x7B6, 0x7B8, 0x7BA, 0x7BC, 0x7BE, 0x7D0, 0x7D2, 0x7D4, 0x7D6, 0x7D8, 0x7DA, 0x7DC, 0x7DE, 0x7F0, 0x7F2, 0x7F4, 0x7F6, 0x7F8, 0x7FA, 0x7FC, 0x7FE, => .{ .ldr = parseSDTransfer(op, .ldr) }, 0x810...0x81F, 0x830...0x83F, 0x850...0x85F, 0x870...0x87F, 0x890...0x89F, 0x8B0...0x8BF, 0x8D0...0x8DF, 0x8F0...0x8FF, 0x910...0x91F, 0x930...0x93F, 0x950...0x95F, 0x970...0x97F, 0x990...0x99F, 0x9B0...0x9BF, 0x9D0...0x9DF, 0x9F0...0x9FF, => .{ .ldm = parseBDTransfer(op, .ldm) }, 0x00B, 0x00F, 0x02B, 0x02F, 0x04B, 0x04F, 0x06B, 0x06F, 0x08B, 0x08F, 0x0AB, 0x0AF, 0x0CB, 0x0CF, 0x0EB, 0x0EF, 0x10B, 0x10F, 0x12B, 0x12F, 0x14B, 0x14F, 0x16B, 0x16F, 0x18B, 0x18F, 0x1AB, 0x1AF, 0x1CB, 0x1CF, 0x1EB, 0x1EF, 0x400...0x40F, 0x420...0x42F, 0x440...0x44F, 0x460...0x46F, 0x480...0x48F, 0x4A0...0x4AF, 0x4C0...0x4CF, 0x4E0...0x4EF, 0x500...0x50F, 0x520...0x52F, 0x540...0x54F, 0x560...0x56F, 0x580...0x58F, 0x5A0...0x5AF, 0x5C0...0x5CF, 0x5E0...0x5EF, 0x600, 0x602, 0x604, 0x606, 0x608, 0x60A, 0x60C, 0x60E, 0x620, 0x622, 0x624, 0x626, 0x628, 0x62A, 0x62C, 0x62E, 0x640, 0x642, 0x644, 0x646, 0x648, 0x64A, 0x64C, 0x64E, 0x660, 0x662, 0x664, 0x666, 0x668, 0x66A, 0x66C, 0x66E, 0x680, 0x682, 0x684, 0x686, 0x688, 0x68A, 0x68C, 0x68E, 0x6A0, 0x6A2, 0x6A4, 0x6A6, 0x6A8, 0x6AA, 0x6AC, 0x6AE, 0x6C0, 0x6C2, 0x6C4, 0x6C6, 0x6C8, 0x6CA, 0x6CC, 0x6CE, 0x6E0, 0x6E2, 0x6E4, 0x6E6, 0x6E8, 0x6EA, 0x6EC, 0x6EE, 0x700, 0x702, 0x704, 0x706, 0x708, 0x70A, 0x70C, 0x70E, 0x720, 0x722, 0x724, 0x726, 0x728, 0x72A, 0x72C, 0x72E, 0x740, 0x742, 0x744, 0x746, 0x748, 0x74A, 0x74C, 0x74E, 0x760, 0x762, 0x764, 0x766, 0x768, 0x76A, 0x76C, 0x76E, 0x780, 0x782, 0x784, 0x786, 0x788, 0x78A, 0x78C, 0x78E, 0x7A0, 0x7A2, 0x7A4, 0x7A6, 0x7A8, 0x7AA, 0x7AC, 0x7AE, 0x7C0, 0x7C2, 0x7C4, 0x7C6, 0x7C8, 0x7CA, 0x7CC, 0x7CE, 0x7E0, 0x7E2, 0x7E4, 0x7E6, 0x7E8, 0x7EA, 0x7EC, 0x7EE, => .{ .str = parseSDTransfer(op, .str) }, 0x800...0x80F, 0x820...0x82F, 0x840...0x84F, 0x860...0x86F, 0x880...0x88F, 0x8A0...0x8AF, 0x8C0...0x8CF, 0x8E0...0x8EF, 0x900...0x90F, 0x920...0x92F, 0x940...0x94F, 0x960...0x96F, 0x980...0x98F, 0x9A0...0x9AF, 0x9C0...0x9CF, 0x9E0...0x9EF, => .{ .stm = parseBDTransfer(op, .stm) }, 0x109, 0x149, => .{ .swp = parseSDSwap(op, .swp) }, // zig fmt: on // Load/Store // zig fmt: off 0xA00...0xAFF, => .{.b = parseBranch(op, .b)}, 0xB00...0xBFF, => .{.bl = parseBranch(op, .bl)}, 0x121, => .{.bx = parseBranchEx(op, .bx)}, 0x100, 0x140, => .{.mrs = parsePSRTransfer(op, .mrs)}, 0x120, 0x160, 0x320...0x32F, 0x360...0x36F, => .{.msr = parsePSRTransfer(op, .msr)}, 0xF00...0xFFF => .{.swi = undefined}, // zig fmt: on else => .{ .undef = undefined }, }, .cond = @intToEnum(Cond, (op & 0xF0000000) >> 28), }; } pub const AluOpcode = enum(u8) { and_ = 0x0, eor = 0x1, sub = 0x2, rsb = 0x3, add = 0x4, adc = 0x5, sbc = 0x6, rsc = 0x7, tst = 0x8, teq = 0x9, cmp = 0xA, cmn = 0xB, orr = 0xC, mov = 0xD, bic = 0xE, mvn = 0xF, pub fn isLogical(self: @This()) bool { return self == .mov or self == .mvn or self == .orr or self == .eor or self == .and_ or self == .bic or self == .tst or self == .teq; } }; pub const AluInstr = struct { s: bool, op: AluOpcode, rd: Register, rn: Register, op2: Op2, }; fn parseAlu(op: u32, assert: AluOpcode) AluInstr { std.debug.assert((op & 0x01E00000) >> 21 == @enumToInt(assert)); std.debug.assert((op & 0x0C000000) >> 26 == 0x0); std.debug.assert((op & 0x00000040) >> 7 == 0x0); const s = ((op & 0x00200000) >> 20) == 1; const rn = @truncate(u4, (op & 0x000F0000) >> 16); const rd = @truncate(u4, (op & 0x0000F000) >> 12); const op2 = parseOp2(op); if (assert == .mov or assert == .mvn) std.debug.assert(rn == 0x0) else if (assert == .cmp or assert == .cmn or assert == .tst or assert == .teq) std.debug.assert(rd == 0x0); return .{ .s = s, .op = assert, .rd = rd, .rn = rn, .op2 = op2, }; } pub const MulOpcode = enum(u8) { mul = 0x0, mla = 0x1, umull = 0x4, umlal = 0x5, smull = 0x6, smlal = 0x7, }; pub const MulInstr = struct { s: bool, op: MulOpcode, rd: Register, // RdHi rn: Register, // RdLo rs: Register, rm: Register, }; fn parseMul(op: u32, assert: MulOpcode) MulInstr { std.debug.assert((op & 0x01E00000) >> 21 == @enumToInt(assert)); std.debug.assert((op & 0x0E000000) >> 25 == 0b000); std.debug.assert((op & 0x000000F0) >> 4 == 0b1001); const s = ((op & 0x00200000) >> 20) == 1; const rd = @truncate(u4, (op & 0x000F0000) >> 16); const rn = @truncate(u4, (op & 0x0000F000) >> 16); const rs = @truncate(u4, (op & 0x00000F00) >> 16); const rm = @truncate(u4, (op & 0x0000000F) >> 16); return .{ .s = s, .op = assert, .rd = rd, .rn = rn, .rs = rs, .rm = rm, }; } const SDTransferOpcode = enum(u2) { str = 0x0, ldr = 0x1, }; pub const SDTransferInstr = struct { when: enum(u1) { post = 0, pre = 1 }, base_op: enum(u1) { sub = 0, add = 1 }, size: enum(u1) { word = 0, byte = 1 }, op: SDTransferOpcode, rn: Register, rd: Register, offset: union(enum) { imm: u12, reg: struct { shift_amt: u5, shift_type: enum(u2) { lsl = 0x0, lsr = 0x1, asr = 0x2, ror = 0x3, }, rm: Register, }, }, }; fn parseSDTransfer(op: u32, assert: SDTransferOpcode) SDTransferInstr { std.debug.assert((op & 0x04000000) >> 26 == 0b01); std.debug.assert((op & 0x00100000) >> 20 == @enumToInt(assert)); const when = @intToEnum(Field(SDTransferInstr, .when), (op & 0x01000000) >> 24); const base_op = @intToEnum(Field(SDTransferInstr, .base_op), (op & 0x00800000) >> 23); const size = @intToEnum(Field(SDTransferInstr, .size), (op & 0x00400000) >> 22); const rn = @truncate(u4, (op & 0x000F0000) >> 16); const rd = @truncate(u4, (op & 0x0000F000) >> 16); const offset = blk: { if ((op & 0x02000000) >> 20 == 0b0) { break :blk Field(SDTransferInstr, .offset){ .imm = (@truncate(u12, op & 0x00000FFF)) }; } else { std.debug.assert((op & 0x00000008) >> 4 == 0b0); break :blk Field(SDTransferInstr, .offset){ .reg = .{ .shift_amt = @truncate(u5, (op & 0x00000F80) >> 7), .shift_type = @intToEnum(Field(Field(Field(SDTransferInstr, .offset), .reg), .shift_type), (op & 0x00000F80) >> 7), .rm = @truncate(u4, op & 0x0000000F), } }; } }; return .{ .when = when, .base_op = base_op, .size = size, .op = assert, .rn = rn, .rd = rd, .offset = offset, }; } const BDTransferOpcode = enum(u2) { stm = 0x0, ldm = 0x1, }; pub const BDTransferInstr = struct { when: enum(u1) { post = 0, pre = 1 }, base_op: enum(u1) { sub = 0, add = 1 }, force_user: enum(u1) { no = 0, force_user = 1 }, write_back: enum(u1) { no = 0, write = 1 }, op: BDTransferOpcode, rn: Register, reg_list: [4]Register, }; fn parseBDTransfer(op: u32, assert: BDTransferOpcode) BDTransferInstr { std.debug.assert((op & 0x0E000000) >> 25 == 0b100); std.debug.assert((op & 0x00100000) >> 20 == @enumToInt(assert)); const when = @intToEnum(Field(BDTransferInstr, .when), (op & 0x01000000) >> 24); const base_op = @intToEnum(Field(BDTransferInstr, .base_op), (op & 0x00800000) >> 23); const force_user = @intToEnum(Field(BDTransferInstr, .force_user), (op & 0x00400000) >> 22); const write_back = @intToEnum(Field(BDTransferInstr, .write_back), (op & 0x00200000) >> 21); const rn = @truncate(u4, (op & 0x000F0000) >> 16); const reg_list = [4]Register{ @truncate(u4, op & 0x0000F000 >> 12), @truncate(u4, op & 0x00000F00 >> 8), @truncate(u4, op & 0x000000F0 >> 4), @truncate(u4, op & 0x0000000F), }; return .{ .when = when, .base_op = base_op, .force_user = force_user, .write_back = write_back, .op = assert, .rn = rn, .reg_list = reg_list, }; } const SDSwapOpcode = enum(u5) { swp = 0b00010 }; pub const SDSwapInstr = struct { size: enum(u1) { word = 0, byte = 1 }, op: SDSwapOpcode, rn: Register, rd: Register, rm: Register, }; fn parseSDSwap(op: u32, assert: SDSwapOpcode) SDSwapInstr { std.debug.assert((op & 0x0F800000) >> 23 == @enumToInt(assert)); std.debug.assert((op & 0x00300000) >> 20 == 0b00); std.debug.assert((op & 0x00000FF0) >> 4 == 0b00001001); const size = @intToEnum(Field(SDSwapInstr, .size), (op & 0x00400000) >> 22); const rn = @truncate(u4, (op & 0x0000F000) >> 16); const rd = @truncate(u4, (op & 0x00000F00) >> 12); const rm = @truncate(u4, op & 0x0000000F); return .{ .size = size, .op = assert, .rn = rn, .rd = rd, .rm = rm, }; } const BranchOpcode = enum(u1) { b = 0b0, bl = 0b1 }; pub const BranchInstr = struct { op: BranchOpcode, offset: u24, }; fn parseBranch(op: u32, assert: BranchOpcode) BranchInstr { std.debug.assert((op & 0x0E000000) >> 25 == 0b0101); std.debug.assert((op & 0x01000000) >> 24 == @enumToInt(assert)); return .{ .op = assert, .offset = @truncate(u24, op & 0x00FFFFFF) }; } const BranchExOpcode = enum(u4) { bx = 0b0001 }; const BranchExInstr = struct { op: BranchExOpcode, reg: Register, }; fn parseBranchEx(op: u32, assert: BranchExOpcode) BranchExInstr { std.debug.assert((op & 0x0FFFFF00) >> 8 == 0x12FFF); std.debug.assert((op & 0x000000F0) >> 4 == @enumToInt(assert)); return .{ .op = assert, .reg = @truncate(u4, op & 0x0000000F) }; } const PSRTransferOpcode = enum(u2) { mrs = 0b0, msr = 0b1 }; const PSRTransferInstr = struct { op: PSRTransferOpcode, source: enum(u1) { cpsr = 0b0, spsr = 0b1, }, payload: union(enum) { mrs: struct { rd: Register }, msr: struct { write_f: bool, write_s: bool, write_x: bool, write_c: bool, src: union(enum) { imm: struct { shift_by: u4, imm: u8, }, reg: Register, }, }, }, }; fn parsePSRTransfer(op: u32, assert: PSRTransferOpcode) PSRTransferInstr { std.debug.assert((op & 0x0C000000) >> 26 == 0b00); std.debug.assert((op & 0x01000000) >> 23 == 0b10); std.debug.assert((op & 0x00200000) >> 21 == @enumToInt(assert)); std.debug.assert((op & 0x00100000) >> 20 == 0b0); const source = @intToEnum(Field(PSRTransferInstr, .source), (op & 0x00400000) >> 22); const payload = blk: { switch (assert) { .mrs => { std.debug.assert((op & 0x000F0000) >> 16 == 0xF); std.debug.assert(op & 0x00000FFF == 0x000); const rd = @truncate(u4, (op & 0x0000F000) >> 12); break :blk Field(PSRTransferInstr, .payload){ .mrs = .{ .rd = rd, } }; }, .msr => { std.debug.assert((op & 0x0000F000) >> 12 == 0xF); const write_f = (op & 0x00080000) >> 19 == 1; const write_s = (op & 0x00040000) >> 18 == 1; const write_x = (op & 0x00020000) >> 17 == 1; const write_c = (op & 0x00010000) >> 16 == 1; const src = src: { if ((op & 0x02000000) >> 25 == 0b1) { break :src Field(Field(Field(PSRTransferInstr, .payload), .msr), .src){ .imm = .{ .shift_by = @truncate(u4, (op & 0x00000F00) >> 8), .imm = @truncate(u8, op & 0x000000FF), }, }; } else { std.debug.assert((op & 0x00000FF0) >> 4 == 0x00); break :src Field(Field(Field(PSRTransferInstr, .payload), .msr), .src){ .reg = @truncate(u4, op & 0x0000000F), }; } }; break :blk Field(PSRTransferInstr, .payload){ .msr = .{ .write_f = write_f, .write_s = write_s, .write_x = write_x, .write_c = write_c, .src = src, } }; }, } }; return .{ .op = assert, .source = source, .payload = payload }; } test "static analysis" { std.testing.refAllDecls(@This()); }
src/instr.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const ArrayList = std.ArrayList; const gui = @import("gui"); const icons = @import("icons.zig"); const nvg = @import("nanovg"); const geometry = @import("gui/geometry.zig"); const Point = geometry.Point; const Pointf = Point(f32); const Pointi = Point(i32); const Rect = geometry.Rect; const Rectf = Rect(f32); const Recti = Rect(i32); const EditorWidget = @import("EditorWidget.zig"); const Document = @import("Document.zig"); fn itof(i: i32) f32 { return @intToFloat(f32, i); } fn ftoi(f: f32) i32 { return @floatToInt(i32, f); } fn ritof(rect: Recti) Rectf { return Rectf.make(itof(rect.x), itof(rect.y), itof(rect.w), itof(rect.h)); } pub const ToolType = enum { crop, select, draw, fill, }; const CropTool = struct { mouse_point: ?Pointf = null, // mouse cursor position in gui space edit_point: ?Pointi = null, // current cursor location in document space begin_point: ?Pointi = null, // selection begin in document space crop_rect: ?Recti = null, drag_offset: ?Pointf = null, // mouse cursor relative to dragged object drag_zone: ?u3 = null, const zone_size = 16; fn makeZones(rect: Rectf) [8]Rectf { // in gui space return [_]Rectf{ makeZone(rect, 0), makeZone(rect, 1), makeZone(rect, 2), makeZone(rect, 3), makeZone(rect, 4), makeZone(rect, 5), makeZone(rect, 6), makeZone(rect, 7), }; } fn makeZone(rect: Rectf, i: u3) Rectf { const zs = zone_size; return switch (i) { 0 => Rectf.make(rect.x - zs, rect.y - zs, zs, zs), 1 => Rectf.make(rect.x, rect.y - zs, rect.w, zs), 2 => Rectf.make(rect.x + rect.w, rect.y - zs, zs, zs), 3 => Rectf.make(rect.x - zs, rect.y, zs, rect.h), 4 => Rectf.make(rect.x + rect.w, rect.y, zs, rect.h), 5 => Rectf.make(rect.x - zs, rect.y + rect.h, zs, zs), 6 => Rectf.make(rect.x, rect.y + rect.h, rect.w, zs), 7 => Rectf.make(rect.x + rect.w, rect.y + rect.h, zs, zs), }; } fn onStart(self: *CropTool) void { self.mouse_point = null; self.edit_point = null; self.begin_point = null; self.crop_rect = null; self.drag_offset = null; self.drag_zone = null; } fn onMouseMove(self: *CropTool, canvas: *CanvasWidget, event: *const gui.MouseEvent) void { self.mouse_point = Pointf.make(event.x, event.y); const point = canvas.toDocumentSpace(event.x, event.y); self.edit_point = Pointi.make(ftoi(@floor(point.x)), ftoi(@floor(point.y))); if (self.crop_rect) |*rect| { if (self.drag_offset) |drag_offset| { // drag const x = ftoi(@round(point.x - drag_offset.x)); const y = ftoi(@round(point.y - drag_offset.y)); if (self.drag_zone) |drag_zone| { if (drag_zone == 0 or drag_zone == 3 or drag_zone == 5) { rect.w += rect.x - x; rect.x = x; } if (drag_zone == 0 or drag_zone == 1 or drag_zone == 2) { rect.h += rect.y - y; rect.y = y; } if (drag_zone == 2 or drag_zone == 4 or drag_zone == 7) { rect.w = x - rect.x; } if (drag_zone == 5 or drag_zone == 6 or drag_zone == 7) { rect.h = y - rect.y; } } else { rect.x = x; rect.y = y; } } } } fn onMouseDown(self: *CropTool, canvas: *CanvasWidget, event: *const gui.MouseEvent) void { self.mouse_point = Pointf.make(event.x, event.y); const point = canvas.toDocumentSpace(event.x, event.y); const edit_point = Pointi.make(ftoi(@floor(point.x)), ftoi(@floor(point.y))); if (self.crop_rect) |rect| { if (event.button == .left) { self.edit_point = edit_point; if (rect.contains(edit_point)) { self.drag_zone = null; self.drag_offset = point.subtracted(Pointf.make(itof(rect.x), itof(rect.y))); } else { const gui_point = Pointf.make(event.x, event.y); const gui_rect = canvas.rectFromDocumentSpace(ritof(rect), false); for (makeZones(gui_rect)) |zone, i| { if (zone.contains(gui_point)) { self.drag_zone = @intCast(u3, i); self.drag_offset = point.subtracted(Pointf.make(itof(rect.x), itof(rect.y))); if (i == 2 or i == 4 or i == 7) self.drag_offset.?.x -= itof(rect.w); // drag outer edges if (i == 5 or i == 6 or i == 7) self.drag_offset.?.y -= itof(rect.h); break; } } } } } else { if (event.button == .left) { self.begin_point = self.edit_point; } } } fn onMouseUp(self: *CropTool, canvas: *CanvasWidget, event: *const gui.MouseEvent) void { if (self.crop_rect) |*rect| { if (event.button == .left) { self.drag_offset = null; self.drag_zone = null; // normalize rect if (rect.w < 0) { rect.x += rect.w; rect.w = -rect.w; } if (rect.h < 0) { rect.y += rect.h; rect.h = -rect.h; } if (event.click_count == 2) { // double click if (self.edit_point) |edit_point| { if (rect.contains(edit_point)) self.apply(canvas, rect.*); } } } else if (event.button == .right) { self.cancel(); } } else { // make new crop rect if (event.button == .left) { const edit_point = self.edit_point orelse return; const begin_point = self.begin_point orelse return; const rect = Recti.fromPoints(begin_point, edit_point); if (rect.w > 0 and rect.h > 0) { self.crop_rect = rect; } self.begin_point = null; } else if (event.button == .right) { self.begin_point = null; } } } fn onKeyDown(self: *CropTool, canvas: *CanvasWidget, event: *gui.KeyEvent) void { if (event.modifiers == 0) { switch (event.key) { .Return => if (self.crop_rect) |crop_rect| { self.apply(canvas, crop_rect); }, .Escape => self.cancel(), else => event.event.ignore(), } return; } event.event.ignore(); } fn apply(self: *CropTool, canvas: *CanvasWidget, crop_rect: Recti) void { if (crop_rect.w > 0 and crop_rect.h > 0) { canvas.document.crop(crop_rect) catch return; // TODO handle error canvas.updateImageStatus(); const dx = itof(crop_rect.x) * canvas.scale; const dy = itof(crop_rect.y) * canvas.scale; canvas.translation.x += dx; canvas.translation.y += dy; if (self.edit_point) |*edit_point| { edit_point.x -= crop_rect.x; edit_point.y -= crop_rect.y; } } self.crop_rect = null; self.drag_offset = null; } fn cancel(self: *CropTool) void { self.crop_rect = null; } fn updateMousePreview(self: *CropTool, canvas: *CanvasWidget, mouse_x: f32, mouse_y: f32) void { const point = canvas.toDocumentSpace(mouse_x, mouse_y); self.edit_point = Pointi.make(ftoi(@round(point.x)), ftoi(@round(point.y))); } fn drawPreview(self: CropTool, canvas: *CanvasWidget) void { if (self.crop_rect) |rect| { const gui_rect = canvas.rectFromDocumentSpace(ritof(rect), true); const canvas_rect = canvas.widget.relative_rect; // draw vignette nvg.beginPath(); nvg.rect(0, 0, canvas_rect.w, canvas_rect.h); nvg.pathWinding(.cw); nvg.rect(gui_rect.x, gui_rect.y, gui_rect.w, gui_rect.h); nvg.fillColor(nvg.rgbaf(0, 0, 0, 0.5)); nvg.fill(); // zones var draw_zone: ?Rectf = null; if (self.drag_zone) |drag_zone| { draw_zone = makeZone(gui_rect, drag_zone); } else { // check for hover if (self.mouse_point) |mouse_point| { for (makeZones(gui_rect)) |zone| { if (zone.contains(mouse_point)) { draw_zone = zone; break; } } } } { nvg.translate(0.5, 0.5); defer nvg.translate(-0.5, -0.5); if (draw_zone) |hz| { nvg.beginPath(); nvg.rect(gui_rect.x, gui_rect.y, gui_rect.w, gui_rect.h); nvg.rect(hz.x, hz.y, hz.w, hz.h); } else { nvg.beginPath(); const gr = gui_rect; const zs = zone_size; nvg.moveTo(gr.x - zs, gr.y - zs); nvg.lineTo(gr.x - zs, gr.y); nvg.lineTo(gr.x + gr.w + zs, gr.y); nvg.lineTo(gr.x + gr.w + zs, gr.y - zs); nvg.lineTo(gr.x + gr.w, gr.y - zs); nvg.lineTo(gr.x + gr.w, gr.y + gr.h + zs); nvg.lineTo(gr.x + gr.w + zs, gr.y + gr.h + zs); nvg.lineTo(gr.x + gr.w + zs, gr.y + gr.h); nvg.lineTo(gr.x - zs, gr.y + gr.h); nvg.lineTo(gr.x - zs, gr.y + gr.h + zs); nvg.lineTo(gr.x, gr.y + gr.h + zs); nvg.lineTo(gr.x, gr.y - zs); nvg.closePath(); } nvg.strokeColor(nvg.rgbaf(0, 0, 0, 0.5)); nvg.strokeWidth(3); nvg.stroke(); nvg.strokeWidth(1); nvg.strokeColor(nvg.rgbf(1, 1, 1)); nvg.stroke(); } } else { if (!canvas.hovered) return; const edit_point = self.edit_point orelse return; var center = canvas.fromDocumentSpace( @intToFloat(f32, edit_point.x), @intToFloat(f32, edit_point.y), ); nvg.beginPath(); nvg.rect(@trunc(center.x), 0, 1, canvas.widget.relative_rect.h); nvg.rect(0, @trunc(center.y), canvas.widget.relative_rect.w, 1); if (self.begin_point) |begin_point| { center = canvas.fromDocumentSpace( @intToFloat(f32, begin_point.x), @intToFloat(f32, begin_point.y), ); nvg.rect(@trunc(center.x), 0, 1, canvas.widget.relative_rect.h); nvg.rect(0, @trunc(center.y), canvas.widget.relative_rect.w, 1); } nvg.fillPaint(nvg.imagePattern(0, 0, 4, 4, 0, canvas.grid_image, 1)); nvg.fill(); } } fn getCursor(self: CropTool) fn () void { if (self.crop_rect) |rect| { if (self.drag_offset != null) return icons.cursorMove; // TODO: grab cursor? if (self.edit_point) |edit_point| { if (rect.contains(edit_point)) return icons.cursorMove; } } return icons.cursorCrosshair; } fn getStatusText(self: CropTool, buf: []u8) [:0]const u8 { if (self.crop_rect) |rect| { return std.fmt.bufPrintZ( buf[0..], "[{d}, {d}, {d}, {d}]", .{ rect.x, rect.y, rect.w, rect.h }, ) catch unreachable; } if (self.edit_point) |edit_point| { if (self.begin_point) |begin_point| { return std.fmt.bufPrintZ( buf[0..], "({d}, {d}, {d}, {d})", .{ begin_point.x, begin_point.y, edit_point.x - begin_point.x, edit_point.y - begin_point.y, }, ) catch unreachable; } else { return std.fmt.bufPrintZ( buf[0..], "({d}, {d})", .{ edit_point.x, edit_point.y }, ) catch unreachable; } } else { return std.fmt.bufPrintZ(buf[0..], "", .{}) catch unreachable; } } }; const SelectTool = struct { edit_point: ?Pointi = null, // current cursor location in document space begin_point: ?Pointi = null, // selection begin drag_offset: ?Pointf = null, // mouse cursor relative to dragged object fn onStart(self: *SelectTool) void { self.edit_point = null; self.begin_point = null; } fn onExit(self: *SelectTool, canvas: *CanvasWidget) void { _ = self; if (canvas.document.selection != null) { canvas.document.clearSelection() catch { // TODO: show error }; } } fn onMouseMove(self: *SelectTool, canvas: *CanvasWidget, event: *const gui.MouseEvent) void { const point = canvas.toDocumentSpace(event.x, event.y); if (canvas.document.selection) |*selection| { self.edit_point = Pointi.make(ftoi(@floor(point.x)), ftoi(@floor(point.y))); if (self.drag_offset) |drag_offset| { selection.rect.x = ftoi(@round(point.x - drag_offset.x)); selection.rect.y = ftoi(@round(point.y - drag_offset.y)); } } else { self.edit_point = Pointi.make(ftoi(@round(point.x)), ftoi(@round(point.y))); } } fn onMouseDown(self: *SelectTool, canvas: *CanvasWidget, event: *const gui.MouseEvent) void { if (canvas.document.selection) |selection| { if (event.button == .left) { const point = canvas.toDocumentSpace(event.x, event.y); const pointi = Pointi.make(@floatToInt(i32, point.x), @floatToInt(i32, point.y)); if (selection.rect.contains(pointi)) { self.drag_offset = point.subtracted(Pointf.make(itof(selection.rect.x), itof(selection.rect.y))); } } } else { if (event.button == .left) { self.begin_point = self.edit_point; } } } fn onMouseUp(self: *SelectTool, canvas: *CanvasWidget, event: *const gui.MouseEvent) void { if (canvas.document.selection) |_| { if (event.button == .left) { self.drag_offset = null; } else if (event.button == .right) { canvas.document.clearSelection() catch { // TODO: show error }; } } else { // no selection if (event.button == .left) { const edit_point = self.edit_point orelse return; const begin_point = self.begin_point orelse return; const rect = Recti.fromPoints(begin_point, edit_point); if (rect.w > 0 and rect.h > 0) { canvas.document.makeSelection(rect) catch { // TODO: show error }; } self.begin_point = null; } else if (event.button == .right) { self.begin_point = null; } } } fn onKeyDown(self: *SelectTool, canvas: *CanvasWidget, event: *gui.KeyEvent) void { _ = self; if (canvas.document.selection) |*selection| { if (event.modifiers == 0) { switch (event.key) { .Escape => canvas.document.clearSelection() catch {}, .Delete => canvas.document.freeSelection(), .Left => selection.rect.x -= 1, .Right => selection.rect.x += 1, .Up => selection.rect.y -= 1, .Down => selection.rect.y += 1, else => event.event.ignore(), } return; } } event.event.ignore(); } fn updateMousePreview(self: *SelectTool, canvas: *CanvasWidget, mouse_x: f32, mouse_y: f32) void { const point = canvas.toDocumentSpace(mouse_x, mouse_y); self.edit_point = Pointi.make(ftoi(@round(point.x)), ftoi(@round(point.y))); } fn drawPreview(self: SelectTool, canvas: *CanvasWidget) void { if (canvas.document.selection != null) return; if (!canvas.hovered) return; const edit_point = self.edit_point orelse return; var center = canvas.fromDocumentSpace( @intToFloat(f32, edit_point.x), @intToFloat(f32, edit_point.y), ); nvg.beginPath(); nvg.rect(@trunc(center.x), 0, 1, canvas.widget.relative_rect.h); nvg.rect(0, @trunc(center.y), canvas.widget.relative_rect.w, 1); if (self.begin_point) |begin_point| { center = canvas.fromDocumentSpace( @intToFloat(f32, begin_point.x), @intToFloat(f32, begin_point.y), ); nvg.rect(@trunc(center.x), 0, 1, canvas.widget.relative_rect.h); nvg.rect(0, @trunc(center.y), canvas.widget.relative_rect.w, 1); } nvg.fillPaint(nvg.imagePattern(0, 0, 4, 4, 0, canvas.grid_image, 1)); nvg.fill(); } fn getCursor(self: SelectTool, canvas: *CanvasWidget) fn () void { if (canvas.document.selection) |selection| { if (self.drag_offset != null) return icons.cursorMove; // TODO: grab cursor? if (self.edit_point) |edit_point| { if (selection.rect.contains(edit_point)) return icons.cursorMove; } } return icons.cursorCrosshair; } fn getStatusText(self: SelectTool, canvas: CanvasWidget, buf: []u8) [:0]const u8 { if (canvas.document.selection) |selection| { return std.fmt.bufPrintZ( buf[0..], "[{d}, {d}, {d}, {d}]", .{ selection.rect.x, selection.rect.y, selection.rect.w, selection.rect.h, }, ) catch unreachable; } if (self.edit_point) |edit_point| { if (self.begin_point) |begin_point| { return std.fmt.bufPrintZ( buf[0..], "({d}, {d}, {d}, {d})", .{ begin_point.x, begin_point.y, edit_point.x - begin_point.x, edit_point.y - begin_point.y, }, ) catch unreachable; } else { return std.fmt.bufPrintZ( buf[0..], "({d}, {d})", .{ edit_point.x, edit_point.y }, ) catch unreachable; } } else { return std.fmt.bufPrintZ(buf[0..], "", .{}) catch unreachable; } } }; const DrawTool = struct { edit_point: Pointi = Pointi{ .x = -1, .y = -1 }, last_point: ?Pointi = null, drawing: bool = false, picking: bool = false, fn onExit(self: *DrawTool, canvas: *CanvasWidget) void { canvas.document.clearPreview(); if (self.drawing) { canvas.document.endStroke() catch {}; // TODO: handle? self.drawing = false; } self.last_point = null; } fn onMouseMove(self: *DrawTool, canvas: *CanvasWidget, event: *const gui.MouseEvent) void { const point = canvas.toDocumentSpace(event.x, event.y); self.edit_point.x = @floatToInt(i32, @floor(point.x)); self.edit_point.y = @floatToInt(i32, @floor(point.y)); if (event.isButtonPressed(.left) and self.drawing) { if (self.last_point) |last_point| { canvas.document.stroke( last_point.x, last_point.y, self.edit_point.x, self.edit_point.y, ); } self.last_point = self.edit_point; } else if (event.isModifierPressed(.shift)) { if (self.last_point) |last_point| { canvas.document.previewStroke( last_point.x, last_point.y, self.edit_point.x, self.edit_point.y, ); } } else if (!self.picking) { canvas.document.previewBrush(self.edit_point.x, self.edit_point.y); } } fn onMouseDown(self: *DrawTool, canvas: *CanvasWidget, event: *const gui.MouseEvent) void { if (event.button == .left) { if (event.isModifierPressed(.shift) and self.last_point != null) { if (self.last_point) |last_point| { canvas.document.stroke( last_point.x, last_point.y, self.edit_point.x, self.edit_point.y, ); } } else { canvas.document.beginStroke(self.edit_point.x, self.edit_point.y); } self.last_point = self.edit_point; self.drawing = true; } else if (event.button == .right) { self.picking = true; canvas.document.clearPreview(); } } fn onMouseUp(self: *DrawTool, canvas: *CanvasWidget, event: *const gui.MouseEvent) void { if (event.button == .left) { canvas.document.endStroke() catch { gui.showMessageBox(.err, "Stroke", "Out of memory"); // TODO: nicer error message }; self.drawing = false; } else if (event.button == .right) { if (canvas.document.pickColor(self.edit_point.x, self.edit_point.y)) |color| { canvas.document.setForegroundColorRgba(color); canvas.notifyColorChanged(); } self.picking = false; } } fn onKeyDown(self: *DrawTool, canvas: *CanvasWidget, event: *gui.KeyEvent) void { switch (event.key) { .LShift, .RShift => { if (!event.repeat) { //self.last_point = self.edit_point; if (self.last_point) |last_point| { canvas.document.previewStroke( last_point.x, last_point.y, self.edit_point.x, self.edit_point.y, ); } else { canvas.document.previewBrush(self.edit_point.x, self.edit_point.y); } return; } }, else => {}, } event.event.ignore(); } fn onKeyUp(self: *DrawTool, canvas: *CanvasWidget, event: *gui.KeyEvent) void { switch (event.key) { .LShift, .RShift => { if (!event.repeat) { canvas.document.previewBrush(self.edit_point.x, self.edit_point.y); return; } }, else => {}, } event.event.ignore(); } fn onLeave(self: *DrawTool, canvas: *CanvasWidget) void { _ = self; canvas.document.clearPreview(); } fn updateMousePreview(self: *DrawTool, canvas: *CanvasWidget, mouse_x: f32, mouse_y: f32) void { const point = canvas.toDocumentSpace(mouse_x, mouse_y); self.edit_point.x = @floatToInt(i32, @floor(point.x)); self.edit_point.y = @floatToInt(i32, @floor(point.y)); canvas.document.previewBrush(self.edit_point.x, self.edit_point.y); } fn getCursor(self: DrawTool) fn () void { return if (self.picking) icons.cursorPipette else icons.cursorPen; } fn getStatusText(self: DrawTool, canvas: CanvasWidget, buf: []u8) [:0]const u8 { if (self.picking) { if (canvas.document.pickColor(self.edit_point.x, self.edit_point.y)) |color| { return std.fmt.bufPrintZ( buf[0..], "{X:0>2} {X:0>2} {X:0>2} {X:0>2} ({d}, {d})", .{ color[0], color[1], color[2], color[3], self.edit_point.x, self.edit_point.y, }, ) catch unreachable; } } return std.fmt.bufPrintZ( buf[0..], "({d}, {d})", .{ self.edit_point.x, self.edit_point.y }, ) catch unreachable; } }; const FillTool = struct { edit_point: Pointi = Pointi{ .x = 0, .y = 0 }, picking: bool = false, fn onMouseMove(self: *FillTool, canvas: *CanvasWidget, event: *const gui.MouseEvent) void { _ = self; const point = canvas.toDocumentSpace(event.x, event.y); self.edit_point.x = @floatToInt(i32, @floor(point.x)); self.edit_point.y = @floatToInt(i32, @floor(point.y)); } fn onMouseDown(self: *FillTool, event: *const gui.MouseEvent) void { if (event.button == .right) { self.picking = true; } } fn onMouseUp(self: *FillTool, canvas: *CanvasWidget, event: *const gui.MouseEvent) void { if (event.button == .left) { canvas.document.floodFill(self.edit_point.x, self.edit_point.y) catch { gui.showMessageBox(.err, "Stroke", "Out of memory"); // TODO: nicer error message }; } else if (event.button == .right) { if (canvas.document.pickColor(self.edit_point.x, self.edit_point.y)) |color| { canvas.document.setForegroundColorRgba(color); canvas.notifyColorChanged(); } self.picking = false; } } fn getCursor(self: FillTool) fn () void { return if (self.picking) icons.cursorPipette else icons.cursorBucket; } fn getStatusText(self: FillTool, canvas: CanvasWidget, buf: []u8) [:0]const u8 { if (self.picking) { if (canvas.document.pickColor(self.edit_point.x, self.edit_point.y)) |color| { return std.fmt.bufPrintZ( buf[0..], "{X:0>2} {X:0>2} {X:0>2} {X:0>2} ({d}, {d})", .{ color[0], color[1], color[2], color[3], self.edit_point.x, self.edit_point.y, }, ) catch unreachable; } } return std.fmt.bufPrintZ(buf[0..], "({d}, {d})", .{ self.edit_point.x, self.edit_point.y }) catch unreachable; } }; const CanvasWidget = @This(); widget: gui.Widget, allocator: *Allocator, baseOnKeyDownFn: fn (*gui.Widget, *gui.KeyEvent) void, tool: ToolType = .draw, crop_tool: CropTool = CropTool{}, select_tool: SelectTool = SelectTool{}, draw_tool: DrawTool = DrawTool{}, fill_tool: FillTool = FillTool{}, document: *Document, // just a reference, owned by editor horizontal_scrollbar: *gui.Scrollbar, vertical_scrollbar: *gui.Scrollbar, // view transform translation: Pointf = Pointf.make(0, 0), scale: f32 = 16, grid_enabled: bool = false, document_background_image: nvg.Image, grid_image: nvg.Image, hovered: bool = false, scroll_offset: ?Pointf = null, // in document space onColorChangedFn: ?fn (*Self, [4]u8) void = null, onScaleChangedFn: ?fn (*Self, f32) void = null, const Self = @This(); pub fn init(allocator: *Allocator, rect: Rect(f32), document: *Document) !*Self { var self = try allocator.create(Self); self.* = Self{ .widget = gui.Widget.init(allocator, rect), .allocator = allocator, .baseOnKeyDownFn = undefined, .document = document, .horizontal_scrollbar = try gui.Scrollbar.init(allocator, Rect(f32).make(0, 160, 160, 16), .horizontal), .vertical_scrollbar = try gui.Scrollbar.init(allocator, Rect(f32).make(160, 0, 16, 160), .vertical), .document_background_image = nvg.createImageRgba(2, 2, .{ .repeat_x = true, .repeat_y = true, .nearest = true }, &.{ 0x66, 0x66, 0x66, 0xFF, 0x99, 0x99, 0x99, 0xFF, 0x99, 0x99, 0x99, 0xFF, 0x66, 0x66, 0x66, 0xFF, }), .grid_image = nvg.createImageRgba(2, 2, .{ .repeat_x = true, .repeat_y = true, .nearest = true }, &.{ 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, }), }; self.widget.focus_policy.keyboard = true; self.widget.focus_policy.mouse = true; self.widget.onResizeFn = onResize; self.widget.onMouseMoveFn = onMouseMove; self.widget.onMouseDownFn = onMouseDown; self.widget.onMouseUpFn = onMouseUp; self.widget.onMouseWheelFn = onMouseWheel; self.widget.onTouchPanFn = onTouchPan; self.widget.onTouchZoomFn = onTouchZoom; self.baseOnKeyDownFn = self.widget.onKeyDownFn; self.widget.onKeyDownFn = onKeyDown; self.widget.onKeyUpFn = onKeyUp; self.widget.onEnterFn = onEnter; self.widget.onLeaveFn = onLeave; self.widget.drawFn = draw; self.horizontal_scrollbar.onChangedFn = struct { fn changed(scrollbar: *gui.Scrollbar) void { const canvas = @fieldParentPtr(Self, "widget", scrollbar.widget.parent.?); const client_w = canvas.getClientRect().w; canvas.translation.x = @round(0.5 * client_w - scrollbar.value); } }.changed; self.vertical_scrollbar.onChangedFn = struct { fn changed(scrollbar: *gui.Scrollbar) void { const canvas = @fieldParentPtr(Self, "widget", scrollbar.widget.parent.?); const client_h = canvas.getClientRect().h; canvas.translation.y = @round(0.5 * client_h - scrollbar.value); } }.changed; try self.widget.addChild(&self.horizontal_scrollbar.widget); try self.widget.addChild(&self.vertical_scrollbar.widget); self.updateLayout(); return self; } pub fn deinit(self: *Self) void { nvg.deleteImage(self.document_background_image); nvg.deleteImage(self.grid_image); self.horizontal_scrollbar.deinit(); self.vertical_scrollbar.deinit(); self.widget.deinit(); self.allocator.destroy(self); } pub fn setTool(self: *Self, tool: ToolType) void { if (self.tool != tool) { switch (self.tool) { .select => self.select_tool.onExit(self), .draw => self.draw_tool.onExit(self), else => {}, } self.tool = tool; switch (self.tool) { .crop => self.crop_tool.onStart(), .select => self.select_tool.onStart(), else => {}, } } } fn getClientRect(self: Self) Rectf { const rect = self.widget.getRect(); return .{ .x = 0, .y = 0, .w = rect.w - gui.Scrollbar.button_size, .h = rect.h - gui.Scrollbar.button_size }; // without scrollbars } fn setTranslation(self: *Self, x: f32, y: f32) void { const client_rect = self.getClientRect(); const document_w = self.scale * @intToFloat(f32, self.document.width); const document_h = self.scale * @intToFloat(f32, self.document.height); const min_x = 0.5 * client_rect.w - document_w; const min_y = 0.5 * client_rect.h - document_h; const max_x = 0.5 * client_rect.w; const max_y = 0.5 * client_rect.h; self.translation.x = @round(std.math.clamp(x, min_x, max_x)); self.translation.y = @round(std.math.clamp(y, min_y, max_y)); self.updateScrollbars(); } fn updateScrollbars(self: *Self) void { const client_rect = self.getClientRect(); const document_w = self.scale * @intToFloat(f32, self.document.width); const document_h = self.scale * @intToFloat(f32, self.document.height); self.horizontal_scrollbar.setMaxValue(document_w); self.horizontal_scrollbar.setValue(0.5 * client_rect.w - self.translation.x); self.vertical_scrollbar.setMaxValue(document_h); self.vertical_scrollbar.setValue(0.5 * client_rect.h - self.translation.y); } pub fn centerDocument(self: *Self) void { const rect = self.widget.relative_rect; self.setTranslation( 0.5 * (rect.w - self.scale * @intToFloat(f32, self.document.width)), 0.5 * (rect.h - self.scale * @intToFloat(f32, self.document.height)), ); } fn onResize(widget: *gui.Widget, event: *const gui.ResizeEvent) void { _ = event; const self = @fieldParentPtr(Self, "widget", widget); self.updateLayout(); self.updateScrollbars(); } fn onMouseMove(widget: *gui.Widget, event: *const gui.MouseEvent) void { var self = @fieldParentPtr(Self, "widget", widget); // translate view if (event.isButtonPressed(.middle)) { if (self.scroll_offset) |scroll_offset| { const point = self.toDocumentSpace(event.x, event.y); const t = point.subtracted(scroll_offset); const gui_point = self.fromDocumentSpace(t.x, t.y); self.setTranslation(gui_point.x, gui_point.y); } } switch (self.tool) { .crop => self.crop_tool.onMouseMove(self, event), .select => self.select_tool.onMouseMove(self, event), .draw => self.draw_tool.onMouseMove(self, event), .fill => self.fill_tool.onMouseMove(self, event), } self.updateStatusBar(); } fn onMouseDown(widget: *gui.Widget, event: *const gui.MouseEvent) void { var self = @fieldParentPtr(Self, "widget", widget); if (event.isButtonPressed(.middle)) { self.scroll_offset = self.toDocumentSpace(event.x, event.y); } switch (self.tool) { .crop => self.crop_tool.onMouseDown(self, event), .select => self.select_tool.onMouseDown(self, event), .draw => self.draw_tool.onMouseDown(self, event), .fill => self.fill_tool.onMouseDown(event), } self.updateStatusBar(); } fn onMouseUp(widget: *gui.Widget, event: *const gui.MouseEvent) void { var self = @fieldParentPtr(Self, "widget", widget); if (event.button == .middle) { self.scroll_offset = null; } switch (self.tool) { .crop => self.crop_tool.onMouseUp(self, event), .select => self.select_tool.onMouseUp(self, event), .draw => self.draw_tool.onMouseUp(self, event), .fill => self.fill_tool.onMouseUp(self, event), } self.updateStatusBar(); } fn onMouseWheel(widget: *gui.Widget, event: *const gui.MouseEvent) void { const zoom_factor = 1.25; var self = @fieldParentPtr(Self, "widget", widget); if (event.wheel_y > 0) { self.zoom(zoom_factor, event.x, event.y); } else if (event.wheel_y < 0) { self.zoom(1.0 / zoom_factor, event.x, event.y); } } fn onTouchPan(widget: *gui.Widget, event: *const gui.TouchEvent) void { var self = @fieldParentPtr(Self, "widget", widget); self.setTranslation(self.translation.x + event.dx, self.translation.y + event.dy); self.updateToolMousePreview(event.x, event.y); } fn onTouchZoom(widget: *gui.Widget, event: *const gui.TouchEvent) void { var self = @fieldParentPtr(Self, "widget", widget); const factor = 1.0 + event.zoom; self.zoom(factor, event.x, event.y); self.updateToolMousePreview(event.x, event.y); } fn onKeyDown(widget: *gui.Widget, event: *gui.KeyEvent) void { var self = @fieldParentPtr(Self, "widget", widget); self.baseOnKeyDownFn(widget, event); if (event.event.is_accepted) return; switch (self.tool) { .crop => self.crop_tool.onKeyDown(self, event), .select => self.select_tool.onKeyDown(self, event), .draw => self.draw_tool.onKeyDown(self, event), else => event.event.ignore(), } } fn onKeyUp(widget: *gui.Widget, event: *gui.KeyEvent) void { var self = @fieldParentPtr(Self, "widget", widget); switch (self.tool) { .draw => self.draw_tool.onKeyUp(self, event), else => event.event.ignore(), } } fn onEnter(widget: *gui.Widget) void { var self = @fieldParentPtr(Self, "widget", widget); self.hovered = true; } fn onLeave(widget: *gui.Widget) void { var self = @fieldParentPtr(Self, "widget", widget); self.hovered = false; if (self.tool == .draw) self.draw_tool.onLeave(self); } fn updateLayout(self: *Self) void { const client_rect = self.getClientRect(); self.horizontal_scrollbar.widget.setPosition(0, client_rect.h); self.horizontal_scrollbar.widget.setSize(client_rect.w + 1, gui.Scrollbar.button_size); self.vertical_scrollbar.widget.setPosition(client_rect.w, 0); self.vertical_scrollbar.widget.setSize(gui.Scrollbar.button_size, client_rect.h + 1); self.setTranslation(self.translation.x, self.translation.y); // update } fn updateToolMousePreview(self: *Self, mouse_x: f32, mouse_y: f32) void { switch (self.tool) { .crop => self.crop_tool.updateMousePreview(self, mouse_x, mouse_y), .select => self.select_tool.updateMousePreview(self, mouse_x, mouse_y), .draw => self.draw_tool.updateMousePreview(self, mouse_x, mouse_y), else => {}, } } fn zoom(self: *Self, factor: f32, center_x: f32, center_y: f32) void { const prev_scale = self.scale; self.scale *= factor; self.scale = std.math.clamp(self.scale, 1.0 / 32.0, 64); if (self.scale != prev_scale) { self.notifyScaleChanged(); // update translation const f = self.scale / prev_scale; const dx = self.translation.x - center_x; const dy = self.translation.y - center_y; self.setTranslation( self.translation.x + f * dx - dx, self.translation.y + f * dy - dy, ); } } pub fn zoomToDocumentCenter(self: *Self, factor: f32) void { const center_x = self.translation.x + self.scale * 0.5 * @intToFloat(f32, self.document.width); const center_y = self.translation.y + self.scale * 0.5 * @intToFloat(f32, self.document.height); self.zoom(factor, center_x, center_y); } fn toDocumentSpace(self: Self, x: f32, y: f32) Pointf { return Pointf.make((x - self.translation.x) / self.scale, (y - self.translation.y) / self.scale); } fn fromDocumentSpace(self: Self, x: f32, y: f32) Pointf { return Pointf.make(x * self.scale + self.translation.x, y * self.scale + self.translation.y); } fn rectFromDocumentSpace(self: Self, rect: Rectf, snap_to_pixel: bool) Rectf { const p0 = self.fromDocumentSpace(rect.x, rect.y); const p1 = self.fromDocumentSpace(rect.x + rect.w, rect.y + rect.h); return if (snap_to_pixel) Rectf.make(@trunc(p0.x), @trunc(p0.y), @trunc(p1.x - p0.x), @trunc(p1.y - p0.y)) else Rectf.make(p0.x, p0.y, p1.x - p0.x, p1.y - p0.y); } fn notifyScaleChanged(self: *Self) void { if (self.onScaleChangedFn) |onScaleChanged| { onScaleChanged(self, self.scale); } } fn notifyColorChanged(self: *Self) void { if (self.onColorChangedFn) |onColorChanged| { onColorChanged(self, self.document.foreground_color); } } fn draw(widget: *gui.Widget) void { const self = @fieldParentPtr(Self, "widget", widget); const rect = widget.relative_rect; { nvg.save(); defer nvg.restore(); nvg.scissor(rect.x, rect.y, rect.w, rect.h); nvg.translate(rect.x, rect.y); { nvg.save(); defer nvg.restore(); nvg.translate(self.translation.x, self.translation.y); self.drawDocumentBackground(); { // draw document nvg.save(); defer nvg.restore(); nvg.scale(self.scale, self.scale); self.document.draw(); } if (self.document.selection) |selection| { self.drawSelection(selection); } else { self.drawGrid(); } } switch (self.tool) { .crop => self.crop_tool.drawPreview(self), .select => self.select_tool.drawPreview(self), else => {}, } // set cursor if (widget.getWindow()) |window| { if (self.hovered) { // based on tool switch (self.tool) { .crop => window.setCursor(self.crop_tool.getCursor()), .select => window.setCursor(self.select_tool.getCursor(self)), .draw => window.setCursor(self.draw_tool.getCursor()), .fill => window.setCursor(self.fill_tool.getCursor()), } } else { window.setCursor(null); } } } nvg.beginPath(); nvg.rect(rect.x + rect.w - 15, rect.y + rect.h - 15, 15, 15); nvg.fillColor(gui.theme_colors.background); nvg.fill(); self.widget.drawChildren(); } fn drawDocumentBackground(self: Self) void { nvg.beginPath(); nvg.rect(0, 0, self.scale * @intToFloat(f32, self.document.width), self.scale * @intToFloat(f32, self.document.height)); nvg.fillPaint(nvg.imagePattern(0, 0, 8, 8, 0, self.document_background_image, 1)); nvg.fill(); } fn drawGrid(self: Self) void { if (self.grid_enabled and self.scale > 3) { nvg.beginPath(); var x: u32 = 0; while (x <= self.document.width) : (x += 1) { const fx = @trunc(@intToFloat(f32, x) * self.scale); nvg.rect(fx, 0, 1, @intToFloat(f32, self.document.height) * self.scale); } var y: u32 = 0; while (y <= self.document.height) : (y += 1) { const fy = @trunc(@intToFloat(f32, y) * self.scale); nvg.rect(0, fy, @intToFloat(f32, self.document.width) * self.scale, 1); } nvg.fillPaint(nvg.imagePattern(0, 0, 2, 2, 0, self.grid_image, 0.5)); nvg.fill(); } } fn drawSelection(self: Self, selection: Document.Selection) void { const s = self.scale; const fx = @intToFloat(f32, selection.rect.x); const fy = @intToFloat(f32, selection.rect.y); const fw = @intToFloat(f32, selection.rect.w); const fh = @intToFloat(f32, selection.rect.h); const x0 = @trunc(fx * s); const y0 = @trunc(fy * s); const x1 = @trunc((fx + fw) * s); const y1 = @trunc((fy + fh) * s); { nvg.save(); defer nvg.restore(); nvg.scale(s, s); nvg.scissor(0, 0, @intToFloat(f32, self.document.width), @intToFloat(f32, self.document.height)); nvg.beginPath(); nvg.rect(fx, fy, fw, fh); nvg.fillPaint(nvg.imagePattern(fx, fy, fw, fh, 0, selection.texture, 1)); nvg.fill(); } self.drawGrid(); // draw selection border on top of grid nvg.beginPath(); nvg.rect(x0, y0, x1 - x0 + 1, y1 - y0 + 1); nvg.pathWinding(.cw); nvg.rect(x0 + 1, y0 + 1, x1 - x0 - 1, y1 - y0 - 1); nvg.pathWinding(.ccw); nvg.fillPaint(nvg.imagePattern(0, 0, 4, 4, 0, self.grid_image, 1)); nvg.fill(); } fn updateStatusBar(self: Self) void { if (self.widget.parent) |parent| { var editor = @fieldParentPtr(EditorWidget, "widget", parent); editor.tool_status_label.text = switch (self.tool) { .crop => self.crop_tool.getStatusText(editor.tool_text[0..]), .select => self.select_tool.getStatusText(self, editor.tool_text[0..]), .draw => self.draw_tool.getStatusText(self, editor.tool_text[0..]), .fill => self.fill_tool.getStatusText(self, editor.tool_text[0..]), }; } } fn updateImageStatus(self: Self) void { if (self.widget.parent) |parent| { var editor = @fieldParentPtr(EditorWidget, "widget", parent); editor.updateImageStatus(); } }
src/CanvasWidget.zig
const std = @import("std"); const mem = std.mem; const utils = @import("utils.zig"); const expect = std.testing.expect; const bibtex = @import("bibtex.zig"); const csl = @import("csl_json.zig"); pub const Error = error { NoMatchingItemType, NoMatchingField, }; /// should be called with an arena allocator pub fn bib_to_csl_json( allocator: *std.mem.Allocator, bib: bibtex.Bibliography, comptime copy_strings: bool ) ![]csl.Item { var items = std.ArrayList(csl.Item).init(allocator); var bib_iter = bib.label_entry_map.iterator(); while (bib_iter.next()) |map_entry| { const id = map_entry.key_ptr.*; const entry = map_entry.value_ptr; var csl_type = bib_entry_to_csl_item(entry._type) catch continue; var item = csl.Item.init( allocator, csl_type, .{ .string = try maybe_copy_string(allocator, copy_strings, id) }); var fields_iter = entry.fields.iterator(); while (fields_iter.next()) |field_entry| { const field_name = field_entry.value_ptr.name; switch (field_name) { .custom, .month, .year => continue, else => set_bib_field_on_csl( allocator, field_name, field_entry.value_ptr.data, &item.optionals, copy_strings) catch continue, } } // set month/year separately var date_parts_start = try allocator.alloc(csl.OrdinaryVar, 2); const mb_year = entry.fields.get("year"); if (mb_year) |year| { date_parts_start[0] = .{ .string = try maybe_copy_string( allocator, copy_strings, year.data.literal_field.value) }; var slice_idx: u8 = 1; // in CSL it's only allowed to specify a month if there was a year specified const mb_month = entry.fields.get("month"); if (mb_month) |month| { const month_str = month.data.literal_field.value; // NOTE: citeproc doens't allow strings (that aren't numbers) in the date-parts array const contains_alpha = blk: for (month_str) |c| { if (std.ascii.isAlpha(c)) { break :blk true; } } else blk: { break :blk false; }; if (contains_alpha) { // convert to number const month_num = try bibtex_month_to_num(month_str); date_parts_start[1] = .{ .number = month_num }; } else { date_parts_start[1] = .{ .string = try maybe_copy_string( allocator, copy_strings, month.data.literal_field.value) }; } slice_idx = 2; } else { // free the second OrdinaryVar allocator.destroy(&date_parts_start[1]); } var date_slice = try allocator.create([]csl.OrdinaryVar); date_slice.* = date_parts_start[0..slice_idx]; try item.optionals.put( "issued", csl.Property{ .issued = .{ // cast *[]OrdinaryVar to ptr to array with size 1 to be able to then slice it .date = .{ .@"date-parts" = @as(*[1][]csl.OrdinaryVar, date_slice)[0..] } } } ); } try items.append(item); } return items.toOwnedSlice(); } /// only supports english month names for now fn bibtex_month_to_num(month: []const u8) !u8 { var buf = [_]u8 { undefined } ** 50; var allocator = std.heap.FixedBufferAllocator.init(buf[0..]); const lowercased = try std.ascii.allocLowerString( &allocator.allocator, month); var result: u8 = undefined; if (mem.startsWith(u8, lowercased, "jan")) { result = 1; } else if (mem.startsWith(u8, lowercased, "feb")) { result = 2; } else if (mem.startsWith(u8, lowercased, "mar")) { result = 3; } else if (mem.startsWith(u8, lowercased, "apr")) { result = 4; } else if (mem.startsWith(u8, lowercased, "may")) { result = 5; } else if (mem.startsWith(u8, lowercased, "jun")) { result = 6; } else if (mem.startsWith(u8, lowercased, "jul")) { result = 7; } else if (mem.startsWith(u8, lowercased, "aug")) { result = 8; } else if (mem.startsWith(u8, lowercased, "sep")) { result = 9; } else if (mem.startsWith(u8, lowercased, "oct")) { result = 10; } else if (mem.startsWith(u8, lowercased, "nov")) { result = 11; } else if (mem.startsWith(u8, lowercased, "dec")) { result = 12; } else { return error.InvalidBibtexMonth; } return result; } // TODO proper tests test "bib to csl" { const alloc = std.testing.allocator; const file = try std.fs.cwd().openFile("book.bib", .{ .read = true }); defer file.close(); const contents = try file.reader().readAllAlloc( alloc, 2 * 1024 * 1024, // max_size 2MiB, returns error.StreamTooLong if file is larger ); defer alloc.free(contents); var bibparser = bibtex.BibParser.init(alloc, "book.bib", contents); var bib = try bibparser.parse(); defer bib.deinit(); var arena = std.heap.ArenaAllocator.init(alloc); defer arena.deinit(); var csl_json = try bib_to_csl_json(&arena.allocator, bib, false); const write_file = try std.fs.cwd().createFile( "bib_.json", // truncate: reduce file to length 0 if it exists .{ .read = true, .truncate = true }, ); defer write_file.close(); try csl.write_items_json(csl_json, write_file.writer()); } pub fn bib_entry_to_csl_item(entry_type: bibtex.EntryType) !csl.ItemType { return switch (entry_type) { // ?custom[a-f] .comment, .set, .xdata, .bibnote, => return Error.NoMatchingItemType, .article, .periodical, .suppperiodical, => .@"article-journal", .misc, .commentary, => .article, .book, .mvbook, .bookinbook, .booklet, .collection, .mvcollection, .proceedings, .mvproceedings, .reference, .mvreference, => .book, .incollection, .suppcollection, .inbook, .suppbook, => .chapter, .dataset, => .dataset, .online, .electronic, // -> online .www, // -> online => .webpage, .patent, => .patent, .inproceedings, .conference, // -> inproceedings => .@"paper-conference", .inreference, => .entry, .report, .techreport, // -> report, as type tag => .report, .software, => .software, .thesis, .mastersthesis, // special case of thesis, as type tag .phdthesis, // special case of thesis, as type tag => .thesis, .unpublished, => .manuscript, .artwork, => .graphic, .audio, => .song, .image, => .figure, .jurisdiction, => .legal_case, .legislation, => .legislation, .legal, => .treaty, .letter, => .personal_communication, .movie, .video, => .motion_picture, .music, => .musical_score, .review, => .review, // TODO unsure .manual, => .document, .performance, => .performance, .standard, => .standard, }; } pub fn set_bib_field_on_csl( allocator: *std.mem.Allocator, field_name: bibtex.FieldName, field_data: bibtex.FieldType, item_props: *csl.PropertyMap, comptime copy_strings: bool, ) !void { var csl_prop: csl.Property = undefined; // NOTE: setting month and year separately so we can build the whole date-parts struct // or edtf string switch (field_name) { .custom, // arbitrary name to e.g. save additional info => return Error.NoMatchingField, .abstract, => csl_prop = .{ .abstract = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), }, // .addendum, .annotation, .annote, // alias for annotation => csl_prop = .{ .annote = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), }, .booksubtitle, .booktitle, .booktitleaddon, => csl_prop = .{ .@"container-title" = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), }, .chapter, => csl_prop = .{ .@"chapter-number" = .{ .string = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), } }, .edition, => csl_prop = .{ .edition = .{ .string = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), } }, // TODO on .eid: should start with 'e', pages -> replace '--' with '-' .eid, => csl_prop = .{ .page = .{ .string = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), } }, .entrysubtype, // citation-js also has 'type' as target? => csl_prop = .{ .genre = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), }, // .eprintclass, .eprinttype, => csl_prop = .{ .PMID = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), }, .eventtitle, => csl_prop = .{ .@"event-title" = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), }, // .eventtitleaddon, // TODO only on manuscript when there's no publisher, organization, institution .howpublished, => csl_prop = .{ .publisher = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), }, // .indextitle, // TODO when not patent .isan, .ismn, .isrn, .iswc, => csl_prop = .{ .number = .{ .string = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), } }, .isbn, => csl_prop = .{ .ISBN = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), }, .issn, => csl_prop = .{ .ISSN = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), }, // .issue, .issuetitle, .issuesubtitle, .issuetitleaddon, => csl_prop = .{ .@"volume-title" = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), }, // TODO citation-js has target: article, article-newspaper, etc. .journaltitle, .journalsubtitle, .journaltitleaddon, .journal, // alias -> journaltitle => csl_prop = .{ .@"container-title" = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), }, // .label, .library, => csl_prop = .{ .@"call-number" = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), }, .mainsubtitle, .maintitle, .maintitleaddon, => csl_prop = .{ .@"container-title" = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), }, // .nameaddon, .note, => csl_prop = .{ .note = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), }, .number, => csl_prop = .{ .number = .{ .string = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), } }, .origtitle, => csl_prop = .{ .@"original-title" = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), }, .pagetotal, => csl_prop = .{ .@"number-of-pages" = .{ .string = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), } }, .part, => csl_prop = .{ .part = .{ .string = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), } }, // .reprinttitle, .series, => csl_prop = .{ .@"collection-title" = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), }, // .shorthand, // .shorthandintro, .shortjournal, .shortseries, .shorttitle, => csl_prop = .{ .@"container-title-short" = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), }, .title, .titleaddon, .subtitle, => csl_prop = .{ .title = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), }, .venue, => csl_prop = .{ .@"event-place" = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), }, .version, => csl_prop = .{ .version = try maybe_copy_string( allocator, copy_strings, field_data.literal_field.value), }, .usera, .userb, .userc, .userd, .usere, .userf, .verba, .verbb, .verbc, .lista, .listb, .listc, .listd, .liste, .listf, => return Error.NoMatchingField, // TODO custom fields .archiveprefix, // alias -> eprinttype => csl_prop = .{ .PMID = try maybe_copy_string(allocator, copy_strings, field_data.literal_field.value), }, // .primaryclass, // alias -> eprintclass // afterword, // annotator, .author, => csl_prop = try bib_field_extract_name_list(allocator, .author, field_data, copy_strings), .bookauthor, => csl_prop = try bib_field_extract_name_list( allocator, .@"container-author", field_data, copy_strings), // commentator, .editor, .editora, .editorb, .editorc, => csl_prop = try bib_field_extract_name_list(allocator, .editor, field_data, copy_strings), // foreword, // holder, // introduction, // shortauthor, // shorteditor, .translator, => csl_prop = try bib_field_extract_name_list(allocator, .translator, field_data, copy_strings), // namea, // nameb, // namec, // // key_field START // authortype, // TODO unsure v .bookpagination, => csl_prop = .{ .section = try maybe_copy_string(allocator, copy_strings, field_data.key_field.value), }, // TODO can be used to assign editor[a-c] to compiler, organizer, ... // editortype, // editoratype, // editorbtype, // editorctype, // // pagination, // .@"type", // => .genre, // nameatype, // namebtype, // namectype, // key_field END // // NOTE: treats bib(la)tex date fields as edtf strings // these should prob be fine as edtf string, but the format needs to be // YYYY-MM-DDTHH:MM:SS, see https://www.loc.gov/standards/datetime/ // raw field of date is now supposed to be treated like edtf // (see https://discourse.citationstyles.org/t/raw-dates-vs-date-parts/1533/11) // literal is used to inlcude additional descriptions in the date .date, => csl_prop = .{ .issued = .{ .edtf = try maybe_copy_string( allocator, copy_strings, field_data.date_field.value), } }, .eventdate, => csl_prop = .{ .@"event-date" = .{ .edtf = try maybe_copy_string( allocator, copy_strings, field_data.date_field.value), } }, .origdate, => csl_prop = .{ .@"original-date" = .{ .edtf = try maybe_copy_string( allocator, copy_strings, field_data.date_field.value), } }, .urldate, => csl_prop = .{ .accessed = .{ .edtf = try maybe_copy_string( allocator, copy_strings, field_data.date_field.value), } }, // .doi, => csl_prop = .{ .DOI = try maybe_copy_string( allocator, copy_strings, field_data.verbatim_field.value), }, .eprint, => csl_prop = .{ .PMID = try maybe_copy_string( allocator, copy_strings, field_data.verbatim_field.value), }, // TODO custom // file, // pdf, // alias -> file .institution, .school, // alias -> institution => csl_prop = try bib_field_extract_list(allocator, .publisher, .literal_list, field_data, copy_strings), // TODO 'jurisdiction' when type patent .location, .address, // alias for location => csl_prop = try bib_field_extract_list( allocator, .@"publisher-place", .literal_list, field_data, copy_strings), .organization, => csl_prop = try bib_field_extract_list(allocator, .publisher, .literal_list, field_data, copy_strings), .origlocation, => csl_prop = try bib_field_extract_list( allocator, .@"original-publisher-place", .literal_list, field_data, copy_strings), .origpublisher, => csl_prop = try bib_field_extract_list( allocator, .@"original-publisher", .literal_list, field_data, copy_strings), .publisher, => csl_prop = try bib_field_extract_list(allocator, .publisher, .literal_list, field_data, copy_strings), .pubstate, => csl_prop = try bib_field_extract_list(allocator, .status, .literal_list, field_data, copy_strings), .language, => csl_prop = try bib_field_extract_list(allocator, .language, .key_list, field_data, copy_strings), // origlanguage, .pages, => csl_prop = .{ .page = .{ .string = try maybe_copy_string( allocator, copy_strings, field_data.range_field.value), } }, .url, => csl_prop = .{ .URL = try maybe_copy_string(allocator, copy_strings, field_data.uri_field.value), }, .volume, => csl_prop = .{ .volume = .{ .string = try maybe_copy_string( allocator, copy_strings, field_data.integer_field.value), }, }, .volumes, => csl_prop = .{ .@"number-of-volumes" = .{ .string = try maybe_copy_string( allocator, copy_strings, field_data.integer_field.value), } }, // special fields START // .ids, .crossref, .fakeset, .gender, .entryset, .execute, // .hyphenation, .indexsorttitle, .keywords, .langid, .langidopts, // .options, .presort, .related, .relatedoptions, .relatedtype, // .sortshorthand, .sortkey, .sortname, .sorttitle, .sortyear, .xref, // .key, // aliast -> sortkey // => return Error.NoMatchingField, // special fields END else => return Error.NoMatchingField, } // NOTE: currently overwriting on duplicate try item_props.put(@tagName(csl_prop), csl_prop); } fn bib_field_extract_name_list( allocator: *std.mem.Allocator, comptime active_tag: std.meta.TagType(csl.Property), field_data: bibtex.FieldType, comptime copy_strings: bool, ) !csl.Property { var names = std.ArrayList(csl.NameVar).init(allocator); for (field_data.name_list.values) |name_literal| { var bt_name = try bibtex.ListField.parse_name(name_literal); try names.append(.{ .family = if (bt_name.last) |last| try maybe_copy_string(allocator, copy_strings, last) else null, .given = if (bt_name.first) |first| try maybe_copy_string(allocator, copy_strings, first) else null, .@"non-dropping-particle" = if (bt_name.prefix) |prefix| try maybe_copy_string(allocator, copy_strings, prefix) else null, .suffix = if (bt_name.suffix) |suffix| try maybe_copy_string(allocator, copy_strings, suffix) else null, }); } // builtin that makes union init with a comptime known field/tag name possible return @unionInit(csl.Property, @tagName(active_tag), names.toOwnedSlice()); } fn bib_field_extract_list( allocator: *std.mem.Allocator, comptime active_tag: std.meta.TagType(csl.Property), comptime active_field_tag: bibtex.FieldTypeTT, field_data: bibtex.FieldType, comptime copy_strings: bool, ) !csl.Property { // @field performs a field access base on a comptime-known string var list: []const []const u8 = @field(field_data, @tagName(active_field_tag)).values; // NOTE: this only works since we know that our bibtex parser doesn't re-allocate // the single list items but just creates slices into the bibtex file content var result: []const u8 = &[_]u8 {}; // empty string if (list.len > 0) { const first = list[0]; const last = list[list.len - 1]; result.ptr = first.ptr; result.len = @ptrToInt(last.ptr) - @ptrToInt(result.ptr) + last.len; } if (copy_strings) result = try maybe_copy_string(allocator, true, result); // builtin that makes union init with a comptime known field/tag name possible return @unionInit(csl.Property, @tagName(active_tag), result); } inline fn maybe_copy_string( allocator: *std.mem.Allocator, comptime copy_strings: bool, string: []const u8, ) ![]const u8 { // dupe copies passed in slice to new memory that the caller then owns if (copy_strings) { return try allocator.dupe(u8, string); } else { return string; } }
src/bib_to_csl.zig
const std = @import("std"); const tvg = @import("tvg"); const args = @import("args"); pub fn main() !u8 { var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); defer arena.deinit(); const allocator = &arena.allocator; const cli = args.parseForCurrentProcess(CliOptions, allocator) catch return 1; defer cli.deinit(); const stdin = std.io.getStdIn().reader(); const stdout = std.io.getStdOut().writer(); const stderr = std.io.getStdErr().writer(); if (cli.options.help) { try printUsage(stdout); return 0; } if (cli.positionals.len != 1) { try stderr.writeAll("Expected exactly one positional argument!\n"); try printUsage(stderr); return 1; } const read_stdin = std.mem.eql(u8, cli.positionals[0], "-"); const write_stdout = if (cli.options.output) |o| std.mem.eql(u8, o, "-") else false; if (read_stdin and cli.options.output == null) { try stderr.writeAll("Requires --output file name set when reading from stdin!\n"); try printUsage(stderr); return 1; } var source_file: std.fs.File = if (read_stdin) std.io.getStdIn() else try std.fs.cwd().openFile(cli.positionals[0], .{}); defer if (!read_stdin) source_file.close(); // Parse file header before creating the output file var parser = try tvg.parse(allocator, source_file.reader()); defer parser.deinit(); // Open/create the output file after the TVG header was valid var dest_file: std.fs.File = if (write_stdout) std.io.getStdIn() else blk: { var out_name = cli.options.output orelse try std.mem.concat(allocator, u8, &[_][]const u8{ cli.positionals[0][0..(cli.positionals[0].len - std.fs.path.extension(cli.positionals[0]).len)], ".ppm", }); break :blk try std.fs.cwd().createFile(out_name, .{}); }; defer if (!read_stdin) dest_file.close(); // Start rendering the file output var writer = dest_file.writer(); try writer.writeAll("(tvg\n"); try writer.print(" ({d} {d} {d} {d})\n", .{ parser.header.version, @as(u16, 1) << @enumToInt(parser.header.scale), parser.header.width, parser.header.height, }); try writer.writeAll(" (\n"); for (parser.color_table) |color| { if (color.a != 0xFF) { try writer.print(" ({} {} {} {})\n", .{ color.r, color.g, color.b, color.a, }); } else { try writer.print(" ({} {} {})\n", .{ color.r, color.g, color.b, }); } } try writer.writeAll(" )\n"); try writer.writeAll(" (\n"); while (try parser.next()) |command| { switch (command) { .fill_path => |path| { try writer.writeAll(" (\n fill_path\n "); try renderStyle(writer, path.style); try writer.writeAll("\n ("); for (path.path) |node| { try writer.writeAll("\n "); try renderPathNode(writer, node); } try writer.writeAll("\n )\n )\n"); }, .fill_polygon => |polygon| { try writer.writeAll(" (\n fill_polygon\n "); try renderStyle(writer, polygon.style); try writer.writeAll("\n ("); for (polygon.vertices) |verts| { try writer.print("\n ({d} {d})", .{ verts.x, verts.y, }); } try writer.writeAll("\n )\n )\n"); }, .fill_rectangles => |rects| { try writer.writeAll(" (\n fill_rectangles\n "); try renderStyle(writer, rects.style); try writer.writeAll("\n ("); for (rects.rectangles) |r| { try writer.print("\n ({d} {d} {d} {d})", .{ r.x, r.y, r.width, r.height, }); } try writer.writeAll("\n )\n )\n"); }, .draw_lines => |data| { try writer.writeAll(" (\n draw_lines\n "); try renderStyle(writer, data.style); try writer.print("\n {d}\n (", .{data.line_width}); for (data.lines) |l| { try writer.print("\n (({d} {d}) ({d} {d}))", .{ l.start.x, l.start.y, l.end.x, l.end.y, }); } try writer.writeAll("\n )\n )\n"); }, .draw_line_strip => |data| { try writer.writeAll(" (\n draw_line_strip\n "); try renderStyle(writer, data.style); try writer.print("\n {d}\n (", .{data.line_width}); for (data.vertices) |p| { try writer.print("\n ({d} {d})", .{ p.x, p.y, }); } try writer.writeAll("\n )\n )\n"); }, .draw_line_loop => |data| { try writer.writeAll(" (\n draw_line_loop\n "); try renderStyle(writer, data.style); try writer.print("\n {d}\n (", .{data.line_width}); for (data.vertices) |p| { try writer.print("\n ({d} {d})", .{ p.x, p.y, }); } try writer.writeAll("\n )\n )\n"); }, .draw_line_path => |data| { try writer.writeAll(" (\n draw_line_path\n "); try renderStyle(writer, data.style); try writer.print("\n {d}\n (", .{data.line_width}); for (data.path) |node| { try writer.writeAll("\n "); try renderPathNode(writer, node); } try writer.writeAll("\n )\n )\n"); }, .outline_fill_polygon => |data| { try writer.writeAll(" (\n outline_fill_polygon\n )\n"); }, .outline_fill_rectangles => |data| { try writer.writeAll(" (\n outline_fill_rectangles\n )\n"); }, .outline_fill_path => |data| { try writer.writeAll(" (\n outline_fill_path\n )\n"); }, } } try writer.writeAll(" )\n"); try writer.writeAll(")\n"); return 0; } fn renderPathNode(writer: anytype, node: tvg.parsing.PathNode) !void { switch (node) { .line => |line| try writer.print("(line {d} {d})", .{ line.data.x, line.data.y }), .horiz => |horiz| try writer.print("(horiz {d})", .{horiz.data}), .vert => |vert| try writer.print("(vert {d})", .{vert.data}), .bezier => |bezier| try writer.print("(bezier ({d} {d}) ({d} {d}) ({d} {d}))", .{ bezier.data.c0.x, bezier.data.c0.y, bezier.data.c1.x, bezier.data.c1.y, bezier.data.p1.x, bezier.data.p1.y, }), .arc_circle => |arc_circle| try writer.print("(arc-circle)", .{}), .arc_ellipse => |arc_ellipse| try writer.print("(arc-ellipse)", .{}), .close => try writer.writeAll("(close)"), } } fn renderStyle(writer: anytype, style: tvg.parsing.Style) !void { switch (style) { .flat => |color| try writer.print("(flat {d})", .{color}), .linear, .radial => |grad| { try writer.print("({s} ({d} {d}) ({d} {d}) {d} {d} )", .{ std.meta.tagName(style), grad.point_0.x, grad.point_0.y, grad.point_1.x, grad.point_1.y, grad.color_0, grad.color_1, }); }, } } const CliOptions = struct { help: bool = false, output: ?[]const u8 = null, pub const shorthands = .{ .o = "output", .h = "help", }; }; fn printUsage(stream: anytype) !void { try stream.writeAll( \\tvg-render [-o file] source.tvg \\ ); }
src/tools/text.zig
const exec = @import("exec.zig").exec; const debug = @import("std").debug; const Parser = @import("parse.zig").Parser; const Regex = @import("regex.zig").Regex; const InputBytes = @import("input.zig").InputBytes; const re_debug = @import("debug.zig"); const std = @import("std"); const ArrayList = std.ArrayList; const FixedBufferAllocator = std.heap.FixedBufferAllocator; const mem = std.mem; // vms to test const VmBacktrack = @import("vm_backtrack.zig").VmBacktrack; const VmPike = @import("vm_pike.zig").VmPike; // Debug global allocator is too small for our tests var buffer: [800000]u8 = undefined; var fixed_allocator = FixedBufferAllocator.init(buffer[0..]); fn nullableEql(comptime T: type, a: []const ?T, b: []const ?T) bool { if (a.len != b.len) { return false; } var i: usize = 0; while (i < a.len) : (i += 1) { if (a[i] != null and b[i] != null) { if (a[i].? != b[i].?) { return false; } // ok } else if (a[i] == null and b[i] == null) { // ok } else { return false; } } return true; } fn check(re_input: []const u8, to_match: []const u8, expected: bool) void { var re = Regex.compile(&fixed_allocator.allocator, re_input) catch unreachable; // This is just an engine comparison test but we should also test against fixed vectors var backtrack = VmBacktrack.init(re.allocator); var backtrack_slots = ArrayList(?usize).init(re.allocator); var pike = VmPike.init(re.allocator); var pike_slots = ArrayList(?usize).init(re.allocator); var input1 = InputBytes.init(to_match).input; const pike_result = pike.exec(re.compiled, re.compiled.find_start, &input1, &pike_slots) catch unreachable; var input2 = InputBytes.init(to_match).input; const backtrack_result = backtrack.exec(re.compiled, re.compiled.find_start, &input2, &backtrack_slots) catch unreachable; const slots_equal = nullableEql(usize, pike_slots.items, backtrack_slots.items); // Note: slot entries are invalid on non-match if (pike_result != backtrack_result or (expected == true and !slots_equal)) { debug.warn( \\ \\ -- Failure! ---------------- \\ \\ \\pikevm: {s} \\backtrack: {s} \\ , .{ pike_result, backtrack_result }); debug.warn( \\ \\ -- Slots ------------------- \\ \\pikevm \\ , .{}); for (pike_slots.items) |entry| { debug.warn("{d} ", .{entry}); } debug.warn("\n", .{}); debug.warn( \\ \\ \\backtrack \\ , .{}); for (backtrack_slots.items) |entry| { debug.warn("{d} ", .{entry}); } debug.warn("\n", .{}); debug.warn( \\ \\ -- Regex ------------------ \\ \\Regex: '{s}' \\String: '{s}' \\Expected: {s} \\ , .{ re_input, to_match, expected }); // Dump expression tree and bytecode var p = Parser.init(std.testing.allocator); defer p.deinit(); const expr = p.parse(re_input) catch unreachable; debug.warn( \\ \\ -- Expression Tree ------------ \\ , .{}); re_debug.dumpExpr(expr.*); debug.warn( \\ \\ -- Bytecode ------------------- \\ , .{}); re_debug.dumpProgram(re.compiled); debug.warn( \\ \\ ------------------------------- \\ , .{}); @panic("assertion failure"); } } test "pikevm == backtrackvm" { // Taken from tiny-regex-c check("\\d", "5", true); check("\\w+", "hej", true); check("\\s", "\t \n", true); check("\\S", "\t \n", false); check("[\\s]", "\t \n", true); check("[\\S]", "\t \n", false); check("\\D", "5", false); check("\\W+", "hej", false); check("[0-9]+", "12345", true); check("\\D", "hej", true); check("\\d", "hej", false); check("[^\\w]", "\\", true); check("[\\W]", "\\", true); check("[\\w]", "\\", false); check("[^\\d]", "d", true); check("[\\d]", "d", false); check("[^\\D]", "d", false); check("[\\D]", "d", true); check("^.*\\\\.*$", "c:\\Tools", true); check("^[\\+-]*[\\d]+$", "+27", true); check("[abc]", "1c2", true); check("[abc]", "1C2", false); check("[1-5]+", "0123456789", true); check("[.2]", "1C2", true); check("a*$", "Xaa", true); check("a*$", "Xaa", true); check("[a-h]+", "abcdefghxxx", true); check("[a-h]+", "ABCDEFGH", false); check("[A-H]+", "ABCDEFGH", true); check("[A-H]+", "abcdefgh", false); check("[^\\s]+", "abc def", true); check("[^fc]+", "abc def", true); check("[^d\\sf]+", "abc def", true); check("\n", "abc\ndef", true); //check("b.\\s*\n", "aa\r\nbb\r\ncc\r\n\r\n", true); check(".*c", "abcabc", true); check(".+c", "abcabc", true); check("[b-z].*", "ab", true); check("b[k-z]*", "ab", true); check("[0-9]", " - ", false); check("[^0-9]", " - ", true); check("[Hh]ello [Ww]orld\\s*[!]?", "Hello world !", true); check("[Hh]ello [Ww]orld\\s*[!]?", "hello world !", true); check("[Hh]ello [Ww]orld\\s*[!]?", "Hello World !", true); check("[Hh]ello [Ww]orld\\s*[!]?", "Hello world! ", true); check("[Hh]ello [Ww]orld\\s*[!]?", "Hello world !", true); check("[Hh]ello [Ww]orld\\s*[!]?", "hello World !", true); check("[^\\w][^-1-4]", ")T", true); check("[^\\w][^-1-4]", ")^", true); check("[^\\w][^-1-4]", "*)", true); check("[^\\w][^-1-4]", "!.", true); check("[^\\w][^-1-4]", " x", true); check("[^\\w][^-1-4]", "$b", true); check("a{3,}", "aaa", true); check(".*emacs.*", "emacs-packages.nix", true); }
src/vm_test.zig
const std = @import("std"); const Pkg = std.build.Pkg; const FileSource = std.build.FileSource; pub const build_pkgs = struct { pub const mbedtls = @import(".gyro/zig-mbedtls-mattnite-github.com-a4f5357c/pkg/mbedtls.zig"); pub const libgit2 = @import(".gyro/zig-libgit2-mattnite-github.com-0537beea/pkg/libgit2.zig"); pub const libssh2 = @import(".gyro/zig-libssh2-mattnite-github.com-b5472a81/pkg/libssh2.zig"); pub const zlib = @import(".gyro/zig-zlib-mattnite-github.com-eca7a5ba/pkg/zlib.zig"); pub const libcurl = @import(".gyro/zig-libcurl-mattnite-github.com-f1f316dc/pkg/libcurl.zig"); }; pub const pkgs = struct { pub const version = Pkg{ .name = "version", .source = FileSource{ .path = ".gyro/version-mattnite-github.com-19baf08f/pkg/src/main.zig", }, }; pub const clap = Pkg{ .name = "clap", .source = FileSource{ .path = ".gyro/zig-clap-Hejsil-github.com-7188a9fc/pkg/clap.zig", }, }; pub const glob = Pkg{ .name = "glob", .source = FileSource{ .path = ".gyro/glob-mattnite-github.com-7d17d551/pkg/src/main.zig", }, }; pub const @"known-folders" = Pkg{ .name = "known-folders", .source = FileSource{ .path = ".gyro/known-folders-ziglibs-github.com-9db1b992/pkg/known-folders.zig", }, }; pub const tar = Pkg{ .name = "tar", .source = FileSource{ .path = ".gyro/tar-mattnite-github.com-92141da6/pkg/src/main.zig", }, }; pub const uri = Pkg{ .name = "uri", .source = FileSource{ .path = ".gyro/zig-uri-MasterQ32-github.com-e879df3a/pkg/uri.zig", }, }; pub const zzz = Pkg{ .name = "zzz", .source = FileSource{ .path = ".gyro/zzz-mattnite-github.com-564b924e/pkg/src/main.zig", }, }; pub fn addAllTo(artifact: *std.build.LibExeObjStep) void { artifact.addPackage(pkgs.version); artifact.addPackage(pkgs.clap); artifact.addPackage(pkgs.glob); artifact.addPackage(pkgs.@"known-folders"); artifact.addPackage(pkgs.tar); artifact.addPackage(pkgs.uri); artifact.addPackage(pkgs.zzz); } };
deps.zig
const std = @import("std"); const math = std.math; const assert = std.debug.assert; const L = std.unicode.utf8ToUtf16LeStringLiteral; const Mutex = std.Thread.Mutex; const zwin32 = @import("zwin32"); const w32 = zwin32.base; const d3d12 = zwin32.d3d12; const xaudio2 = zwin32.xaudio2; const xaudio2fx = zwin32.xaudio2fx; const xapo = zwin32.xapo; const hrPanic = zwin32.hrPanic; const hrPanicOnFail = zwin32.hrPanicOnFail; const zd3d12 = @import("zd3d12"); const zxaudio2 = @import("zxaudio2"); const common = @import("common"); const GuiRenderer = common.GuiRenderer; const c = common.c; const zm = @import("zmath"); const zmesh = @import("zmesh"); pub export const D3D12SDKVersion: u32 = 4; pub export const D3D12SDKPath: [*:0]const u8 = ".\\d3d12\\"; const content_dir = @import("build_options").content_dir; const window_name = "zig-gamedev: audio experiments (WIP)"; const window_width = 1920; const window_height = 1080; const Pso_DrawConst = struct { object_to_world: [16]f32, }; const Pso_FrameConst = struct { world_to_clip: [16]f32, }; const Pso_Vertex = struct { position: [3]f32, color: [3]f32, }; const AudioData = struct { mutex: Mutex = .{}, cursor_position: u32 = 99, left: std.ArrayList(f32), right: std.ArrayList(f32), fn init(allocator: std.mem.Allocator) AudioData { const size = 100 * 480; var left = std.ArrayList(f32).initCapacity(allocator, size) catch unreachable; left.resize(size) catch unreachable; for (left.items) |*s| s.* = 0.0; var right = std.ArrayList(f32).initCapacity(allocator, size) catch unreachable; right.resize(size) catch unreachable; for (right.items) |*s| s.* = 0.0; return .{ .left = left, .right = right, }; } fn deinit(audio_data: *AudioData) void { audio_data.left.deinit(); audio_data.right.deinit(); audio_data.* = undefined; } }; const DemoState = struct { gctx: zd3d12.GraphicsContext, actx: zxaudio2.AudioContext, guir: GuiRenderer, frame_stats: common.FrameStats, music: *zxaudio2.Stream, music_is_playing: bool = true, music_has_reverb: bool = false, sound1: zxaudio2.SoundHandle, sound2: zxaudio2.SoundHandle, sound3: zxaudio2.SoundHandle, lines_pso: zd3d12.PipelineHandle, depth_texture: zd3d12.ResourceHandle, depth_texture_dsv: d3d12.CPU_DESCRIPTOR_HANDLE, audio_data: *AudioData, camera: struct { position: [3]f32 = .{ -10.0, 15.0, -10.0 }, forward: [3]f32 = .{ 0.0, 0.0, 1.0 }, pitch: f32 = 0.15 * math.pi, yaw: f32 = 0.25 * math.pi, } = .{}, mouse: struct { cursor_prev_x: i32 = 0, cursor_prev_y: i32 = 0, } = .{}, }; fn processAudio(samples: []f32, num_channels: u32, context: ?*anyopaque) void { const audio_data = @ptrCast(*AudioData, @alignCast(@sizeOf(usize), context)); audio_data.mutex.lock(); defer audio_data.mutex.unlock(); audio_data.cursor_position = (audio_data.cursor_position + 1) % 100; const base_index = 480 * audio_data.cursor_position; var i: u32 = 0; if (num_channels == 0) { // silence, 'samples' may contain invalid data while (i < 480) : (i += 1) { audio_data.left.items[base_index + i] = 0.0; audio_data.right.items[base_index + i] = 0.0; } } else { while (i < 480) : (i += 1) { audio_data.left.items[base_index + i] = samples[i * num_channels]; audio_data.right.items[base_index + i] = samples[i * num_channels + 1]; } } } fn init(allocator: std.mem.Allocator) !DemoState { var actx = zxaudio2.AudioContext.init(allocator); const sound1 = actx.loadSound(L(content_dir ++ "drum_bass_hard.flac")); const sound2 = actx.loadSound(L(content_dir ++ "tabla_tas1.flac")); const sound3 = actx.loadSound(L(content_dir ++ "loop_mika.flac")); var music = zxaudio2.Stream.create( allocator, actx.device, L(content_dir ++ "Broke For Free - Night Owl.mp3"), ); hrPanicOnFail(music.voice.Start(0, xaudio2.COMMIT_NOW)); { var reverb_apo: ?*w32.IUnknown = null; hrPanicOnFail(xaudio2fx.createReverb(&reverb_apo, 0)); defer _ = reverb_apo.?.Release(); var effect_descriptor = [_]xaudio2.EFFECT_DESCRIPTOR{.{ .pEffect = reverb_apo.?, .InitialState = w32.FALSE, .OutputChannels = 2, }}; const effect_chain = xaudio2.EFFECT_CHAIN{ .EffectCount = 1, .pEffectDescriptors = &effect_descriptor, }; hrPanicOnFail(music.voice.SetEffectChain(&effect_chain)); hrPanicOnFail(music.voice.SetEffectParameters( 0, &xaudio2fx.REVERB_PARAMETERS.initDefault(), @sizeOf(xaudio2fx.REVERB_PARAMETERS), xaudio2.COMMIT_NOW, )); } const audio_data = allocator.create(AudioData) catch unreachable; audio_data.* = AudioData.init(allocator); { const p0 = zxaudio2.createSimpleProcessor(&processAudio, audio_data); defer _ = p0.Release(); var effect_descriptor = [_]xaudio2.EFFECT_DESCRIPTOR{.{ .pEffect = p0, .InitialState = w32.TRUE, .OutputChannels = 2, }}; const effect_chain = xaudio2.EFFECT_CHAIN{ .EffectCount = effect_descriptor.len, .pEffectDescriptors = &effect_descriptor, }; hrPanicOnFail(actx.master_voice.SetEffectChain(&effect_chain)); } const window = try common.initWindow(allocator, window_name, window_width, window_height); var arena_allocator_state = std.heap.ArenaAllocator.init(allocator); defer arena_allocator_state.deinit(); const arena_allocator = arena_allocator_state.allocator(); var gctx = zd3d12.GraphicsContext.init(allocator, window); gctx.present_flags = 0; gctx.present_interval = 1; const lines_pso = blk: { const input_layout_desc = [_]d3d12.INPUT_ELEMENT_DESC{ d3d12.INPUT_ELEMENT_DESC.init("POSITION", 0, .R32G32B32_FLOAT, 0, 0, .PER_VERTEX_DATA, 0), d3d12.INPUT_ELEMENT_DESC.init("_Color", 0, .R32G32B32_FLOAT, 0, 12, .PER_VERTEX_DATA, 0), }; var pso_desc = d3d12.GRAPHICS_PIPELINE_STATE_DESC.initDefault(); pso_desc.InputLayout = .{ .pInputElementDescs = &input_layout_desc, .NumElements = input_layout_desc.len, }; pso_desc.RTVFormats[0] = .R8G8B8A8_UNORM; pso_desc.NumRenderTargets = 1; pso_desc.DSVFormat = .D32_FLOAT; pso_desc.BlendState.RenderTarget[0].RenderTargetWriteMask = 0xf; pso_desc.PrimitiveTopologyType = .LINE; break :blk gctx.createGraphicsShaderPipeline( arena_allocator, &pso_desc, content_dir ++ "shaders/lines.vs.cso", content_dir ++ "shaders/lines.ps.cso", ); }; // Create depth texture resource. const depth_texture = gctx.createCommittedResource( .DEFAULT, d3d12.HEAP_FLAG_NONE, &blk: { var desc = d3d12.RESOURCE_DESC.initTex2d(.D32_FLOAT, gctx.viewport_width, gctx.viewport_height, 1); desc.Flags = d3d12.RESOURCE_FLAG_ALLOW_DEPTH_STENCIL | d3d12.RESOURCE_FLAG_DENY_SHADER_RESOURCE; break :blk desc; }, d3d12.RESOURCE_STATE_DEPTH_WRITE, &d3d12.CLEAR_VALUE.initDepthStencil(.D32_FLOAT, 1.0, 0), ) catch |err| hrPanic(err); // Create depth texture view. const depth_texture_dsv = gctx.allocateCpuDescriptors(.DSV, 1); gctx.device.CreateDepthStencilView( gctx.lookupResource(depth_texture).?, null, depth_texture_dsv, ); // // Begin frame to init/upload resources to the GPU. // gctx.beginFrame(); var guir = GuiRenderer.init(arena_allocator, &gctx, 1, content_dir); gctx.endFrame(); gctx.finishGpuCommands(); return DemoState{ .gctx = gctx, .actx = actx, .guir = guir, .music = music, .sound1 = sound1, .sound2 = sound2, .sound3 = sound3, .frame_stats = common.FrameStats.init(), .audio_data = audio_data, .lines_pso = lines_pso, .depth_texture = depth_texture, .depth_texture_dsv = depth_texture_dsv, }; } fn deinit(demo: *DemoState, allocator: std.mem.Allocator) void { demo.gctx.finishGpuCommands(); demo.actx.device.StopEngine(); demo.guir.deinit(&demo.gctx); demo.gctx.deinit(allocator); demo.music.destroy(); demo.audio_data.deinit(); allocator.destroy(demo.audio_data); demo.actx.deinit(); common.deinitWindow(allocator); demo.* = undefined; } fn update(demo: *DemoState) void { demo.frame_stats.update(demo.gctx.window, window_name); const dt = demo.frame_stats.delta_time; common.newImGuiFrame(dt); c.igSetNextWindowPos( c.ImVec2{ .x = @intToFloat(f32, demo.gctx.viewport_width) - 600.0 - 20, .y = 20.0 }, c.ImGuiCond_FirstUseEver, c.ImVec2{ .x = 0.0, .y = 0.0 }, ); c.igSetNextWindowSize(.{ .x = 600.0, .y = -1 }, c.ImGuiCond_Always); _ = c.igBegin( "Demo Settings", null, c.ImGuiWindowFlags_NoMove | c.ImGuiWindowFlags_NoResize | c.ImGuiWindowFlags_NoSavedSettings, ); c.igBulletText("", ""); c.igSameLine(0, -1); c.igTextColored(.{ .x = 0, .y = 0.8, .z = 0, .w = 1 }, "Right Mouse Button + drag", ""); c.igSameLine(0, -1); c.igText(" : rotate camera", ""); c.igBulletText("", ""); c.igSameLine(0, -1); c.igTextColored(.{ .x = 0, .y = 0.8, .z = 0, .w = 1 }, "W, A, S, D", ""); c.igSameLine(0, -1); c.igText(" : move camera", ""); c.igText("Music:", ""); if (c.igButton( if (demo.music_is_playing) " Pause " else " Play ", .{ .x = 0, .y = 0 }, )) { demo.music_is_playing = !demo.music_is_playing; if (demo.music_is_playing) { hrPanicOnFail(demo.music.voice.Start(0, xaudio2.COMMIT_NOW)); } else { hrPanicOnFail(demo.music.voice.Stop(0, xaudio2.COMMIT_NOW)); } } c.igSameLine(0.0, -1.0); if (c.igButton(" Rewind ", .{ .x = 0, .y = 0 })) { demo.music.setCurrentPosition(0); } c.igSameLine(0.0, -1.0); if (c.igButton( if (demo.music_has_reverb) " No Reverb " else " Reverb ", .{ .x = 0, .y = 0 }, )) { demo.music_has_reverb = !demo.music_has_reverb; if (demo.music_has_reverb) { hrPanicOnFail(demo.music.voice.EnableEffect(0, xaudio2.COMMIT_NOW)); } else { hrPanicOnFail(demo.music.voice.DisableEffect(0, xaudio2.COMMIT_NOW)); } } c.igSpacing(); c.igText("Sounds:", ""); if (c.igButton(" Play Sound 1 ", .{ .x = 0, .y = 0 })) { demo.actx.playSound(demo.sound1, .{}); } c.igSameLine(0.0, -1.0); if (c.igButton(" Play Sound 2 ", .{ .x = 0, .y = 0 })) { demo.actx.playSound(demo.sound2, .{}); } c.igSameLine(0.0, -1.0); if (c.igButton(" Play Sound 3 ", .{ .x = 0, .y = 0 })) { demo.actx.playSound(demo.sound3, .{}); } c.igEnd(); // Handle camera rotation with mouse. { var pos: w32.POINT = undefined; _ = w32.GetCursorPos(&pos); const delta_x = @intToFloat(f32, pos.x) - @intToFloat(f32, demo.mouse.cursor_prev_x); const delta_y = @intToFloat(f32, pos.y) - @intToFloat(f32, demo.mouse.cursor_prev_y); demo.mouse.cursor_prev_x = pos.x; demo.mouse.cursor_prev_y = pos.y; if (w32.GetAsyncKeyState(w32.VK_RBUTTON) < 0) { demo.camera.pitch += 0.0025 * delta_y; demo.camera.yaw += 0.0025 * delta_x; demo.camera.pitch = math.min(demo.camera.pitch, 0.48 * math.pi); demo.camera.pitch = math.max(demo.camera.pitch, -0.48 * math.pi); demo.camera.yaw = zm.modAngle(demo.camera.yaw); } } // Handle camera movement with 'WASD' keys. { const speed = zm.f32x4s(10.0); const delta_time = zm.f32x4s(demo.frame_stats.delta_time); const transform = zm.mul(zm.rotationX(demo.camera.pitch), zm.rotationY(demo.camera.yaw)); var forward = zm.normalize3(zm.mul(zm.f32x4(0.0, 0.0, 1.0, 0.0), transform)); zm.store(demo.camera.forward[0..], forward, 3); const right = speed * delta_time * zm.normalize3(zm.cross3(zm.f32x4(0.0, 1.0, 0.0, 0.0), forward)); forward = speed * delta_time * forward; // Load camera position from memory to SIMD register ('3' means that we want to load three components). var cpos = zm.load(demo.camera.position[0..], zm.Vec, 3); if (w32.GetAsyncKeyState('W') < 0) { cpos += forward; } else if (w32.GetAsyncKeyState('S') < 0) { cpos -= forward; } if (w32.GetAsyncKeyState('D') < 0) { cpos += right; } else if (w32.GetAsyncKeyState('A') < 0) { cpos -= right; } // Copy updated position from SIMD register to memory. zm.store(demo.camera.position[0..], cpos, 3); } } fn draw(demo: *DemoState) void { var gctx = &demo.gctx; const cam_world_to_view = zm.lookToLh( zm.load(demo.camera.position[0..], zm.Vec, 3), zm.load(demo.camera.forward[0..], zm.Vec, 3), zm.f32x4(0.0, 1.0, 0.0, 0.0), ); const cam_view_to_clip = zm.perspectiveFovLh( 0.25 * math.pi, @intToFloat(f32, gctx.viewport_width) / @intToFloat(f32, gctx.viewport_height), 0.01, 200.0, ); const cam_world_to_clip = zm.mul(cam_world_to_view, cam_view_to_clip); gctx.beginFrame(); const back_buffer = gctx.getBackBuffer(); gctx.addTransitionBarrier(back_buffer.resource_handle, d3d12.RESOURCE_STATE_RENDER_TARGET); gctx.flushResourceBarriers(); gctx.cmdlist.OMSetRenderTargets( 1, &[_]d3d12.CPU_DESCRIPTOR_HANDLE{back_buffer.descriptor_handle}, w32.TRUE, &demo.depth_texture_dsv, ); gctx.cmdlist.ClearRenderTargetView( back_buffer.descriptor_handle, &[4]f32{ 0.0, 0.0, 0.0, 1.0 }, 0, null, ); gctx.cmdlist.ClearDepthStencilView(demo.depth_texture_dsv, d3d12.CLEAR_FLAG_DEPTH, 1.0, 0, 0, null); gctx.setCurrentPipeline(demo.lines_pso); gctx.cmdlist.IASetPrimitiveTopology(.LINESTRIP); // Upload per-frame constant data (camera xform). { const mem = gctx.allocateUploadMemory(Pso_FrameConst, 1); zm.storeMat(mem.cpu_slice[0].world_to_clip[0..], zm.transpose(cam_world_to_clip)); gctx.cmdlist.SetGraphicsRootConstantBufferView(1, mem.gpu_base); } // Upload per-draw constant data (object to world xform). { const object_to_world = zm.identity(); const mem = gctx.allocateUploadMemory(Pso_DrawConst, 1); zm.storeMat(mem.cpu_slice[0].object_to_world[0..], zm.transpose(object_to_world)); gctx.cmdlist.SetGraphicsRootConstantBufferView(0, mem.gpu_base); } // Upload vertex data and record draw commands. { demo.audio_data.mutex.lock(); defer demo.audio_data.mutex.unlock(); var row: u32 = 0; while (row < 100) : (row += 1) { const num_vertices: u32 = 480; const mem = gctx.allocateUploadMemory(Pso_Vertex, num_vertices); const z = (demo.audio_data.cursor_position + row) % 100; const f = if (row == 0) 1.0 else 0.010101 * @intToFloat(f32, row - 1); var x: u32 = 0; while (x < num_vertices) : (x += 1) { const sample = demo.audio_data.left.items[x + z * num_vertices]; var color: [3]f32 = undefined; zm.store(color[0..], zm.lerp( zm.f32x4(0.2, 1.0, 0.0, 0.0), zm.f32x4(1.0, 0.0, 0.0, 0.0), 1.2 * math.sqrt(f) * math.fabs(sample), ), 3); mem.cpu_slice[x] = Pso_Vertex{ .position = [_]f32{ 0.1 * @intToFloat(f32, x), f * f * f * 10.0 * sample, 0.5 * @intToFloat(f32, z), }, .color = color, }; } gctx.cmdlist.IASetVertexBuffers(0, 1, &[_]d3d12.VERTEX_BUFFER_VIEW{.{ .BufferLocation = mem.gpu_base, .SizeInBytes = num_vertices * @sizeOf(Pso_Vertex), .StrideInBytes = @sizeOf(Pso_Vertex), }}); gctx.cmdlist.DrawInstanced(num_vertices, 1, 0, 0); } } demo.guir.draw(gctx); gctx.addTransitionBarrier(back_buffer.resource_handle, d3d12.RESOURCE_STATE_PRESENT); gctx.flushResourceBarriers(); gctx.endFrame(); } pub fn main() !void { common.init(); defer common.deinit(); var gpa = std.heap.GeneralPurposeAllocator(.{}){}; defer _ = gpa.deinit(); const allocator = gpa.allocator(); var demo = try init(allocator); defer deinit(&demo, allocator); while (common.handleWindowEvents()) { update(&demo); draw(&demo); } }
samples/audio_experiments/src/audio_experiments.zig
const std = @import("std"); const fs = std.fs; const io = std.io; const mem = std.mem; const testing = std.testing; const Archive = @import("archive/Archive.zig"); const test1_dir = "test/data/test1"; const test1_gnu_archive = "output_llvm-ar_gnu.a"; const test1_bsd_archive = "output_llvm-ar_bsd.a"; const test1_names = [_][]const u8{ "input1.txt", "input2.txt" }; const test2_dir = "test/data/test2"; const test2_gnu_archive = "output_llvm-ar_gnu.a"; const test2_bsd_archive = "output_llvm-ar_bsd.a"; const test2_names = [_][]const u8{ "input1.txt", "input2.txt", "input3_that_is_also_a_much_longer_file_name.txt", "input4_that_is_also_a_much_longer_file_name.txt" }; const test4_dir = "test/data/test4"; const test4_gnu_archive = "output_llvm-ar_gnu.a"; const test4_bsd_archive = "output_llvm-ar_bsd.a"; const test4_names = [_][]const u8{"input1.o"}; test "List Files GNU test1" { try testFileContents(test1_dir, test1_gnu_archive, test1_names); } test "List Files BSD test1" { try testFileContents(test1_dir, test1_bsd_archive, test1_names); } test "List Files GNU test2" { try testFileContents(test2_dir, test2_gnu_archive, test2_names); } test "List Files BSD test2" { try testFileContents(test2_dir, test2_bsd_archive, test2_names); } test "List Files GNU test4" { try testFileContents(test4_dir, test4_gnu_archive, test4_names); } test "List Files BSD test4" { try testFileContents(test4_dir, test4_bsd_archive, test4_names); } fn testFileContents(test_dir_path: []const u8, archive_name: []const u8, file_names: anytype) !void { const test_dir = try fs.cwd().openDir(test_dir_path, .{}); const archive_file = try test_dir.openFile(archive_name, .{}); defer archive_file.close(); var arena = std.heap.ArenaAllocator.init(std.testing.allocator); defer arena.deinit(); var allocator = &arena.allocator; // TODO: pass through custom writer so we can check outputs on error tests const stderr = io.getStdErr().writer(); var archive = try Archive.create(archive_file, archive_name, Archive.ArchiveType.ambiguous, .{}); try archive.parse(allocator, stderr); var memory_buffer = try allocator.alloc(u8, 1024 * 1024); for (file_names) |file_name, index| { try testing.expect(mem.eql(u8, archive.files.items[index].name, file_name)); const file = try test_dir.openFile(file_name, .{}); defer file.close(); const reader = file.reader(); var current_start_pos: u64 = 0; while (true) { const num_read = try reader.read(memory_buffer); if (num_read == 0) { break; } try testing.expect(mem.eql(u8, memory_buffer[0..num_read], archive.files.items[index].contents.bytes[current_start_pos .. current_start_pos + num_read])); current_start_pos = current_start_pos + num_read; } } }
src/test.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const odbc = @import("odbc"); const RowStatus = odbc.Types.StatementAttributeValue.RowStatus; const util = @import("util.zig"); const sliceToValue = util.sliceToValue; /// Given a struct, generate a new struct that can be used for ODBC row-wise binding. The conversion goes /// roughly like this; /// ``` /// const Base = struct { /// field1: u32, /// field2: []const u8, /// field3: ?[]const u8 /// }; /// /// // Becomes.... /// /// const FetchResult(Base).RowType = extern struct { /// field1: u32, /// field1_len_or_ind: c_longlong, /// field2: [200]u8, /// field2_len_or_ind: c_longlong, /// field3: [200]u8, /// field3_len_or_ind: c_longlong /// }; /// ``` pub fn FetchResult(comptime Target: type) type { const TypeInfo = std.builtin.TypeInfo; const TargetInfo = @typeInfo(Target); switch (TargetInfo) { .Struct => { const R = extern struct{}; var ResultInfo = @typeInfo(R); var result_fields: [TargetInfo.Struct.fields.len * 2]TypeInfo.StructField = undefined; inline for (TargetInfo.Struct.fields) |field, i| { // Initialize all the fields of the StructField result_fields[i * 2] = field; // Get the target type of the generated struct const field_type_info = @typeInfo(field.field_type); const column_type = if (field_type_info == .Optional) field_type_info.Optional.child else field.field_type; const column_field_type = switch (@typeInfo(column_type)) { .Pointer => |info| switch (info.size) { .Slice => [200]info.child, else => column_type }, .Enum => |info| info.tag_type, else => column_type }; // Reset the field_type and default_value to be whatever was calculated // (default value is reset to null because it has to be a null of the correct type) result_fields[i * 2].field_type = column_field_type; result_fields[i * 2].default_value = null; // Generate the len_or_ind field to coincide with the main column field result_fields[(i * 2) + 1] = TypeInfo.StructField{ .name = field.name ++ "_len_or_ind", .field_type = c_longlong, .default_value = null, .is_comptime = false, .alignment = @alignOf(c_longlong) }; } ResultInfo.Struct.fields = result_fields[0..]; const PrivateRowType = @Type(ResultInfo); return struct { pub const RowType = PrivateRowType; pub fn toTarget(allocator: *Allocator, row: RowType) !Target { var item: Target = undefined; inline for (std.meta.fields(Target)) |field| { @setEvalBranchQuota(1_000_000); const row_data = @field(row, field.name); const len_or_indicator = @field(row, field.name ++ "_len_or_ind"); const field_type_info = @typeInfo(field.field_type); if (len_or_indicator == odbc.sys.SQL_NULL_DATA) { // Handle null data. For Optional types, set the field to null. For non-optional types with // a default value given, set the field to the default value. For all others, return // an error if (field_type_info == .Optional) { @field(item, field.name) = null; } else if (field.default_value) |default| { @field(item, field.name) = default; } else { return error.InvalidNullValue; } } else { // If the field in Base is optional, we just want to deal with its child type. The possibility of // the value being null was handled above, so we can assume it's not here const child_info = if (field_type_info == .Optional) @typeInfo(field_type_info.Optional.child) else field_type_info; @field(item, field.name) = switch (child_info) { .Pointer => |info| switch (info.size) { .Slice => blk: { // For slices, we want to allocate enough memory to hold the (presumably string) data // The string length might be indicated by a null byte, or it might be in len_or_indicator. const slice_length: usize = if (len_or_indicator == odbc.sys.SQL_NTS) std.mem.indexOf(u8, row_data[0..], &.{ 0x00 }) orelse row_data.len else @intCast(usize, len_or_indicator); var data_slice = try allocator.alloc(info.child, slice_length); std.mem.copy(info.child, data_slice, row_data[0..slice_length]); break :blk data_slice; }, // @warn I've never seen this come up so it might not be strictly necessary, also might be broken else => row_data }, // Convert enums back from their backing type to the enum value .Enum => @intToEnum(field.field_type, row_data), // All other data types can go right back else => row_data }; } } return item; } }; }, else => @compileError("The base type of FetchResult must be a struct, found " ++ @typeName(Target)) } } /// `RowBindingResultSet` is the default type of result set. It is used as long as `Base` does not have /// a function named `fromRow` defined on it. /// /// `RowBindingResultSet` creates a result type from `Base` that can be mapped directly to the row-binding /// results produced by the DB. This type includes the same fields as `Base` (their types possibly converted to /// DB-friendly ones), plus indicator fields for each which inidicate the length and/or status of the fetched /// data. fn RowBindingResultSet(comptime Base: type) type { return struct { const Self = @This(); pub const RowType = FetchResult(Base).RowType; rows: []RowType, row_status: []RowStatus, rows_fetched: usize = 0, current_row: usize = 0, is_first: bool = true, allocator: *Allocator, statement: odbc.Statement, /// Initialze the ResultSet with the given `row_count`. `row_count` will control how many results /// are fetched every time `statement.fetch()` is called. pub fn init(allocator: *Allocator, statement: odbc.Statement, row_count: usize) !Self { var result: Self = undefined; result.statement = statement; result.allocator = allocator; result.rows_fetched = 0; result.current_row = 0; result.is_first = true; result.rows = try allocator.alloc(RowType, row_count); result.row_status = try allocator.alloc(RowStatus, row_count); try result.statement.setAttribute(.{ .RowBindType = @sizeOf(RowType) }); try result.statement.setAttribute(.{ .RowArraySize = row_count }); try result.statement.setAttribute(.{ .RowStatusPointer = result.row_status }); try result.bindColumns(); return result; } pub fn deinit(self: *Self) void { self.allocator.free(self.rows); self.allocator.free(self.row_status); } /// Keep fetching until all results have been retrieved. pub fn getAllRows(self: *Self) ![]Base { var results = try std.ArrayList(Base).initCapacity(self.allocator, 20); errdefer results.deinit(); while (try self.next()) |item| { try results.append(item); } return results.toOwnedSlice(); } /// Get the next available row. If all current rows have been read, this will attempt to /// fetch more results with `statement.fetch()`. If `statement.fetch()` returns `error.NoData`, /// this will return `null`. pub fn next(self: *Self) !?Base { if (self.is_first) { try self.statement.setAttribute(.{ .RowsFetchedPointer = &self.rows_fetched }); self.is_first = false; } while (true) { if (self.current_row >= self.rows_fetched) { // BUG: somewhow fetch() was writing into a slice of the ResultSet, // allocated at FetchResult(Base).toTarget. It was solved changing // from GeneralPurposeAllocator to page allocator. // Stacktrace: // [#0] 0x7ffff792d4da → bcoSetScrollFlds() // [#1] 0x7ffff792cd12 → bcoSQLScroll() // [#2] 0x7ffff792bd99 → bcoSQLFetch() // [#3] 0x7ffff7961d04 → SQLFetch() // [#4] 0x7ffff7f6d102 → SQLFetch(statement_handle=0x39f180) // [#5] 0x224e8c → .zdb.odbc.statement.Statement.fetch(self=0x7fffffffd4c8) // [#6] 0x2307a6 → .zdb.result_set.RowBindingResultSet(Playlist).next(self=0x7fffffffd488) // [#7] 0x22ea0f → .zdb.result_set.RowBindingResultSet(Playlist).getAllRows(self=0x7fffffffd488) // [#8] 0x22e08d → sql.query(statement={ // ptr = 0x204e14 <__unnamed_1496> "SELECT * FROM playlists_crea WHERE nick = ?", // len = 0x2b // }, params={ // 0 = { // ptr = 0x2052e4 <__unnamed_1351> "benito69", // len = 0x8 // } // }) // [#9] 0x22d998 → listarPlaylists(nick=<optimized out>) self.statement.fetch() catch |err| switch (err) { error.NoData => return null, else => return err }; self.current_row = 0; } item_loop: while (self.current_row < self.rows_fetched and self.current_row < self.rows.len) : (self.current_row += 1) { switch (self.row_status[self.current_row]) { .Success, .SuccessWithInfo, .Error => { const item_row = self.rows[self.current_row]; self.current_row += 1; return FetchResult(Base).toTarget(self.allocator, item_row) catch |err| switch (err) { error.InvalidNullValue => continue :item_loop, else => return err }; }, else => {} } } } } /// Bind each column of the result set to their associated row buffers. /// After this function is called + `statement.fetch()`, you can retrieve /// result data from this struct. fn bindColumns(self: *Self) !void { @setEvalBranchQuota(1_000_000); comptime var column_number: u16 = 1; inline for (std.meta.fields(RowType)) |field| { comptime if (std.mem.endsWith(u8, field.name, "_len_or_ind")) continue; const c_type = comptime blk: { if (odbc.Types.CType.fromType(field.field_type)) |c_type| { break :blk c_type; } else { @compileError("CType could not be derived for " ++ @typeName(Base) ++ "." ++ field.name ++ " (" ++ @typeName(field.field_type) ++ ")"); } }; const FieldTypeInfo = @typeInfo(field.field_type); const FieldDataType = switch (FieldTypeInfo) { .Pointer => |info| info.child, .Array => |info| info.child, else => field.field_type }; const value_ptr: []FieldDataType = switch (FieldTypeInfo) { .Pointer => switch (FieldTypeInfo.Pointer.size) { .One => @ptrCast([*]FieldDataType, @field(self.rows[0], field.name))[0..1], else => @field(self.rows[0], field.name)[0..] }, .Array => @field(self.rows[0], field.name)[0..], else => @ptrCast([*]FieldDataType, &@field(self.rows[0], field.name))[0..1] }; try self.statement.bindColumn( column_number, c_type, value_ptr, @ptrCast([*]c_longlong, &@field(self.rows[0], field.name ++ "_len_or_ind")), null ); column_number += 1; } } }; } /// `Row` represents a single record for `ColumnBindingResultSet`. pub const Row = struct { const Column = struct { name: []const u8, data: []u8, indicator: c_longlong, }; columns: []Column, fn init(allocator: *Allocator, num_columns: usize) !Row { return Row{ .columns = try allocator.alloc(Column, num_columns), }; } fn deinit(self: *Row, allocator: *Allocator) void { allocator.free(self.columns); } /// Get a value from a column using the column name. Will attempt to convert whatever bytes /// are stored for the column into `ColumnType`. pub fn get(self: *Row, comptime ColumnType: type, allocator: *Allocator, column_name: []const u8) !ColumnType { const column_index = for (self.columns) |column, index| { if (std.mem.eql(u8, column.name, column_name)) break index; } else return error.ColumnNotFound; return try self.getWithIndex(ColumnType, allocator, column_index + 1); } /// Get a value from a column using the column index. Column indices start from 1. Will attempt to /// convert whatever bytes are stored for the column into `ColumnType`. pub fn getWithIndex(self: *Row, comptime ColumnType: type, allocator: *Allocator, column_index: usize) !ColumnType { const target_column = self.columns[column_index - 1]; if (target_column.indicator == odbc.sys.SQL_NULL_DATA) { return switch (@typeInfo(ColumnType)) { .Optional => null, else => error.InvalidNullValue, }; } return switch (@typeInfo(ColumnType)) { .Pointer => |info| switch (info.size) { .Slice => blk: { const slice_length = if (target_column.indicator == odbc.sys.SQL_NTS) std.mem.indexOf(u8, target_column.data, &.{ 0x00 }) orelse target_column.data.len else @intCast(usize, target_column.indicator); if (slice_length > target_column.data.len) { break :blk error.InvalidString; } var return_buffer = try allocator.alloc(u8, slice_length); std.mem.copy(u8, return_buffer, target_column.data[0..slice_length]); break :blk return_buffer; }, else => sliceToValue(ColumnType, target_column.data[0..@intCast(usize, target_column.indicator)]), }, else => sliceToValue(ColumnType, target_column.data[0..@intCast(usize, target_column.indicator)]) }; } }; /// `ColumnBindingResultSet` is used when `Base` has a function defined on it called `fromRow`. It binds generic /// column data structures to each column in the result set, and then `Base.fromRow` defines how to turn each row /// into an instance of `Base`. fn ColumnBindingResultSet(comptime Base: type) type { return struct { const Self = @This(); const Column = struct { name: []const u8, sql_type: odbc.Types.SqlType, data: []u8, octet_length: usize, indicator: []c_longlong, }; columns: []Column, row: Row, row_status: []RowStatus, is_first: bool = true, current_row: usize = 0, row_count: usize = 0, rows_fetched: usize = 0, statement: odbc.Statement, allocator: *Allocator, pub fn init(allocator: *Allocator, statement: odbc.Statement, row_count: usize) !Self { var result: Self = undefined; result.statement = statement; result.allocator = allocator; result.rows_fetched = 0; result.is_first = true; result.row_status = try allocator.alloc(RowStatus, row_count); result.row_count = row_count; try result.statement.setAttribute(.{ .RowBindType = odbc.sys.SQL_BIND_BY_COLUMN }); try result.statement.setAttribute(.{ .RowArraySize = row_count }); try result.statement.setAttribute(.{ .RowStatusPointer = result.row_status }); const num_columns = try result.statement.numResultColumns(); result.columns = try allocator.alloc(Column, num_columns); result.row = try Row.init(allocator, num_columns); for (result.columns) |*column, column_index| { column.sql_type = (try result.statement.getColumnAttribute(allocator, column_index + 1, .Type)).Type; column.name = (try result.statement.getColumnAttribute(allocator, column_index + 1, .BaseColumnName)).BaseColumnName; column.octet_length = @intCast(usize, (try result.statement.getColumnAttribute(allocator, column_index + 1, .OctetLength)).OctetLength); column.data = try allocator.alloc(u8, row_count * column.octet_length); column.indicator = try allocator.alloc(c_longlong, row_count); try result.statement.bindColumn( @intCast(u16, column_index + 1), column.sql_type.defaultCType(), column.data, column.indicator.ptr, column.octet_length ); } return result; } pub fn deinit(self: *Self) void { for (self.columns) |*column| { self.allocator.free(column.name); self.allocator.free(column.data); self.allocator.free(column.indicator); } self.allocator.free(self.columns); self.allocator.free(self.row_status); self.row.deinit(self.allocator); } /// Keep fetching until all of the rows have been retrieved. pub fn getAllRows(self: *Self) ![]Base { var results = try std.ArrayList(Base).initCapacity(self.allocator, 50); errdefer results.deinit(); while (try self.next()) |item| { try results.append(item); } return results.toOwnedSlice(); } pub fn next(self: *Self) !?Base { if (self.is_first) { try self.statement.setAttribute(.{ .RowsFetchedPointer = &self.rows_fetched }); self.is_first = false; } while (true) { if (self.current_row >= self.rows_fetched) { self.statement.fetch() catch |err| switch (err) { error.NoData => return null, else => return err, }; self.current_row = 0; } while (self.current_row < self.rows_fetched and self.current_row < self.row_count) : (self.current_row += 1) { switch (self.row_status[self.current_row]) { .Success, .SuccessWithInfo, .Error => { for (self.row.columns) |*row_column, column_index| { const current_column = self.columns[column_index]; row_column.name = current_column.name; const data_start_index = self.current_row * current_column.octet_length; const data_end_index = data_start_index + current_column.octet_length; row_column.data = current_column.data[data_start_index..data_end_index]; row_column.indicator = current_column.indicator[self.current_row]; } self.current_row += 1; return try Base.fromRow(&self.row, self.allocator); }, else => {}, } } } } }; } pub fn ResultSet(comptime Base: type) type { return if (@hasDecl(Base, "fromRow")) ColumnBindingResultSet(Base) else RowBindingResultSet(Base); }
src/result_set.zig
const c = @import("c.zig"); const std = @import("std"); const zlm = @import("zlm"); const Thread = std.Thread; const Allocator = std.mem.Allocator; pub const ShaderError = error{ ShaderCompileError, InvalidGLContextError }; /// The type used for meshes's elements pub const MeshElementType = c.GLuint; pub const Mesh = struct { // OpenGL related variables hasVao: bool = false, hasEbo: bool = true, vao: c.GLuint = 0, vbo: c.GLuint, ebo: c.GLuint, /// how many elements this Mesh has elements: usize, vertices: usize, pub fn create(vertices: []f32, elements: ?[]c.GLuint) Mesh { var vbo: c.GLuint = 0; c.glGenBuffers(1, &vbo); c.glBindBuffer(c.GL_ARRAY_BUFFER, vbo); c.glBufferData(c.GL_ARRAY_BUFFER, @intCast(c_long, vertices.len * @sizeOf(f32)), vertices.ptr, c.GL_STATIC_DRAW); const stride = 8 * @sizeOf(f32); var vao: c.GLuint = 0; c.glGenVertexArrays(1, &vao); c.glBindVertexArray(vao); c.glVertexAttribPointer(0, 3, c.GL_FLOAT, c.GL_FALSE, stride, 0); c.glVertexAttribPointer(1, 3, c.GL_FLOAT, c.GL_FALSE, stride, 3 * @sizeOf(f32)); c.glVertexAttribPointer(2, 2, c.GL_FLOAT, c.GL_FALSE, stride, 6 * @sizeOf(f32)); c.glEnableVertexAttribArray(0); c.glEnableVertexAttribArray(1); c.glEnableVertexAttribArray(2); var ebo: c.GLuint = 0; var elementsSize: usize = 0; if (elements) |elem| { c.glGenBuffers(1, &ebo); c.glBindBuffer(c.GL_ELEMENT_ARRAY_BUFFER, ebo); c.glBufferData(c.GL_ELEMENT_ARRAY_BUFFER, @intCast(c_long, elem.len * @sizeOf(c.GLuint)), elem.ptr, c.GL_STATIC_DRAW); elementsSize = elem.len; } return Mesh{ .vao = vao, .vbo = vbo, .ebo = ebo, .elements = elementsSize, .vertices = vertices.len, .hasEbo = elements != null, }; } }; /// Color defined to be a 3 component vector /// X value is red, Y value is blue and Z value is green. pub const Color = zlm.Vec3; pub const Material = struct { texturePath: ?[]const u8 = null, ambient: Color = Color.zero, diffuse: Color = Color.one, specular: Color = Color.one, shininess: f32 = 32.0, pub const default = Material{}; }; pub const ShaderProgram = struct { id: c.GLuint, vao: c.GLuint, vertex: c.GLuint, fragment: c.GLuint, pub fn createFromFile(allocator: *Allocator, vertPath: []const u8, fragPath: []const u8) !ShaderProgram { const vertFile = try std.fs.cwd().openFile(vertPath, .{ .read = true }); const vert = try vertFile.reader().readAllAlloc(allocator, std.math.maxInt(u64)); const nullVert = try allocator.dupeZ(u8, vert); // null-terminated string allocator.free(vert); defer allocator.free(nullVert); vertFile.close(); const fragFile = try std.fs.cwd().openFile(fragPath, .{ .read = true }); const frag = try fragFile.reader().readAllAlloc(allocator, std.math.maxInt(u64)); const nullFrag = try allocator.dupeZ(u8, frag); allocator.free(frag); defer allocator.free(nullFrag); fragFile.close(); return try ShaderProgram.create(nullVert, nullFrag); } pub fn create(vert: [:0]const u8, frag: [:0]const u8) ShaderError!ShaderProgram { const vertexShader = c.glCreateShader(c.GL_VERTEX_SHADER); var v = vert; c.glShaderSource(vertexShader, 1, &v, null); c.glCompileShader(vertexShader); try checkError(vertexShader); const fragmentShader = c.glCreateShader(c.GL_FRAGMENT_SHADER); var f = frag; c.glShaderSource(fragmentShader, 1, &f, null); c.glCompileShader(fragmentShader); try checkError(fragmentShader); const shaderProgramId = c.glCreateProgram(); c.glAttachShader(shaderProgramId, vertexShader); c.glAttachShader(shaderProgramId, fragmentShader); c.glBindFragDataLocation(shaderProgramId, 0, "outColor"); c.glLinkProgram(shaderProgramId); c.glUseProgram(shaderProgramId); var vao: c.GLuint = 0; c.glGenVertexArrays(1, &vao); c.glBindVertexArray(vao); const stride = 5 * @sizeOf(f32); const posAttrib = c.glGetAttribLocation(shaderProgramId, "position"); c.glVertexAttribPointer(@bitCast(c.GLuint, posAttrib), 3, c.GL_FLOAT, c.GL_FALSE, stride, 0); c.glEnableVertexAttribArray(@bitCast(c.GLuint, posAttrib)); const texAttrib = c.glGetAttribLocation(shaderProgramId, "texcoord"); c.glVertexAttribPointer(@bitCast(c.GLuint, texAttrib), 2, c.GL_FLOAT, c.GL_FALSE, stride, 3 * @sizeOf(f32)); c.glEnableVertexAttribArray(@bitCast(c.GLuint, texAttrib)); return ShaderProgram{ .id = shaderProgramId, .vao = vao, .vertex = vertexShader, .fragment = fragmentShader, }; } pub inline fn bind(self: *const ShaderProgram) void { c.glUseProgram(self.id); } /// Set an OpenGL uniform to the following 4x4 matrix. pub fn setUniformMat4(self: *const ShaderProgram, name: [:0]const u8, mat: zlm.Mat4) void { var uniform = c.glGetUniformLocation(self.id, name); var m = mat.fields; const columns: [16]f32 = .{ // put the matrix in the order OpenGL wants it to be m[0][0], m[0][1], m[0][2], m[0][3], m[1][0], m[1][1], m[1][2], m[1][3], m[2][0], m[2][1], m[2][2], m[2][3], m[3][0], m[3][1], m[3][2], m[3][3], }; c.glUniformMatrix4fv(uniform, 1, c.GL_FALSE, &columns[0]); } /// Set an OpenGL uniform to the following boolean. pub fn setUniformBool(self: *ShaderProgram, name: [:0]const u8, val: bool) void { var uniform = c.glGetUniformLocation(self.id, name); var v: c.GLint = if (val) 1 else 0; c.glUniform1i(uniform, v); } /// Set an OpenGL uniform to the following float. pub fn setUniformFloat(self: *ShaderProgram, name: [:0]const u8, val: f32) void { var uniform = c.glGetUniformLocation(self.id, name); c.glUniform1f(uniform, val); } /// Set an OpenGL uniform to the following 3D float vector. pub fn setUniformVec3(self: *ShaderProgram, name: [:0]const u8, vec: zlm.Vec3) void { var uniform = c.glGetUniformLocation(self.id, name); c.glUniform3f(uniform, vec.x, vec.y, vec.z); } pub fn checkError(shader: c.GLuint) ShaderError!void { var status: c.GLint = undefined; c.glGetShaderiv(shader, c.GL_COMPILE_STATUS, &status); if (status != c.GL_TRUE) { var buf: [2048]u8 = undefined; var totalLen: c.GLsizei = -1; c.glGetShaderInfoLog(shader, 2048, &totalLen, buf[0..]); if (totalLen == -1) { // the length of the infolog seems to not be set // when a GL context isn't set (so when the window isn't created) return ShaderError.InvalidGLContextError; } var totalSize: usize = @intCast(usize, totalLen); std.log.scoped(.didot).alert("shader compilation errror:\n{}", .{buf[0..totalSize]}); return ShaderError.ShaderCompileError; } } }; const image = @import("didot-image"); const Image = image.Image; pub const CubemapSettings = struct { right: []const u8, left: []const u8, top: []const u8, bottom: []const u8, front: []const u8, back: []const u8 }; pub const Texture = struct { id: c.GLuint, pub fn createEmptyCubemap() Texture { var id: c.GLuint = undefined; c.glGenTextures(1, &id); c.glBindTexture(c.GL_TEXTURE_CUBE_MAP, id); c.glPixelStorei(c.GL_UNPACK_ALIGNMENT, 1); c.glTexParameteri(c.GL_TEXTURE_CUBE_MAP, c.GL_TEXTURE_MIN_FILTER, c.GL_LINEAR); c.glTexParameteri(c.GL_TEXTURE_CUBE_MAP, c.GL_TEXTURE_MAG_FILTER, c.GL_LINEAR); return Texture{ .id = id }; } pub fn createEmpty2D() Texture { var id: c.GLuint = undefined; c.glGenTextures(1, &id); c.glBindTexture(c.GL_TEXTURE_2D, id); c.glPixelStorei(c.GL_UNPACK_ALIGNMENT, 1); c.glTexParameteri(c.GL_TEXTURE_2D, c.GL_TEXTURE_MIN_FILTER, c.GL_LINEAR); c.glTexParameteri(c.GL_TEXTURE_2D, c.GL_TEXTURE_MAG_FILTER, c.GL_LINEAR); return Texture{ .id = id }; } pub inline fn bind(self: *const Texture) void { c.glBindTexture(c.GL_TEXTURE_2D, self.id); } pub fn deinit(self: *const Texture) void { c.glDeleteTextures(1, &self.id); } }; // Image asset loader pub const TextureAssetLoaderData = struct { path: ?[]const u8, cubemap: ?CubemapSettings, format: []const u8, /// Memory is caller owned pub fn init2D(allocator: *Allocator, path: []const u8, format: []const u8) !usize { var data = try allocator.create(TextureAssetLoaderData); data.path = path; data.cubemap = null; data.format = format; return @ptrToInt(data); } /// Memory is caller owned pub fn initCubemap(allocator: *Allocator, cb: CubemapSettings, format: []const u8) !usize { var data = try allocator.create(TextureAssetLoaderData); data.path = null; data.cubemap = cb; data.format = format; return @ptrToInt(data); } }; pub const TextureAssetLoaderError = error{InvalidFormat}; fn textureLoadImage(allocator: *Allocator, path: []const u8, format: []const u8) !Image { if (std.mem.eql(u8, format, "png")) { return try image.png.read(allocator, path); } else if (std.mem.eql(u8, format, "bmp")) { return try image.bmp.read(allocator, path); } else { return TextureAssetLoaderError.InvalidFormat; } } // struct used to pass data between main thread and worker threads const CubemapThreadStruct = struct { allocator: *Allocator, path: []const u8, format: []const u8, image: Image }; fn cubemapThread(data: *CubemapThreadStruct) !void { data.image = try textureLoadImage(data.allocator, data.path, data.format); } pub fn textureAssetLoader(allocator: *Allocator, dataPtr: usize) !usize { var data = @intToPtr(*TextureAssetLoaderData, dataPtr); if (data.cubemap) |cb| { var texture = Texture.createEmptyCubemap(); const targets = [_]c.GLuint { c.GL_TEXTURE_CUBE_MAP_POSITIVE_X, c.GL_TEXTURE_CUBE_MAP_NEGATIVE_X, c.GL_TEXTURE_CUBE_MAP_POSITIVE_Y, c.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, c.GL_TEXTURE_CUBE_MAP_POSITIVE_Z, c.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, }; if (@import("builtin").single_threaded) { comptime var i = 0; inline for (@typeInfo(CubemapSettings).Struct.fields) |field| { const path = @field(cb, field.name); const img = try textureLoadImage(allocator, path, data.format); c.glTexImage2D(targets[i], 0, c.GL_SRGB, @intCast(c_int, img.width), @intCast(c_int, img.height), 0, c.GL_RGB, c.GL_UNSIGNED_BYTE, &img.data[0]); img.deinit(); i += 1; } } else { var structs: [6]CubemapThreadStruct = undefined; var threads: [6]*Thread = undefined; comptime var i = 0; // start loading the textures inline for (@typeInfo(CubemapSettings).Struct.fields) |field| { const path = @field(cb, field.name); structs[i] = .{ .allocator = allocator, .path = path, .format = data.format, .image = undefined }; threads[i] = try Thread.spawn(&structs[i], cubemapThread); i += 1; } // retrieve them var j: usize = 0; while (j < 6) : (j += 1) { threads[j].wait(); const img = structs[j].image; c.glTexImage2D(targets[j], 0, c.GL_SRGB, @intCast(c_int, img.width), @intCast(c_int, img.height), 0, c.GL_RGB, c.GL_UNSIGNED_BYTE, &img.data[0]); img.deinit(); } } var t = try allocator.create(Texture); t.* = texture; return @ptrToInt(t); } else if (data.path) |path| { var texture = Texture.createEmpty2D(); var img = try textureLoadImage(allocator, path, data.format); c.glTexImage2D(c.GL_TEXTURE_2D, 0, c.GL_SRGB, @intCast(c_int, img.width), @intCast(c_int, img.height), 0, c.GL_RGB, c.GL_UNSIGNED_BYTE, &img.data[0]); img.deinit(); var t = try allocator.create(Texture); t.* = texture; return @ptrToInt(t); } else { return TextureAssetLoaderError.InvalidFormat; } } const objects = @import("../didot-objects/objects.zig"); // hacky hack til i found a way for graphics to depend on objects const Scene = objects.Scene; const GameObject = objects.GameObject; const Camera = objects.Camera; const AssetManager = objects.AssetManager; /// Internal method for rendering a game scene. /// This method is here as it uses graphics API-dependent code (it's the rendering part afterall) pub fn renderScene(scene: *Scene, window: Window) !void { const size = window.getFramebufferSize(); c.glViewport(0, 0, @floatToInt(c_int, @floor(size.x)), @floatToInt(c_int, @floor(size.y))); c.glClear(c.GL_COLOR_BUFFER_BIT | c.GL_DEPTH_BUFFER_BIT); c.glEnable(c.GL_DEPTH_TEST); c.glEnable(c.GL_FRAMEBUFFER_SRGB); //c.glEnable(c.GL_CULL_FACE); var assets = &scene.assetManager; if (scene.camera) |camera| { var projMatrix = zlm.Mat4.createPerspective(camera.fov, size.x / size.y, 0.01, 100); camera.shader.setUniformMat4("projMatrix", projMatrix); // create the direction vector to be used with the view matrix. const yaw = camera.gameObject.rotation.x; const pitch = camera.gameObject.rotation.y; const direction = zlm.Vec3.new(std.math.cos(yaw) * std.math.cos(pitch), std.math.sin(pitch), std.math.sin(yaw) * std.math.cos(pitch)); const viewMatrix = zlm.Mat4.createLookAt(camera.gameObject.position, camera.gameObject.position.add(direction), zlm.Vec3.new(0.0, 1.0, 0.0)); if (scene.skybox) |skybox| { if (camera.skyboxShader) |skyboxShader| { skyboxShader.bind(); const view = viewMatrix.toMat3().toMat4(); skyboxShader.setUniformMat4("view", view); skyboxShader.setUniformMat4("projection", projMatrix); try renderSkybox(skybox, assets, camera); } } camera.shader.bind(); camera.shader.setUniformMat4("viewMatrix", viewMatrix); if (scene.pointLight) |light| { camera.shader.setUniformVec3("light.position", light.gameObject.position); camera.shader.setUniformVec3("light.color", light.color); camera.shader.setUniformFloat("light.constant", light.constant); camera.shader.setUniformFloat("light.linear", light.linear); camera.shader.setUniformFloat("light.quadratic", light.quadratic); camera.shader.setUniformBool("useLight", true); } else { camera.shader.setUniformBool("useLight", false); } camera.shader.setUniformVec3("viewPos", camera.gameObject.position); try renderObject(scene.gameObject, assets, camera); } } fn renderSkybox(skybox: *GameObject, assets: *AssetManager, camera: *Camera) !void { if (skybox.meshPath) |meshPath| { var mesh = @intToPtr(*Mesh, (try assets.getExpected(meshPath, .Mesh)).?); c.glDepthMask(c.GL_FALSE); c.glBindVertexArray(mesh.vao); const material = &skybox.material; if (material.texturePath) |path| { const texture = @intToPtr(*Texture, (try assets.getExpected(path, .Texture)).?); c.glBindTexture(c.GL_TEXTURE_CUBE_MAP, texture.id); } if (mesh.hasEbo) { c.glDrawElements(c.GL_TRIANGLES, @intCast(c_int, mesh.elements), c.GL_UNSIGNED_INT, null); } else { c.glDrawArrays(c.GL_TRIANGLES, 0, @intCast(c_int, mesh.vertices)); } c.glDepthMask(c.GL_TRUE); } } fn renderObject(gameObject: GameObject, assets: *AssetManager, camera: *Camera) anyerror!void { if (gameObject.objectType) |custom| { if (std.mem.eql(u8, custom, "skybox")) { return; // don't render skybox here } } if (gameObject.meshPath) |meshPath| { var mesh = @intToPtr(*Mesh, (try assets.getExpected(meshPath, .Mesh)).?); c.glBindVertexArray(mesh.vao); var material = &gameObject.material; if (material.texturePath) |path| { const texture = @intToPtr(*Texture, (try assets.getExpected(path, .Texture)).?); texture.bind(); camera.shader.setUniformBool("useTex", true); } else { camera.shader.setUniformBool("useTex", false); } camera.shader.setUniformVec3("material.ambient", material.ambient); camera.shader.setUniformVec3("material.diffuse", material.diffuse); camera.shader.setUniformVec3("material.specular", material.specular); var s: f32 = material.shininess; if (s <= 1.0) { s = 1.0; } if (s >= 128.0) { s = 128.0; } camera.shader.setUniformFloat("material.shininess", s); var matrix = zlm.Mat4.createScale(gameObject.scale).mul(zlm.Mat4.createTranslation(gameObject.position)); camera.shader.setUniformMat4("modelMatrix", matrix); if (mesh.hasEbo) { c.glDrawElements(c.GL_TRIANGLES, @intCast(c_int, mesh.elements), c.GL_UNSIGNED_INT, null); } else { c.glDrawArrays(c.GL_TRIANGLES, 0, @intCast(c_int, mesh.vertices)); } } var childs = gameObject.childrens.items; for (childs) |child| { try renderObject(child, assets, camera); } } usingnamespace @import("didot-window"); comptime { std.testing.refAllDecls(@This()); std.testing.refAllDecls(ShaderProgram); std.testing.refAllDecls(Texture); }
didot-opengl/graphics.zig
//-------------------------------------------------------------------------------- // Section: Types (13) //-------------------------------------------------------------------------------- pub const DdqAccessLevel = enum(i32) { NoData = 0, CurrentUserData = 1, AllUserData = 2, }; pub const NoData = DdqAccessLevel.NoData; pub const CurrentUserData = DdqAccessLevel.CurrentUserData; pub const AllUserData = DdqAccessLevel.AllUserData; pub const DIAGNOSTIC_DATA_RECORD = extern struct { rowId: i64, timestamp: u64, eventKeywords: u64, fullEventName: ?PWSTR, providerGroupGuid: ?PWSTR, producerName: ?PWSTR, privacyTags: ?*i32, privacyTagCount: u32, categoryIds: ?*i32, categoryIdCount: u32, isCoreData: BOOL, extra1: ?PWSTR, extra2: ?PWSTR, extra3: ?PWSTR, }; pub const DIAGNOSTIC_DATA_SEARCH_CRITERIA = extern struct { producerNames: ?*?PWSTR, producerNameCount: u32, textToMatch: ?[*:0]const u16, categoryIds: ?*const i32, categoryIdCount: u32, privacyTags: ?*const i32, privacyTagCount: u32, coreDataOnly: BOOL, }; pub const DIAGNOSTIC_DATA_EVENT_TAG_DESCRIPTION = extern struct { privacyTag: i32, name: ?PWSTR, description: ?PWSTR, }; pub const DIAGNOSTIC_DATA_EVENT_PRODUCER_DESCRIPTION = extern struct { name: ?PWSTR, }; pub const DIAGNOSTIC_DATA_EVENT_CATEGORY_DESCRIPTION = extern struct { id: i32, name: ?PWSTR, }; pub const DIAGNOSTIC_DATA_EVENT_TAG_STATS = extern struct { privacyTag: i32, eventCount: u32, }; pub const DIAGNOSTIC_DATA_EVENT_BINARY_STATS = extern struct { moduleName: ?PWSTR, friendlyModuleName: ?PWSTR, eventCount: u32, uploadSizeBytes: u64, }; pub const DIAGNOSTIC_DATA_GENERAL_STATS = extern struct { optInLevel: u32, transcriptSizeBytes: u64, oldestEventTimestamp: u64, totalEventCountLast24Hours: u32, averageDailyEvents: f32, }; pub const DIAGNOSTIC_DATA_EVENT_TRANSCRIPT_CONFIGURATION = extern struct { hoursOfHistoryToKeep: u32, maxStoreMegabytes: u32, requestedMaxStoreMegabytes: u32, }; pub const DIAGNOSTIC_REPORT_PARAMETER = extern struct { name: [129]u16, value: [260]u16, }; pub const DIAGNOSTIC_REPORT_SIGNATURE = extern struct { eventName: [65]u16, parameters: [10]DIAGNOSTIC_REPORT_PARAMETER, }; pub const DIAGNOSTIC_REPORT_DATA = extern struct { signature: DIAGNOSTIC_REPORT_SIGNATURE, bucketId: Guid, reportId: Guid, creationTime: FILETIME, sizeInBytes: u64, cabId: ?PWSTR, reportStatus: u32, reportIntegratorId: Guid, fileNames: ?*?PWSTR, fileCount: u32, friendlyEventName: ?PWSTR, applicationName: ?PWSTR, applicationPath: ?PWSTR, description: ?PWSTR, bucketIdString: ?PWSTR, legacyBucketId: u64, reportKey: ?PWSTR, }; //-------------------------------------------------------------------------------- // Section: Functions (35) //-------------------------------------------------------------------------------- // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqCreateSession( accessLevel: DdqAccessLevel, hSession: ?*HDIAGNOSTIC_DATA_QUERY_SESSION, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqCloseSession( hSession: HDIAGNOSTIC_DATA_QUERY_SESSION, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetSessionAccessLevel( hSession: HDIAGNOSTIC_DATA_QUERY_SESSION, accessLevel: ?*DdqAccessLevel, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticDataAccessLevelAllowed( accessLevel: ?*DdqAccessLevel, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticRecordStats( hSession: HDIAGNOSTIC_DATA_QUERY_SESSION, searchCriteria: ?*const DIAGNOSTIC_DATA_SEARCH_CRITERIA, recordCount: ?*u32, minRowId: ?*i64, maxRowId: ?*i64, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticRecordPayload( hSession: HDIAGNOSTIC_DATA_QUERY_SESSION, rowId: i64, payload: ?*?PWSTR, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticRecordLocaleTags( hSession: HDIAGNOSTIC_DATA_QUERY_SESSION, locale: ?[*:0]const u16, hTagDescription: ?*HDIAGNOSTIC_EVENT_TAG_DESCRIPTION, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqFreeDiagnosticRecordLocaleTags( hTagDescription: HDIAGNOSTIC_EVENT_TAG_DESCRIPTION, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticRecordLocaleTagAtIndex( hTagDescription: HDIAGNOSTIC_EVENT_TAG_DESCRIPTION, index: u32, tagDescription: ?*DIAGNOSTIC_DATA_EVENT_TAG_DESCRIPTION, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticRecordLocaleTagCount( hTagDescription: HDIAGNOSTIC_EVENT_TAG_DESCRIPTION, tagDescriptionCount: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticRecordProducers( hSession: HDIAGNOSTIC_DATA_QUERY_SESSION, hProducerDescription: ?*HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqFreeDiagnosticRecordProducers( hProducerDescription: HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticRecordProducerAtIndex( hProducerDescription: HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION, index: u32, producerDescription: ?*DIAGNOSTIC_DATA_EVENT_PRODUCER_DESCRIPTION, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticRecordProducerCount( hProducerDescription: HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION, producerDescriptionCount: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticRecordProducerCategories( hSession: HDIAGNOSTIC_DATA_QUERY_SESSION, producerName: ?[*:0]const u16, hCategoryDescription: ?*HDIAGNOSTIC_EVENT_CATEGORY_DESCRIPTION, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqFreeDiagnosticRecordProducerCategories( hCategoryDescription: HDIAGNOSTIC_EVENT_CATEGORY_DESCRIPTION, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticRecordCategoryAtIndex( hCategoryDescription: HDIAGNOSTIC_EVENT_CATEGORY_DESCRIPTION, index: u32, categoryDescription: ?*DIAGNOSTIC_DATA_EVENT_CATEGORY_DESCRIPTION, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticRecordCategoryCount( hCategoryDescription: HDIAGNOSTIC_EVENT_CATEGORY_DESCRIPTION, categoryDescriptionCount: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqIsDiagnosticRecordSampledIn( hSession: HDIAGNOSTIC_DATA_QUERY_SESSION, providerGroup: ?*const Guid, providerId: ?*const Guid, providerName: ?[*:0]const u16, eventId: ?*const u32, eventName: ?[*:0]const u16, eventVersion: ?*const u32, eventKeywords: ?*const u64, isSampledIn: ?*BOOL, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticRecordPage( hSession: HDIAGNOSTIC_DATA_QUERY_SESSION, searchCriteria: ?*DIAGNOSTIC_DATA_SEARCH_CRITERIA, offset: u32, pageRecordCount: u32, baseRowId: i64, hRecord: ?*HDIAGNOSTIC_RECORD, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqFreeDiagnosticRecordPage( hRecord: HDIAGNOSTIC_RECORD, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticRecordAtIndex( hRecord: HDIAGNOSTIC_RECORD, index: u32, record: ?*DIAGNOSTIC_DATA_RECORD, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticRecordCount( hRecord: HDIAGNOSTIC_RECORD, recordCount: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticReportStoreReportCount( hSession: HDIAGNOSTIC_DATA_QUERY_SESSION, reportStoreType: u32, reportCount: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqCancelDiagnosticRecordOperation( hSession: HDIAGNOSTIC_DATA_QUERY_SESSION, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticReport( hSession: HDIAGNOSTIC_DATA_QUERY_SESSION, reportStoreType: u32, hReport: ?*HDIAGNOSTIC_REPORT, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqFreeDiagnosticReport( hReport: HDIAGNOSTIC_REPORT, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticReportAtIndex( hReport: HDIAGNOSTIC_REPORT, index: u32, report: ?*DIAGNOSTIC_REPORT_DATA, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticReportCount( hReport: HDIAGNOSTIC_REPORT, reportCount: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqExtractDiagnosticReport( hSession: HDIAGNOSTIC_DATA_QUERY_SESSION, reportStoreType: u32, reportKey: ?[*:0]const u16, destinationPath: ?[*:0]const u16, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticRecordTagDistribution( hSession: HDIAGNOSTIC_DATA_QUERY_SESSION, producerNames: [*]?PWSTR, producerNameCount: u32, tagStats: [*]?*DIAGNOSTIC_DATA_EVENT_TAG_STATS, statCount: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticRecordBinaryDistribution( hSession: HDIAGNOSTIC_DATA_QUERY_SESSION, producerNames: [*]?PWSTR, producerNameCount: u32, topNBinaries: u32, binaryStats: [*]?*DIAGNOSTIC_DATA_EVENT_BINARY_STATS, statCount: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetDiagnosticRecordSummary( hSession: HDIAGNOSTIC_DATA_QUERY_SESSION, producerNames: [*]const ?[*:0]const u16, producerNameCount: u32, generalStats: ?*DIAGNOSTIC_DATA_GENERAL_STATS, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqSetTranscriptConfiguration( hSession: HDIAGNOSTIC_DATA_QUERY_SESSION, desiredConfig: ?*const DIAGNOSTIC_DATA_EVENT_TRANSCRIPT_CONFIGURATION, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.19041' pub extern "DiagnosticDataQuery" fn DdqGetTranscriptConfiguration( hSession: HDIAGNOSTIC_DATA_QUERY_SESSION, currentConfig: ?*DIAGNOSTIC_DATA_EVENT_TRANSCRIPT_CONFIGURATION, ) callconv(@import("std").os.windows.WINAPI) HRESULT; //-------------------------------------------------------------------------------- // Section: Unicode Aliases (0) //-------------------------------------------------------------------------------- const thismodule = @This(); pub usingnamespace switch (@import("../zig.zig").unicode_mode) { .ansi => struct { }, .wide => struct { }, .unspecified => if (@import("builtin").is_test) struct { } else struct { }, }; //-------------------------------------------------------------------------------- // Section: Imports (11) //-------------------------------------------------------------------------------- const Guid = @import("../zig.zig").Guid; const BOOL = @import("../foundation.zig").BOOL; const FILETIME = @import("../foundation.zig").FILETIME; const HDIAGNOSTIC_DATA_QUERY_SESSION = @import("../security.zig").HDIAGNOSTIC_DATA_QUERY_SESSION; const HDIAGNOSTIC_EVENT_CATEGORY_DESCRIPTION = @import("../security.zig").HDIAGNOSTIC_EVENT_CATEGORY_DESCRIPTION; const HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION = @import("../security.zig").HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION; const HDIAGNOSTIC_EVENT_TAG_DESCRIPTION = @import("../security.zig").HDIAGNOSTIC_EVENT_TAG_DESCRIPTION; const HDIAGNOSTIC_RECORD = @import("../security.zig").HDIAGNOSTIC_RECORD; const HDIAGNOSTIC_REPORT = @import("../security.zig").HDIAGNOSTIC_REPORT; const HRESULT = @import("../foundation.zig").HRESULT; const PWSTR = @import("../foundation.zig").PWSTR; test { @setEvalBranchQuota( @import("std").meta.declarations(@This()).len * 3 ); // reference all the pub declarations if (!@import("builtin").is_test) return; inline for (@import("std").meta.declarations(@This())) |decl| { if (decl.is_pub) { _ = decl; } } }
win32/security/diagnostic_data_query.zig
const std = @import("std"); const assert = std.debug.assert; const tools = @import("tools"); const Vec2 = tools.Vec2; pub fn run(input_text: []const u8, allocator: *std.mem.Allocator) ![2][]const u8 { var arena = std.heap.ArenaAllocator.init(allocator); defer arena.deinit(); const chunk_sz = 3 * 1024 * 1024; const FileRange = struct { name: []const u8, start: usize, size: usize }; const param: struct { files: []const FileRange, } = blk: { var files = std.ArrayList(FileRange).init(&arena.allocator); var it = std.mem.tokenize(input_text, "\n\r"); while (it.next()) |line| { if (tools.match_pattern_hexa("{}...{} {}", line)) |fields| { // 00000000...00000340 TMStadium.Title.Gbx const start = @intCast(usize, fields[0].imm); const end = @intCast(usize, fields[1].imm); assert(fields[2].lit.len > 0); const name = if (std.mem.eql(u8, fields[2].lit, "--- padding ---")) "" else fields[2].lit; try files.append(FileRange{ .name = name, .start = start, .size = end - start, }); } else { std.debug.print("could not parse '{s}'\n", .{line}); unreachable; } } // std.debug.print("{s}\n", .{input}); break :blk .{ .files = files.items, }; }; const ans1 = ans: { //std.debug.print("------------------------------------\n", .{}); //std.debug.print("------------------------------------\n", .{}); var padded_sz: usize = 0; var base_sz: usize = 0; var padding_used: usize = 0; var padding_nb: usize = 0; var offset: usize = 0; var prev_padding: ?FileRange = null; for (param.files) |file| { var f = file; if (f.name.len == 0) { padding_nb += 1; var rotate_padding = if (prev_padding) |p| (offset - p.start > chunk_sz * 3) else true; if (rotate_padding) { padding_used += 1; const partial_chunk = offset % chunk_sz; const padding = if (partial_chunk == 0) 0 else (chunk_sz - partial_chunk); //std.debug.print("### {s} bytes padding ###\n", .{padding}); f.start = offset; f.size = padding; padded_sz += f.size; assert((f.start + f.size) % chunk_sz == 0); prev_padding = f; } else { f.start = offset; f.size = 0; } base_sz += 0; } else { //std.debug.print("{s}\n", .{f.name}); f.start = offset; padded_sz += f.size; base_sz += f.size; } offset = f.start + f.size; } break :ans std.fmt.allocPrint(&arena.allocator, "{}->{} ({}%) using {}/{} paddings", .{ base_sz, padded_sz, (padded_sz * 100) / base_sz, padding_used, padding_nb }); }; const ans2 = ans: { //std.debug.print("------------------------------------\n", .{}); //std.debug.print("------------------------------------\n", .{}); var padding_points = std.ArrayList(*const FileRange).init(&arena.allocator); var padding_nb: usize = 0; var accu: usize = 0; for (param.files) |_, i| { const it = &param.files[param.files.len - 1 - i]; if (it.name.len == 0) { padding_nb += 1; if (accu > chunk_sz * 3) { try padding_points.append(it); accu = chunk_sz / 2; // on prevoit mettre en moyenne cette taille là.. } } else { accu += it.size; } } var padded_sz: usize = 0; var base_sz: usize = 0; var offset: usize = 0; for (param.files) |*f| { if (f.name.len == 0) { if (std.mem.indexOfScalar(*const FileRange, padding_points.items, f) != null) { const partial_chunk = offset % chunk_sz; const padding = if (partial_chunk == 0) 0 else (chunk_sz - partial_chunk); offset += padding; assert(offset % chunk_sz == 0); // std.debug.print("### {s} bytes padding ###\n", .{padding}); padded_sz += padding; base_sz += 0; } // else skip. } else { // std.debug.print("{s}\n", .{f.name}); offset += f.size; padded_sz += f.size; base_sz += f.size; } } break :ans std.fmt.allocPrint(&arena.allocator, "{}->{} ({}%) using {}/{} paddings", .{ base_sz, padded_sz, (padded_sz * 100) / base_sz, padding_points.items.len, padding_nb }); }; return [_][]const u8{ try std.fmt.allocPrint(allocator, "{s}", .{ans1}), try std.fmt.allocPrint(allocator, "{s}", .{ans2}), }; } pub fn main() anyerror!void { const stdout = std.io.getStdOut().outStream(); var gpa = std.heap.GeneralPurposeAllocator(.{}){}; defer _ = gpa.deinit(); const allocator = &gpa.allocator; const limit = 1 * 1024 * 1024 * 1024; const text = try std.fs.cwd().readFileAlloc(allocator, "2020/input_day16_bonus.txt", limit); defer allocator.free(text); const ans = try run(text, allocator); defer allocator.free(ans[0]); defer allocator.free(ans[1]); try stdout.print("PART 1: {s}\nPART 2: {s}\n", .{ ans[0], ans[1] }); }
2020/day16_bonus.zig
const std = @import("std"); const fmt = std.fmt; const warn = std.debug.warn; const assert = std.debug.assert; const trace = @import("tracy.zig").trace; const traceEx = @import("tracy.zig").traceEx; const traceFrame = @import("tracy.zig").traceFrame; const Viewport = @import("viewport.zig"); const Mandelbrot = @import("mandelbrot.zig"); const Imgui = @import("imgui.zig"); const Complex = Mandelbrot.Complex; const Vector = std.meta.Vector; const SDL = @cImport({ @cDefine("SDL_MAIN_HANDLED", "1"); @cInclude("SDL2/SDL.h"); }); extern fn ImGui_ImplSDL2_ProcessEvent(event: *const SDL.SDL_Event) bool; // work-arounds: //pub const SDL_TOUCH_MOUSEID = Uint32 - 1; -> "error: integer value 1 cannot be coerced to type 'type'"" const zig_SDL_TOUCH_MOUSEID: u32 = 0xFFFFFFFF; // enable thread pool: pub const io_mode = .evented; const show_dev_ui = true; // ============================================ // Input states // ============================================ const Point = struct { x: f32, y: f32, }; const Segment = struct { a: Point, b: Point, }; const MouseState = struct { const ClicPos = struct { pos: Point, }; current: ?ClicPos = null, initial: ClicPos = undefined, }; const TouchState = struct { const FingerPos = struct { pos: Point, finger_id: i64, }; const max_fingers = 4; fingers: u8 = 0, current: [max_fingers]FingerPos = undefined, initial: [max_fingers]FingerPos = undefined, fn addFinger(self: *TouchState, finger_id: i64) *Point { assert(self.fingers < TouchState.max_fingers); for (self.current[0..self.fingers]) |s| { assert(s.finger_id != finger_id); } self.fingers += 1; self.current[self.fingers - 1].finger_id = finger_id; return &self.current[self.fingers - 1].pos; } fn getFinger(self: *TouchState, finger_id: i64) *Point { assert(self.fingers > 0); var idx: ?usize = null; for (self.current[0..self.fingers]) |s, i| { if (s.finger_id == finger_id) idx = i; } return &self.current[idx.?].pos; } fn subFinger(self: *TouchState, finger_id: i64) void { assert(self.fingers > 0); var idx: ?usize = null; for (self.current[0..self.fingers]) |s, i| { if (s.finger_id == finger_id) idx = i; } assert(idx != null); if (self.fingers > 1) self.current[idx.?] = self.current[self.fingers - 1]; self.fingers -= 1; } }; fn pointToMandel(r: Mandelbrot.RectOriented, p: Point) Complex { const axis_re = Complex.mul(r.axis_re, Complex{ .re = @floatCast(f16, p.x), .im = 0 }); const axis_im = Complex.mul(r.axis_im, Complex{ .re = @floatCast(f16, p.y), .im = 0 }); return r.origin.add(axis_re).add(axis_im); } fn normaliseBufferDim(v: u32, max: u32) u32 { const x = if (v > max) max else v; return x - x % 4; } fn tagNameZ(v: anytype, storage: []u8) [:0]const u8 { const name = @tagName(v); std.mem.copy(u8, storage, name); storage[name.len] = 0; return storage[0..name.len :0]; } pub fn main() !void { if (false) { Mandelbrot.drawSetAscii(Mandelbrot.RectOriented{ .origin = Complex{ .re = -2, .im = -1 }, .axis_re = Complex{ .re = 3, .im = 0 }, .axis_im = Complex{ .re = 0, .im = 2 }, }); return; } const allocator = std.heap.c_allocator; var viewport = try Viewport.init("Mandelbrot set explorer", 1280, 720, allocator); defer Viewport.destroy(viewport); const mandel_max_width = 1920; const mandel_max_height = 1080; const mandel_levels = try allocator.alloc(Mandelbrot.Fixed, (mandel_max_height * mandel_max_width)); defer allocator.free(mandel_levels); var mandel_levels_width: u32 = undefined; var mandel_levels_height: u32 = undefined; const mandel_pixels = try allocator.alloc(Vector(4, u32), (mandel_max_height * mandel_max_width / 4)); defer allocator.free(mandel_pixels); var mandel_pixels_width: u32 = 32; var mandel_pixels_height: u32 = 32; std.mem.set(Vector(4, u32), mandel_pixels[0..(mandel_pixels_height * mandel_pixels_width / 4)], [_]u32{ 0, 200, 0, 0 }); // Settings: const QualityParams = struct { supersamples: c_int, max_iter: c_int, resolution_divider: c_int, precision_bits: c_int, // 32, 64, 128 label: [:0]const u8, }; var quality_normal = QualityParams{ .supersamples = 3, .max_iter = 25000, .resolution_divider = 1, .precision_bits = 64, .label = "normal" }; var quality_preview = QualityParams{ .supersamples = 1, .max_iter = 25000, .resolution_divider = 4, .precision_bits = 32, .label = "preview" }; var continuous_refresh = true; // State: const MandelComputeState = struct { // currently processing status: Mandelbrot.AsyncComputeStatus = .idle, interrupt: bool = false, callframe: @Frame(Mandelbrot.computeLevels) = undefined, // next request dirty: enum { changed, previewed, done } = .changed, mandelrect: Mandelbrot.RectOriented = Mandelbrot.RectOriented{ .origin = Complex{ .re = -2, .im = -1 }, .axis_re = Complex{ .re = 3, .im = 0 }, .axis_im = Complex{ .re = 0, .im = 2 }, }, changed_timestamp_ms: u64 = 0, previewed_timestamp_ms: u64 = 0, done_timestamp_ms: u64 = 0, }; var mandel_compute_state = MandelComputeState{}; var mouse_state = MouseState{}; var touch_state = TouchState{}; var touch_initial_mandelrect: Mandelbrot.RectOriented = undefined; var quit = false; while (!quit) { const tracy_frame = traceFrame(null); defer tracy_frame.end(); // screen size: var screen_width: u32 = undefined; var screen_height: u32 = undefined; Viewport.getWindowSize(viewport, &screen_width, &screen_height); // inputs { const tracy_inputs = traceEx(@src(), .{ .name = "inputs" }); defer tracy_inputs.end(); const imgui_io = Imgui.GetIO(); const AffineTransfo = struct { // y = a0 + a1*x a0: Complex, a1: Complex, }; var transfo: ?AffineTransfo = null; var transfo_ref_mandelrect: Mandelbrot.RectOriented = mandel_compute_state.mandelrect; var event: SDL.SDL_Event = undefined; while (SDL.SDL_PollEvent(&event) != 0) { _ = ImGui_ImplSDL2_ProcessEvent(&event); if (event.type == SDL.SDL_QUIT) quit = true; if (!imgui_io.WantCaptureMouse) { var ref_segment: ?Segment = null; var target_segment: ?Segment = null; if (event.type == SDL.SDL_MOUSEWHEEL and event.wheel.which != zig_SDL_TOUCH_MOUSEID and event.wheel.y != 0) { ref_segment = Segment{ .a = Point{ .x = 0.5, .y = 0.5 }, .b = Point{ .x = 1, .y = 0.5 } }; target_segment = ref_segment; if (event.wheel.y > 0) { target_segment.?.b.x *= 1.333; } else { target_segment.?.b.x /= 1.333; } } if (event.type == SDL.SDL_MOUSEBUTTONDOWN and event.button.which != zig_SDL_TOUCH_MOUSEID) { if (event.button.button == SDL.SDL_BUTTON_RIGHT) { const click_pos = Point{ .x = @intToFloat(f32, event.button.x) / @intToFloat(f32, screen_width), .y = @intToFloat(f32, event.button.y) / @intToFloat(f32, screen_height) }; const target_pos = Point{ .x = 0.5, .y = 0.5 }; ref_segment = Segment{ .a = click_pos, .b = Point{ .x = click_pos.x + 1, .y = click_pos.y } }; target_segment = Segment{ .a = target_pos, .b = Point{ .x = target_pos.x + 1, .y = target_pos.y } }; } if (event.button.button == SDL.SDL_BUTTON_LEFT) { const click_pos = Point{ .x = @intToFloat(f32, event.button.x) / @intToFloat(f32, screen_width), .y = @intToFloat(f32, event.button.y) / @intToFloat(f32, screen_height) }; mouse_state.current = MouseState.ClicPos{ .pos = click_pos }; mouse_state.initial = mouse_state.current.?; } } if (event.type == SDL.SDL_MOUSEBUTTONUP and event.button.which != zig_SDL_TOUCH_MOUSEID and event.button.button == SDL.SDL_BUTTON_LEFT) { const click_pos = Point{ .x = @intToFloat(f32, event.button.x) / @intToFloat(f32, screen_width), .y = @intToFloat(f32, event.button.y) / @intToFloat(f32, screen_height) }; mouse_state.current = MouseState.ClicPos{ .pos = click_pos }; const a = mouse_state.initial.pos; const b = mouse_state.current.?.pos; ref_segment = Segment{ .a = Point{ .x = (a.x + b.x) / 2.0, .y = (a.y + b.y) / 2.0 }, .b = Point{ .x = std.math.max(a.x, b.x), .y = (a.y + b.y) / 2.0 } }; target_segment = Segment{ .a = Point{ .x = 0.5, .y = 0.5 }, .b = Point{ .x = 1, .y = 0.5 } }; mouse_state.current = null; } if (event.type == SDL.SDL_MOUSEMOTION and event.motion.which != zig_SDL_TOUCH_MOUSEID and (event.motion.state & (1 << (SDL.SDL_BUTTON_LEFT - 1)) != 0)) { const click_pos = Point{ .x = @intToFloat(f32, event.motion.x) / @intToFloat(f32, screen_width), .y = @intToFloat(f32, event.motion.y) / @intToFloat(f32, screen_height) }; mouse_state.current = MouseState.ClicPos{ .pos = click_pos }; } if (event.type == SDL.SDL_FINGERMOTION or event.type == SDL.SDL_FINGERDOWN or event.type == SDL.SDL_FINGERUP) { if (event.type == SDL.SDL_FINGERDOWN) { touch_state.addFinger(event.tfinger.fingerId).* = Point{ .x = event.tfinger.x, .y = event.tfinger.y }; touch_state.initial = touch_state.current; touch_initial_mandelrect = mandel_compute_state.mandelrect; } if (event.type == SDL.SDL_FINGERUP) { touch_state.subFinger(event.tfinger.fingerId); touch_state.initial = touch_state.current; touch_initial_mandelrect = mandel_compute_state.mandelrect; } if (event.type == SDL.SDL_FINGERMOTION) { touch_state.getFinger(event.tfinger.fingerId).* = Point{ .x = event.tfinger.x, .y = event.tfinger.y }; } if (touch_state.fingers >= 2) { ref_segment = Segment{ .a = touch_state.initial[touch_state.fingers - 2].pos, .b = touch_state.initial[touch_state.fingers - 1].pos, }; target_segment = Segment{ .a = touch_state.current[touch_state.fingers - 2].pos, .b = touch_state.current[touch_state.fingers - 1].pos, }; transfo_ref_mandelrect = touch_initial_mandelrect; } } if (target_segment) |tgt| { const ref = ref_segment.?; const ref_a = pointToMandel(transfo_ref_mandelrect, ref.a); const ref_b = pointToMandel(transfo_ref_mandelrect, ref.b); const tgt_a = pointToMandel(transfo_ref_mandelrect, tgt.a); const tgt_b = pointToMandel(transfo_ref_mandelrect, tgt.b); const a1 = Complex.div(Complex.sub(ref_a, ref_b), Complex.sub(tgt_a, tgt_b)); const a0 = Complex.sub(ref_a, Complex.mul(tgt_a, a1)); transfo = AffineTransfo{ .a0 = a0, .a1 = a1, }; } } if (transfo) |t| { mandel_compute_state.mandelrect.origin = Complex.add(Complex.mul(transfo_ref_mandelrect.origin, t.a1), t.a0); mandel_compute_state.mandelrect.axis_re = Complex.mul(transfo_ref_mandelrect.axis_re, t.a1); mandel_compute_state.mandelrect.axis_im = Complex.mul(transfo_ref_mandelrect.axis_im, t.a1); mandel_compute_state.dirty = .changed; } } } Viewport.beginFrame(viewport); if (show_dev_ui) { const tracy_imgui = traceEx(@src(), .{ .name = "imgui" }); defer tracy_imgui.end(); _ = Imgui.Begin("Parameters"); defer Imgui.End(); _ = Imgui.Checkbox("continuous refresh", &continuous_refresh); for ([_]*QualityParams{ &quality_preview, &quality_normal }) |it| { if (Imgui.CollapsingHeaderExt(it.label, .{ .DefaultOpen = true })) { Imgui.PushIDStr(it.label); defer Imgui.PopID(); const value_changed1 = Imgui.SliderInt("max iterations", &it.max_iter, 1, 50000); const value_changed2 = Imgui.SliderInt("antialias", &it.supersamples, 1, 5); const value_changed3 = Imgui.SliderInt("coarseness", &it.resolution_divider, 1, 8); const value_changed4 = Imgui.InputIntExt("precison bits (16,32,64,128)", &it.precision_bits, 32, 1, .{}); if ((value_changed1 or value_changed2 or value_changed3 or value_changed4) and mandel_compute_state.dirty == .done) { mandel_compute_state.dirty = .previewed; } } } { var storage: [100]u8 = undefined; Imgui.Text(tagNameZ(mandel_compute_state.status, &storage)); } if (mandel_compute_state.status == .idle and (mandel_compute_state.done_timestamp_ms > mandel_compute_state.previewed_timestamp_ms) and (mandel_compute_state.previewed_timestamp_ms > mandel_compute_state.changed_timestamp_ms)) { const preview_dur: f64 = @intToFloat(f64, mandel_compute_state.previewed_timestamp_ms - mandel_compute_state.changed_timestamp_ms) / 1000; const final_dur: f64 = @intToFloat(f64, mandel_compute_state.done_timestamp_ms - mandel_compute_state.previewed_timestamp_ms) / 1000; Imgui.Text("Latest computation: %.3fs (preview: %.3fs)", final_dur, preview_dur); } else { Imgui.Text("Latest computation: ..."); } const imgui_io = Imgui.GetIO(); Imgui.Text("Application average %.3f ms/frame (%.1f FPS)", @floatCast(f64, 1000.0 / imgui_io.Framerate), @floatCast(f64, imgui_io.Framerate)); } // mandelbrot computer state switch (mandel_compute_state.status) { .idle => { // start a new computation if parameters dirty const tracy_compute = traceEx(@src(), .{ .name = "idle" }); defer tracy_compute.end(); switch (mandel_compute_state.dirty) { .changed => { mandel_compute_state.changed_timestamp_ms = @intCast(u64, std.time.milliTimestamp()); const d = @intCast(u32, quality_preview.resolution_divider); mandel_levels_width = normaliseBufferDim(screen_width / d, mandel_max_width); mandel_levels_height = normaliseBufferDim(screen_height / d, mandel_max_height); mandel_compute_state.interrupt = false; mandel_compute_state.callframe = async Mandelbrot.computeLevels(mandel_levels, mandel_levels_width, mandel_levels_height, mandel_compute_state.mandelrect, @intCast(u16, quality_preview.max_iter), @intCast(u32, quality_preview.supersamples), @intCast(u32, quality_preview.precision_bits), &mandel_compute_state.status, &mandel_compute_state.interrupt); mandel_compute_state.dirty = .previewed; }, .previewed => { mandel_compute_state.previewed_timestamp_ms = @intCast(u64, std.time.milliTimestamp()); const d = @intCast(u32, quality_normal.resolution_divider); const w = normaliseBufferDim(screen_width / d, mandel_max_width); const h = normaliseBufferDim(screen_height / d, mandel_max_height); if (continuous_refresh and (h != mandel_levels_height or w != mandel_levels_width)) Mandelbrot.rescaleLevels(mandel_levels, mandel_levels_width, mandel_levels_height, w, h); mandel_levels_width = w; mandel_levels_height = h; mandel_compute_state.interrupt = false; mandel_compute_state.callframe = async Mandelbrot.computeLevels(mandel_levels, mandel_levels_width, mandel_levels_height, mandel_compute_state.mandelrect, @intCast(u16, quality_normal.max_iter), @intCast(u32, quality_normal.supersamples), @intCast(u32, quality_normal.precision_bits), &mandel_compute_state.status, &mandel_compute_state.interrupt); mandel_compute_state.dirty = .done; }, .done => {}, } }, .computing => { const tracy_compute = traceEx(@src(), .{ .name = "computing" }); defer tracy_compute.end(); if (mandel_compute_state.dirty == .changed) mandel_compute_state.interrupt = true; if (continuous_refresh) { mandel_pixels_width = mandel_levels_width; mandel_pixels_height = mandel_levels_height; Mandelbrot.computeColors(mandel_levels, mandel_pixels, mandel_pixels_width, mandel_pixels_height); } }, .done => { // finish the asynccall, present the result and get ready to make a new one. const tracy_compute = traceEx(@src(), .{ .name = "compute_done" }); defer tracy_compute.end(); await mandel_compute_state.callframe; mandel_compute_state.status = .idle; if (!mandel_compute_state.interrupt or true) { mandel_pixels_width = mandel_levels_width; mandel_pixels_height = mandel_levels_height; Mandelbrot.computeColors(mandel_levels, mandel_pixels, mandel_pixels_width, mandel_pixels_height); } mandel_compute_state.done_timestamp_ms = @intCast(u64, std.time.milliTimestamp()); }, } // viewport update { const tracy_viewport = traceEx(@src(), .{ .name = "viewport" }); defer tracy_viewport.end(); const w = @intToFloat(f32, screen_width); const h = @intToFloat(f32, screen_height); { const corners = [4]Viewport.Vec2{ Viewport.Vec2{ .x = 0, .y = 0 }, Viewport.Vec2{ .x = w, .y = 0 }, Viewport.Vec2{ .x = w, .y = h }, Viewport.Vec2{ .x = 0, .y = h }, }; try Viewport.blitPixels(viewport, corners, std.mem.sliceAsBytes(mandel_pixels), mandel_pixels_width, mandel_pixels_height); } if (show_dev_ui) { var drawList = Imgui.GetForegroundDrawList().?; for (touch_state.current[0..touch_state.fingers]) |s| { Imgui.DrawList.AddCircleExt(drawList, Imgui.Vec2{ .x = s.pos.x * w, .y = s.pos.y * h }, 40, 0xFFFF0000, 8, 3); } for (touch_state.initial[0..touch_state.fingers]) |s| { Imgui.DrawList.AddCircleExt(drawList, Imgui.Vec2{ .x = s.pos.x * w, .y = s.pos.y * h }, 30, 0xFFAA8833, 8, 3); } if (mouse_state.current) |s| { Imgui.DrawList.AddRectExt(drawList, Imgui.Vec2{ .x = mouse_state.initial.pos.x * w, .y = mouse_state.initial.pos.y * h }, Imgui.Vec2{ .x = s.pos.x * w, .y = s.pos.y * h }, 0xFFAA8833, 0, .{}, 3); } } } try Viewport.endFrame(viewport); } if (mandel_compute_state.status == .computing) { mandel_compute_state.interrupt = true; await mandel_compute_state.callframe; } }
src/main.zig
// Style guide is violated here so that @tagName can be used effectively /// https://datatracker.ietf.org/doc/html/rfc7231#section-4 Initial definiton /// https://datatracker.ietf.org/doc/html/rfc5789#section-2 PATCH pub const Method = enum { GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH, /// Returns true if a request of this method is allowed to have a body /// Actual behavior from servers may vary and should still be checked pub fn requestHasBody(self: Method) bool { return switch (self) { .POST, .PUT, .PATCH => true, .GET, .HEAD, .DELETE, .CONNECT, .OPTIONS, .TRACE => false, }; } /// Returns true if a response to this method is allowed to have a body /// Actual behavior from clients may vary and should still be checked pub fn responseHasBody(self: Method) bool { return switch (self) { .GET, .POST, .DELETE, .CONNECT, .OPTIONS, .PATCH => true, .HEAD, .PUT, .TRACE => false, }; } /// An HTTP method is safe if it doesn't alter the state of the server. /// https://developer.mozilla.org/en-US/docs/Glossary/Safe/HTTP /// https://datatracker.ietf.org/doc/html/rfc7231#section-4.2.1 pub fn safe(self: Method) bool { return switch (self) { .GET, .HEAD, .OPTIONS, .TRACE => true, .POST, .PUT, .DELETE, .CONNECT, .PATCH => false, }; } /// An HTTP method is idempotent if an identical request can be made once or several times in a row with the same effect while leaving the server in the same state. /// https://developer.mozilla.org/en-US/docs/Glossary/Idempotent /// https://datatracker.ietf.org/doc/html/rfc7231#section-4.2.2 pub fn idempotent(self: Method) bool { return switch (self) { .GET, .HEAD, .PUT, .DELETE, .OPTIONS, .TRACE => true, .CONNECT, .POST, .PATCH => false, }; } /// A cacheable response is an HTTP response that can be cached, that is stored to be retrieved and used later, saving a new request to the server. /// https://developer.mozilla.org/en-US/docs/Glossary/cacheable /// https://datatracker.ietf.org/doc/html/rfc7231#section-4.2.3 pub fn cacheable(self: Method) bool { return switch (self) { .GET, .HEAD => true, .POST, .PUT, .DELETE, .CONNECT, .OPTIONS, .TRACE, .PATCH => false, }; } };
lib/std/http/method.zig
const std = @import("std"); const imr = @import("imr.zig"); const Allocator = std.mem.Allocator; const eqlIgnoreCase = std.ascii.eqlIgnoreCase; pub const TagList = std.ArrayList(Tag); pub const AttributeMap = std.StringHashMap([]const u8); pub const Tag = struct { name: []const u8, text: ?[:0]const u8, childrens: TagList, attributes: AttributeMap, parent: ?*Tag, pub fn deinit(self: *Tag) void { if (!std.mem.eql(u8, self.name, "#text")) { for (self.childrens.items) |*child| { child.deinit(); } self.childrens.deinit(); } else { // TODO: free text and the tag itself } } }; pub const Document = struct { tags: TagList, pub fn deinit(self: *Document) void { for (self.tags.items) |*tag| { tag.deinit(); } self.tags.deinit(); } }; const voidElements = [_][]const u8 { "area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr" }; fn to_imr_tag(allocator: *Allocator, tag: Tag, parent: ?*imr.Tag) anyerror!imr.Tag { if (tag.text) |text| { std.log.info("parsed text {s}", .{text}); return imr.Tag { .allocator = allocator, .elementType = "#text", .parent = parent, .data = .{ .text = text } }; } else { var self = imr.Tag { .allocator = allocator, .elementType = tag.name, .parent = parent, .data = .{ .container = imr.TagList.init(allocator) } }; for (tag.childrens.items) |child| { try self.data.container.append(try to_imr_tag(allocator, child, &self)); } return self; } } /// Convert an HTML document to an IMR document. /// Memory is caller owned. The HTML document is left untouched and is not freed. pub fn to_imr(allocator: *Allocator, document: Document) !imr.Document { var result: imr.Document = .{ .tags = imr.TagList.init(allocator) }; for (document.tags.items) |child| { try result.tags.append(try to_imr_tag(allocator, child, null)); } return result; } /// Parses `text` into an IMR document. /// Note that this method returns tags that depend on slices created from text. /// This means you cannot free text unless done with document. /// Memory is caller owned. pub fn parse_imr(allocator: *Allocator, text: []const u8) !imr.Document { var html = try parse(allocator, text); const doc = try to_imr(allocator, html); html.deinit(); return doc; } /// Parses `text` into an HTML document. /// Note that this method returns tags that depend on slices created from text. /// This means you cannot free text unless done with document. /// Memory is caller owned. pub fn parse(allocator: *Allocator, text: []const u8) !Document { var i: usize = 0; var startTag: bool = false; var endTag: bool = false; var inComment: bool = false; var rootChildrens: TagList = TagList.init(allocator); var currentTag: ?*Tag = null; var parseAttrName: bool = false; var parseAttrValue: bool = false; var tagNameStart: usize = 0; var tagNameEnd: usize = 0; var attrNameStart: usize = 0; var attrNameEnd: usize = 0; var attrValueStart: usize = 0; var textStart: usize = 0; while (i < text.len) { const ch = text[i]; if (inComment) { const behind = text[(i-3)..i]; if (std.mem.eql(u8, behind, "-->")) { inComment = false; } } else if (i > 3) { const behind = text[(i-4)..i]; if (std.mem.eql(u8, behind, "<!--")) { startTag = false; inComment = true; } } if (!startTag and !endTag) { if (ch == '<') { if (textStart != 0) { var tag = try allocator.create(Tag); tag.name = "#text"; tag.text = try allocator.dupeZ(u8, text[textStart..i]); std.debug.warn("text: {s} current tag is null ? {}\n", .{tag.text.?, currentTag == null}); tag.parent = currentTag; textStart = 0; if (currentTag != null) try currentTag.?.childrens.append(tag.*); } startTag = true; tagNameStart = i+1; tagNameEnd = 0; } } else { if (parseAttrName and ch == '=') { parseAttrName = false; parseAttrValue = true; attrNameEnd = i; attrValueStart = i+1; } if (std.ascii.isSpace(ch)) { if (tagNameEnd == 0) tagNameEnd = i; if (parseAttrName and currentTag != null) { try currentTag.?.attributes.put(text[attrNameStart..i], ""); } parseAttrName = true; attrNameStart = i+1; } if (i > 0 and ch == '/' and text[i-1] == '<') { startTag = false; endTag = true; tagNameStart = i+1; tagNameEnd = 0; } if (ch == '>') { if (tagNameEnd == 0) { tagNameEnd = i; } parseAttrName = false; parseAttrValue = false; textStart = i+1; const tagName = text[tagNameStart..tagNameEnd]; std.debug.warn("tag name: {s}, {}\n", .{tagName, startTag}); if (startTag) { startTag = false; if (eqlIgnoreCase(tagName, "!DOCTYPE")) { continue; } var oldTag = currentTag; var tag = try allocator.create(Tag); tag.name = tagName; tag.childrens = TagList.init(allocator); tag.attributes = AttributeMap.init(allocator); tag.parent = oldTag; for (voidElements) |elem| { if (eqlIgnoreCase(tagName, elem)) { endTag = true; // also an end tag } } currentTag = tag; } if (endTag) { endTag = false; var parent = currentTag.?.parent; if (parent != null) { try parent.?.childrens.append(currentTag.?.*); } else { try rootChildrens.append(currentTag.?.*); } currentTag = parent; } } } i += 1; } return Document { .tags = rootChildrens }; }
zervo/markups/html.zig
const std = @import("std"); const print = std.debug.print; const Map = std.AutoHashMap; const util = @import("util.zig"); const gpa = util.gpa; const data = @embedFile("../data/day05.txt"); const Point = struct { x: i32, y: i32, }; fn update(map: *Map(Point, usize), p: Point) !void { if (map.get(p)) |count| { try map.put(p, count + 1); } else { try map.put(p, 1); } } fn interpolate(map: *Map(Point, usize), a: []const u8, b: []const u8, diag: bool) !void { var first = try util.parseInto(Point, a, ","); var second = try util.parseInto(Point, b, ","); if (first.x == second.x) { var y = first.y; var dir: i32 = if (first.y < second.y) 1 else -1; while (y != second.y) : (y += dir) { try update(map, Point{ .x = first.x, .y = y }); } try update(map, second); } else if (first.y == second.y) { var x = first.x; var dir: i32 = if (first.x < second.x) 1 else -1; while (x != second.x) : (x += dir) { try update(map, Point{ .x = x, .y = first.y }); } try update(map, second); } else if (diag) { var x = first.x; var y = first.y; var dirx: i32 = if (first.x < second.x) 1 else -1; var diry: i32 = if (first.y < second.y) 1 else -1; while (x != second.x and y != second.y) { try update(map, Point{ .x = x, .y = y }); x += dirx; y += diry; } try update(map, second); } } pub fn main() !void { var lines = try util.toStrSlice(data, "\n"); { // no diagonals var counts = Map(Point, usize).init(gpa); for (lines) |line| { var d = try util.toStrSlice(line, " -> "); try interpolate(&counts, d[0], d[1], false); } var it = counts.iterator(); var total: usize = 0; while (it.next()) |num| { if (num.value_ptr.* > 1) total += 1; } print("{}\n", .{total}); } { // now consider diagonals var counts = Map(Point, usize).init(gpa); for (lines) |line| { var d = try util.toStrSlice(line, " -> "); try interpolate(&counts, d[0], d[1], true); } var it = counts.iterator(); var total: usize = 0; while (it.next()) |num| { if (num.value_ptr.* > 1) total += 1; } print("{}\n", .{total}); } }
2021/src/day05.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const testing = std.testing; const assert = std.debug.assert; const FixedBufferAllocator = std.heap.FixedBufferAllocator; /// Generic k-ary tree represented as a "left-child right-sibling" binary tree. pub fn Tree(comptime T: type) type { return struct { const Self = @This(); root: Node, /// Node inside the tree. pub const Node = struct { value: T, parent: ?*Node, leftmost_child: ?*Node, right_sibling: ?*Node, fn init(value: T) Node { return Node{ .value = value, .parent = null, .leftmost_child = null, .right_sibling = null, }; } }; /// Initialize a tree. /// /// Arguments: /// value: Value (aka weight, key, etc.) of the root node. /// /// Returns: /// A tree containing one node with specified value. pub fn init(value: T) Self { return Self{ .root = Node.init(value), }; } /// Allocate a new node. Caller owns returned Node and must free with `destroyNode`. /// /// Arguments: /// allocator: Dynamic memory allocator. /// /// Returns: /// A pointer to the new node. /// /// Errors: /// If a new node cannot be allocated. pub fn allocateNode(tree: *Self, allocator: *Allocator) !*Node { return allocator.create(Node); } /// Deallocate a node. Node must have been allocated with `allocator`. /// /// Arguments: /// node: Pointer to the node to deallocate. /// allocator: Dynamic memory allocator. pub fn destroyNode(tree: *Self, node: *Node, allocator: *Allocator) void { assert(tree.containsNode(node)); allocator.destroy(node); } /// Allocate and initialize a node and its value. /// /// Arguments: /// value: Value (aka weight, key, etc.) of newly created node. /// allocator: Dynamic memory allocator. /// /// Returns: /// A pointer to the new node. /// /// Errors: /// If a new node cannot be allocated. pub fn createNode(tree: *Self, value: T, allocator: *Allocator) !*Node { var node = try tree.allocateNode(allocator); node.* = Node.init(value); return node; } /// Insert a node at the specified position inside the tree. /// /// Arguments: /// node: Pointer to the node to insert. /// parent: Pointer to node which the newly created node will be a child of. /// /// Returns: /// A pointer to the new node. pub fn insert(tree: *Self, node: *Node, parent: *Node) void { node.parent = parent; node.right_sibling = parent.leftmost_child; parent.leftmost_child = node; } /// Add another tree at the specified position inside this tree. /// /// Arguments: /// other: Pointer to the tree to insert. /// parent: Pointer to node which the newly created node will be a parent of. pub fn graft(tree: *Self, other: *Self, parent: *Node) void {} /// Remove (detach) a "branch" from the tree (remove node and all its descendants). /// Does nothing when applied to root node. /// /// Arguments: /// node: Pointer to node to be removed. pub fn prune(tree: *Self, node: *Node) void { assert(tree.containsNode(node)); if (node.parent) |parent| { var ptr = &parent.leftmost_child; while (ptr.*) |sibling| : (ptr = &sibling.right_sibling) { if (sibling == node) { ptr.* = node.right_sibling; break; } } node.right_sibling = null; node.parent = null; } } /// Remove a node preserving all its children, which take its place inside the tree. /// Does nothing when applied to root node. /// /// Arguments: /// node: Pointer to node to be removed. pub fn remove(tree: *Self, node: *Node) void { assert(tree.containsNode(node)); if (node.parent) |parent| { var ptr = &parent.leftmost_child; while (ptr.*) |sibling| : (ptr = &sibling.right_sibling) { if (sibling == node) break; } ptr.* = node.leftmost_child; while (ptr.*) |old_child| : (ptr = &old_child.right_sibling) { old_child.parent = parent; } ptr.* = node.right_sibling; node.parent = null; node.leftmost_child = null; node.right_sibling = null; } } /// Iterator that performs a depth-first post-order traversal of the tree. /// It is non-recursive and uses constant memory (no allocator needed). pub const DepthFirstIterator = struct { const State = enum { GoDeeper, GoBroader, }; tree: *Self, current: ?*Node, state: State, // NB: // If not children_done: // Go as deep as possible // Yield node // If can move right: // children_done = false; // Move right // Else: // children_done = true; // Move up pub fn init(tree: *Self) DepthFirstIterator { return DepthFirstIterator{ .tree = tree, .current = &tree.root, .state = State.GoDeeper, }; } pub fn next(it: *DepthFirstIterator) ?*Node { // State machine while (it.current) |current| { switch (it.state) { State.GoDeeper => { // Follow child node until deepest possible level if (current.leftmost_child) |child| { it.current = child; } else { it.state = State.GoBroader; return current; } }, State.GoBroader => { if (current.right_sibling) |sibling| { it.current = sibling; it.state = State.GoDeeper; } else { it.current = current.parent; return current.parent; } }, } } return null; } pub fn reset(it: *DepthFirstIterator) void { it.current = it.tree.root; } }; /// Get a depth-first iterator over the nodes of this tree. /// /// Returns: /// An iterator struct (one containing `next` and `reset` member functions). pub fn depthFirstIterator(tree: *Self) DepthFirstIterator { return DepthFirstIterator.init(tree); } /// Check if a node is contained in this tree. /// /// Arguments: /// target: Pointer to node to be searched for. /// /// Returns: /// A bool telling whether it has been found. pub fn containsNode(tree: *Self, target: *Node) bool { var iter = tree.depthFirstIterator(); while (iter.next()) |node| { if (node == target) { return true; } } return false; } }; } test "tree node insertion" { var tree = Tree(u32).init(1); const allocator = std.debug.global_allocator; //var buffer: [5000]u8 = undefined; // const allocator = &FixedBufferAllocator.init(buffer[0..]).allocator; var two = try tree.createNode(2, allocator); var three = try tree.createNode(3, allocator); var four = try tree.createNode(4, allocator); var five = try tree.createNode(5, allocator); var six = try tree.createNode(6, allocator); var fortytwo = try tree.createNode(42, allocator); defer { tree.destroyNode(two, allocator); tree.destroyNode(three, allocator); tree.destroyNode(four, allocator); tree.destroyNode(five, allocator); tree.destroyNode(six, allocator); allocator.destroy(fortytwo); } tree.insert(two, &tree.root); tree.insert(three, &tree.root); tree.insert(four, &tree.root); tree.insert(five, two); tree.insert(six, two); testing.expect(tree.root.value == 1); testing.expect(two.parent == &tree.root); testing.expect(three.parent == &tree.root); testing.expect(tree.containsNode(four)); testing.expect(five.parent == two); testing.expect(!tree.containsNode(fortytwo)); var iter = tree.depthFirstIterator(); while (iter.next()) |node| { std.debug.warn("{} ", node.value); } } test "tree node removal" { var tree = Tree(u32).init(1); const allocator = std.debug.global_allocator; var two = try tree.createNode(2, allocator); var three = try tree.createNode(3, allocator); var four = try tree.createNode(4, allocator); var five = try tree.createNode(5, allocator); var six = try tree.createNode(6, allocator); defer { tree.destroyNode(three, allocator); tree.destroyNode(four, allocator); allocator.destroy(two); allocator.destroy(five); allocator.destroy(six); } tree.insert(two, &tree.root); tree.insert(three, &tree.root); tree.insert(four, &tree.root); tree.insert(five, two); tree.insert(six, two); tree.prune(two); testing.expect(tree.containsNode(three)); testing.expect(tree.containsNode(four)); testing.expect(!tree.containsNode(two)); testing.expect(!tree.containsNode(five)); testing.expect(!tree.containsNode(six)); var iter = tree.depthFirstIterator(); while (iter.next()) |node| { std.debug.warn("{} ", node.value); } }
tree.zig
const common = @import("common.zig"); /// The document open notification is sent from the client /// to the server to signal newly opened text documents. /// The document’s content is now managed by the client and /// the server must not try to read the document’s content /// using the document’s Uri. Open in this sense means it /// is managed by the client. It doesn’t necessarily mean /// that its content is presented in an editor. An open /// notification must not be sent more than once without a /// corresponding close notification send before. This means /// open and close notification must be balanced and the /// max open count for a particular textDocument is one. /// /// Note that a server’s ability to fulfill requests is independent of whether a text document is open or closed. /// /// [Docs](https://microsoft.github.io/language-server-protocol/specifications/specification-3-16/#textDocument_didOpen) pub const DidOpenTextDocumentParams = struct { pub const method = "textDocument/didOpen"; pub const kind = common.PacketKind.notification; textDocument: common.TextDocumentItem, }; /// An event describing a change to a text document. If range and rangeLength are /// omitted the new text is considered to be the full content of the document. /// /// [Docs](https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#textDocumentContentChangeEvent) pub const TextDocumentContentChangeEvent = union(enum) { partial: struct { /// The range of the document that changed. range: common.Range, /// he new text for the provided range. text: []const u8, }, full: struct { /// The new text of the whole document. text: []const u8, }, }; /// The document change notification is sent from the client to the server to signal changes to a text document. /// Before a client can change a text document it must claim ownership of its content using the textDocument/didOpen notification. /// In 2.0 the shape of the params has changed to include proper version numbers. /// /// [Docs](https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#didChangeTextDocumentParams) pub const DidChangeTextDocumentParams = struct { pub const method = "textDocument/didChange"; pub const kind = common.PacketKind.notification; /// The document that did change. The version number points /// to the version after all provided content changes have /// been applied. textDocument: common.VersionedTextDocumentIdentifier, contentChanges: []TextDocumentContentChangeEvent, };
src/types/text_sync.zig
const midi = @import("../midi.zig"); const std = @import("std"); const debug = std.debug; const io = std.io; const math = std.math; const mem = std.mem; const encode = @This(); pub fn message(writer: anytype, last_message: ?midi.Message, msg: midi.Message) !void { if (msg.channel() == null or last_message == null or msg.status != last_message.?.status) { try writer.writeByte((1 << 7) | @as(u8, msg.status)); } switch (msg.kind()) { .ExclusiveStart, .TuneRequest, .ExclusiveEnd, .TimingClock, .Start, .Continue, .Stop, .ActiveSensing, .Reset, .Undefined, => {}, .ProgramChange, .ChannelPressure, .MidiTimeCodeQuarterFrame, .SongSelect, => { try writer.writeByte(msg.values[0]); }, .NoteOff, .NoteOn, .PolyphonicKeyPressure, .ControlChange, .PitchBendChange, .SongPositionPointer, => { try writer.writeByte(msg.values[0]); try writer.writeByte(msg.values[1]); }, } } pub fn chunkToBytes(_chunk: midi.file.Chunk) [8]u8 { var res: [8]u8 = undefined; mem.copy(u8, res[0..4], &_chunk.kind); mem.writeIntBig(u32, res[4..8], _chunk.len); return res; } pub fn fileHeaderToBytes(header: midi.file.Header) [14]u8 { var res: [14]u8 = undefined; mem.copy(u8, res[0..8], &chunkToBytes(header.chunk)); mem.writeIntBig(u16, res[8..10], header.format); mem.writeIntBig(u16, res[10..12], header.tracks); mem.writeIntBig(u16, res[12..14], header.division); return res; } pub fn int(writer: anytype, i: u28) !void { var tmp = i; var is_first = true; var buf: [4]u8 = undefined; var fbs = io.fixedBufferStream(&buf).writer(); // TODO: Can we find a way to not encode this in reverse order and then flipping the bytes? while (tmp != 0 or is_first) : (is_first = false) { fbs.writeByte(@truncate(u7, tmp) | (@as(u8, 1 << 7) * @boolToInt(!is_first))) catch unreachable; tmp >>= 7; } mem.reverse(u8, fbs.context.getWritten()); try writer.writeAll(fbs.context.getWritten()); } pub fn metaEvent(writer: anytype, event: midi.file.MetaEvent) !void { try writer.writeByte(event.kind_byte); try int(writer, event.len); } pub fn trackEvent(writer: anytype, last_event: ?midi.file.TrackEvent, event: midi.file.TrackEvent) !void { const last_midi_event = if (last_event) |e| switch (e.kind) { .MidiEvent => |m| m, .MetaEvent => null, } else null; try int(writer, event.delta_time); switch (event.kind) { .MetaEvent => |meta| { try writer.writeByte(0xFF); try metaEvent(writer, meta); }, .MidiEvent => |msg| try message(writer, last_midi_event, msg), } } pub fn file(writer: anytype, f: midi.File) !void { try writer.writeAll(&encode.fileHeaderToBytes(.{ .chunk = .{ .kind = midi.file.Chunk.file_header.*, .len = @intCast(u32, midi.file.Header.size + f.header_data.len), }, .format = f.format, .tracks = @intCast(u16, f.chunks.len), .division = f.division, })); try writer.writeAll(f.header_data); for (f.chunks) |c| { try writer.writeAll(&encode.chunkToBytes(.{ .kind = c.kind, .len = @intCast(u32, c.bytes.len), })); try writer.writeAll(c.bytes); } }
midi/encode.zig
const std = @import("std"); const linux = std.os.linux; const os = std.os; const renderer = @import("renderer.zig"); const Object = @import("client.zig").Object; const Context = @import("client.zig").Context; const Client = @import("client.zig").Client; const ShmPool = @import("shm_pool.zig").ShmPool; const buffer = @import("buffer.zig"); const Buffer = buffer.Buffer; pub fn newShmBuffer(client: *Client, id: u32, wl_shm_pool: Object, offset: i32, width: i32, height: i32, stride: i32, format: u32) !*Buffer { const shm_buffer = ShmBuffer{ .client = client, .shm_pool = @intToPtr(*ShmPool, wl_shm_pool.container), .offset = offset, .width = width, .height = height, .stride = stride, .format = format, .wl_buffer_id = id, }; var buf = try buffer.newBuffer(client); buf.* = Buffer{ .Shm = shm_buffer }; @intToPtr(*ShmPool, wl_shm_pool.container).incrementRefCount(); return buf; } pub const ShmBuffer = struct { client: *Client, wl_buffer_id: u32, shm_pool: *ShmPool, offset: i32, width: i32, height: i32, stride: i32, format: u32, const Self = @This(); pub fn deinit(self: *Self) void {} pub fn beginAccess(self: *Self) void { CURRENT_POOL_ADDRESS = self.shm_pool.data.ptr; CURRENT_POOL_SIZE = self.shm_pool.data.len; _ = linux.sigaction(linux.SIGBUS, &sigbus_handler_action, null); } pub fn endAccess(self: *Self) !void { defer { SIGBUS_ERROR = false; _ = linux.sigaction(linux.SIGBUS, &sigbus_handler_reset, null); } if (SIGBUS_ERROR) { return error.ClientSigbusd; } } pub fn makeTexture(self: *Self) !u32 { var offset = @intCast(usize, self.offset); return renderer.makeTexture(self.width, self.height, self.stride, self.format, self.shm_pool.data[offset..]); } }; var SIGBUS_ERROR = false; var CURRENT_POOL_ADDRESS: [*]align(4096) u8 = undefined; var CURRENT_POOL_SIZE: usize = 0; const sigbus_handler_action = os.Sigaction{ .handler = .{ .sigaction = sigbusHandler }, .mask = linux.empty_sigset, .flags = linux.SA_RESETHAND, }; const sigbus_handler_reset = os.Sigaction{ .handler = .{ .sigaction = null }, .mask = linux.empty_sigset, .flags = linux.SA_RESETHAND, }; // libwayland uses a cool trick of mmap'ing some new data underneath (i.e. at the // same address as) the SHM buffer, essentially throwing away the SHM'ness of the // memory and guaranteeing that when the code is retried that SIGBUS will not be // raised. // See: https://github.com/wayland-project/wayland/blob/11623e8fddb924c7ae317f2eabac23785ae5e8d5/src/wayland-shm.c#L514 fn sigbusHandler(sig: i32, info: *const os.siginfo_t, data: ?*const c_void) callconv(.C) void { SIGBUS_ERROR = true; _ = linux.mmap(CURRENT_POOL_ADDRESS, CURRENT_POOL_SIZE, linux.PROT_READ | linux.PROT_WRITE, linux.MAP_FIXED | linux.MAP_PRIVATE | linux.MAP_ANONYMOUS, -1, 0); }
src/shm_buffer.zig
const std = @import("std"); const print = std.debug.print; usingnamespace @import("chunk.zig"); usingnamespace @import("heap.zig"); pub const ArrayListOfValue = std.ArrayList(Value); pub const Value = union(enum) { boolean: bool, number: f64, nil, obj: *Obj, }; pub const ObjType = enum { str, fun, closure, upvalue, }; pub const Obj = struct { objType: ObjType, isMarked: bool, next: ?*Obj, }; pub const ArrayListOfObjUpvalue = std.ArrayList(*ObjUpvalue); pub const ObjClosure = struct { obj: Obj, fun: *ObjFunction, upvalues: ArrayListOfObjUpvalue, }; pub const ObjFunction = struct { obj: Obj, arity: usize, chunk: *Chunk, name: ?*ObjString, upvalueCount: u8, }; pub const ObjUpvalue = struct { obj: Obj, closed: Value, location: *Value, next: ?*ObjUpvalue, }; pub const ObjString = struct { obj: Obj, chars: []u8, }; pub fn number2Value(value: f64) Value { return Value{ .number = value }; } pub fn nil2Value() Value { return Value.nil; } pub fn bool2Value(boolean: bool) Value { return Value{ .boolean = boolean }; } pub fn obj2Value(obj: *Obj) Value { return Value{ .obj = obj }; } pub fn objString2Value(str: *ObjString) Value { return Value{ .obj = @ptrCast(*Obj, str) }; } pub fn objFunction2Value(fun: *ObjFunction) Value { return Value{ .obj = @ptrCast(*Obj, fun) }; } pub fn objClosure2Value(closure: *ObjClosure) Value { return Value{ .obj = @ptrCast(*Obj, closure) }; } pub fn objUpvalue2Value(upvalue: *ObjUpvalue) Value { return Value{ .obj = @ptrCast(*Obj, upvalue) }; } pub fn asBool(value: Value) bool { return switch (value) { .boolean => |boolean| boolean, else => unreachable, }; } pub fn asNumber(value: Value) f64 { return switch (value) { .number => |number| number, else => unreachable, }; } pub fn asObj(value: Value) *Obj { return switch (value) { .obj => |obj| obj, else => unreachable, }; } pub fn asString(value: Value) *ObjString { return @ptrCast(*ObjString, asObj(value)); } pub fn asFunction(value: Value) *ObjFunction { return @ptrCast(*ObjFunction, asObj(value)); } pub fn asClosure(value: Value) *ObjClosure { return @ptrCast(*ObjClosure, asObj(value)); } pub fn asUpvalue(value: Value) *ObjUpvalue { return @ptrCast(*ObjUpvalue, asObj(value)); } pub fn isBool(value: Value) bool { return switch (value) { .boolean => true, else => false, }; } pub fn isNil(value: Value) bool { return switch (value) { .nil => true, else => false, }; } pub fn isNumber(value: Value) bool { return switch (value) { .number => true, else => false, }; } pub fn isUpvalue(value: Value) bool { return switch (value) { .obj => |obj| { return switch (obj.objType) { .upvalue => true, else => false, }; }, else => false, }; } pub fn isString(value: Value) bool { return switch (value) { .obj => |obj| { return switch (obj.objType) { .str => true, else => false, }; }, else => false, }; } pub fn isFun(value: Value) bool { return switch (value) { .obj => |obj| { return switch (obj.objType) { .str => true, else => false, }; }, else => false, }; } pub fn isClosure(value: Value) bool { return switch (value) { .obj => |obj| { return switch (obj.objType) { .closure => true, else => false, }; }, else => false, }; } pub fn isObj(value: Value) bool { return switch (value) { .obj => true, else => false, }; } // 仅 nil 和 false 是 falsey pub fn isFalsey(value: Value) bool { return isNil(value) or (isBool(value) and !asBool(value)); } pub fn valuesEqual(a: Value, b: Value) bool { return switch (a) { .nil => if (isNil(b)) true else false, .boolean => if (isBool(b)) asBool(a) == asBool(b) else false, .number => if (isNumber(b)) asNumber(a) == asNumber(b) else false, .obj => |obj| { print("{} {}", .{ @ptrToInt(asObj(a)), @ptrToInt(asObj(b)) }); return @ptrToInt(asObj(a)) == @ptrToInt(asObj(b)); }, }; }
zvm/src/value.zig
const assert = @import("std").debug.assert; const main = @import("main.zig"); const utils = @import("utils.zig"); const w4 = main.w4; const ptrs = main.ptrs; const info = main.info; const ObjId = main.ObjId; const Team = main.Team; const max_health = main.max_health; const team_cnt = main.team_cnt; const unity_cap = main.unity_cap; pub fn create(id: info.Unity_Id, team: Team, x: u8, y: u8) ObjId { const num = blk: { const freed_cnt = ptrs.freed_cnt[team]; if ( freed_cnt > 0 ) { const num = ptrs.freed_list[team][freed_cnt - 1]; ptrs.freed_cnt[team] = freed_cnt - 1; break :blk num + team * @as(ObjId, unity_cap); } else { const num = ptrs.next_obj[team]; ptrs.next_obj[team] += 1; break :blk num + team * @as(ObjId, unity_cap); } }; ptrs.obj_id[num] = id; ptrs.obj_info[num] = .{ .acted = true, .health = max_health, .team = team, .fuel = id.max_fuel(), .transporting = null, }; ptrs.obj_map[y][x] = num; ptrs.obj_pos[0][num] = x; ptrs.obj_pos[1][num] = y; return num; } pub fn delete(num: ObjId) void { const x = ptrs.obj_pos[0][num]; const y = ptrs.obj_pos[1][num]; ptrs.obj_map[y][x] = null; // free memory const team = num / unity_cap; const freed_cnt = ptrs.freed_cnt[team]; const list = &ptrs.freed_list[team]; const next_obj = ptrs.next_obj[team]; if ( num == next_obj - 1 ) { var unfreed: u7 = 0; var i: u7 = 0; while ( list[i] == next_obj - 1 - unfreed and i < freed_cnt ) : ( i += 1 ) { unfreed += 1; } if ( unfreed > 0 ) { while ( i < freed_cnt ) : ( i += 1 ) { list[i - unfreed] = list[i]; } ptrs.freed_cnt[team] -= unfreed; } ptrs.next_obj[team] -= (unfreed + 1); } else { var n = num; var i: u7 = 0; while ( i < freed_cnt ) : ( i += 1 ) { if ( list[i] < n ) { const tmp = list[i]; list[i] = n; n = tmp; } else if ( list[i] == n ) { w4.trace("obj.delete: double delete detected!"); unreachable; } } list[i] = n; ptrs.freed_cnt[team] = freed_cnt + 1; } if ( ptrs.next_obj[team] == team * unity_cap ) { var i: u2 = team_cnt; for ( ptrs.next_obj ) |army_cnt| { if ( army_cnt == 0 ) i -= 1; } if ( i == 1 ) { ptrs.game_state.* = switch ( team ) { 0 => .army0, 1 => .army1, else => .army0, }; } } } pub fn moveTo(num: ObjId, x: u8, y: u8) void { const oldx = ptrs.obj_pos[0][num]; const oldy = ptrs.obj_pos[1][num]; assert(ptrs.obj_map[y][x] == null or ptrs.obj_map[y][x].? == num); ptrs.obj_map[oldy][oldx] = null; ptrs.obj_map[y][x] = num; ptrs.obj_pos[0][num] = x; ptrs.obj_pos[1][num] = y; } pub fn supply(num: ObjId) void { const id = ptrs.obj_id[num]; const this_obj_info = &ptrs.obj_info[num]; this_obj_info.*.fuel = id.max_fuel(); } pub fn join(num: ObjId, mvd_num: ObjId, id: info.Unity_Id) void { if ( num == mvd_num ) { w4.trace("obj.join: same obj_ids"); w4.tracef("num: %d moved: %d", num, mvd_num); unreachable; } const num_id = ptrs.obj_id[num]; const mvd_id = ptrs.obj_id[mvd_num]; if ( num_id != id or mvd_id != id ) { w4.trace("obj.join: id differ"); w4.tracef("num_id: %d moved_id: %d reference_id: %d", num_id, mvd_id, id); unreachable; } const obj_info = &ptrs.obj_info[num]; const mvd_info = &ptrs.obj_info[mvd_num]; if ( obj_info.team != mvd_info.team ) { w4.trace("obj.join: team differ"); w4.tracef("num team: %d moved team: %d", obj_info.team, mvd_info.team); unreachable; } if ( obj_info.transporting != null or mvd_info.transporting != null ) { w4.trace("obj.join: both are transporting something"); w4.tracef("num team: %d moved team: %d", obj_info.team, mvd_info.team); unreachable; } obj_info.* = .{ .acted = true, .team = obj_info.team, .health = utils.min(u7, obj_info.health +| mvd_info.health, max_health), .fuel = utils.min(u7, obj_info.fuel +| mvd_info.fuel, id.max_fuel()), .transporting = obj_info.transporting orelse mvd_info.transporting orelse null, }; delete(mvd_num); } pub fn calc_attack(atk_num: ObjId, def_num: ObjId) !u7 { const atk_id = ptrs.obj_id[atk_num]; const def_id = ptrs.obj_id[def_num]; const atk_info = ptrs.obj_info[atk_num]; const def_info = ptrs.obj_info[def_num]; const atk_health = (@as(u16, atk_info.health) / 10) * 10; const def_health = (@as(u16, def_info.health) / 10) * 10; // TODO: Add co lookup const co_atk_bonus = 100; const co_def_bonus = 100; // TODO: Add luck calculation (0 ~ 9) const luck = 0; const can_attack = atk_id.attack(def_id); if ( can_attack == null ) { return error.CannotAttack; } const base_damage = @as(u16, can_attack.?) * co_atk_bonus / 100 + luck; const defense = blk: { const def_x = ptrs.obj_pos[0][def_num]; const def_y = ptrs.obj_pos[1][def_num]; const tile = ptrs.map[def_y][def_x]; break :blk @as(u16, tile.defense()); }; const pre_def_damage = base_damage * atk_health / 100; const total_damage = pre_def_damage * (200 - co_def_bonus - defense * def_health / 10) / 100; if ( !(0 <= total_damage and total_damage < 0x80) ) { w4.trace("calc_attack:"); w4.tracef(" atk_id: %d", @enumToInt(atk_id)); w4.tracef(" def_id: %d", @enumToInt(def_id)); w4.tracef(" base_damage: %d", base_damage); w4.tracef(" pre_def_damage: %d", pre_def_damage); w4.tracef(" total_damage: %d", total_damage); unreachable; } return @intCast(u7, total_damage); // Formula 1: // s, d := CO attack-buffs, defence-buffs // t := [(b*s/d)*(a*0.1)] // f := t - r*[(t*0.1)-(t*0.1*h)] // // Formula 2: // (b * co_a / 100 + l) * a_h/10 * (200 - co_d - d * d_h) / 100 } pub fn attack(atk_num: ObjId, def_num: ObjId) void { const atk_info = &ptrs.obj_info[atk_num]; const def_info = &ptrs.obj_info[def_num]; const atk_damage = calc_attack(atk_num, def_num) catch |err| switch (err) { error.CannotAttack => { w4.trace("obj.atack: found error: Cannot Attack"); w4.tracef("atk_num: %d def_num: %d", atk_num, def_num); unreachable; }, }; var def_health: u7 = undefined; if ( !@subWithOverflow(u7, def_info.*.health, atk_damage, &def_health) ) { def_info.*.health = @intCast(u7, def_health); const def_damage = calc_attack(def_num, atk_num) catch |err| switch (err) { error.CannotAttack => 0, }; var atk_health: u7 = undefined; if ( !@subWithOverflow(u7, atk_info.*.health, def_damage, &atk_health) ) { atk_info.*.health = atk_health; } else { delete(atk_num); } } else { delete(def_num); } ptrs.obj_info[atk_num].acted = true; }
src/obj.zig
const std = @import("std"); const os = std.os; const mibu = @import("mibu"); const cursor = mibu.cursor; const clear = mibu.clear; const RawTerm = mibu.term.RawTerm; const Buffer = @import("buffer.zig").Buffer; const Widget = @import("./widget.zig").Widget; const Queue = @import("./mpsc.zig").Queue; const Cell = @import("buffer.zig").Cell; const events = @import("./events.zig"); /// Main structure pub const Terminal = struct { allocator: std.mem.Allocator, raw_term: RawTerm, queue: Queue(mibu.events.Event), buffers: [2]Buffer, // one buffer is previous state current: usize = 0, // current buffer needs_clean: bool = false, const Self = @This(); pub fn init(allocator: std.mem.Allocator, handle: std.os.system.fd_t) !Self { var self = Self{ .allocator = allocator, .buffers = .{ Buffer.init(allocator), Buffer.init(allocator) }, .raw_term = try RawTerm.enableRawMode(handle, .blocking), .queue = Queue(mibu.events.Event).init(allocator), }; return self; } pub fn deinit(self: *Self) void { self.raw_term.disableRawMode() catch {}; self.queue.deinit(); self.buffers[0].deinit(); self.buffers[1].deinit(); } /// Resize screen buffer, useful when terminal size changes pub fn resize(self: *Self) !void { // clear all screen for (self.buffers) |*buffer| { _ = try buffer.resize(); } self.needs_clean = true; } /// Spawns event queue thread pub fn startEvents(self: *Self, in: anytype) !void { try events.spawnEventsThread(in, &self.queue); // Resize event (SIGWINCH) const gen = struct { pub threadlocal var _self: *Self = undefined; fn handleSigWinch(_: c_int) callconv(.C) void { _self.queue.push(.resize); } }; gen._self = self; os.sigaction(os.SIG.WINCH, &os.Sigaction{ .handler = .{ .handler = gen.handleSigWinch }, .mask = os.empty_sigset, .flags = 0, }, null); } /// Blocks thread until next event pub fn nextEvent(self: *Self) mibu.events.Event { return self.queue.pop(); } /// Blocks thread until next event or timeout reach pub fn nextEventTimeout(self: *Self, timeout: u64) ?mibu.events.Event { return self.queue.popTimeout(timeout); } /// Draws a widget on the screen. pub fn drawWidget(self: *Self, widget: *Widget) void { var update_buffer = &self.buffers[1 - self.current]; widget.draw(update_buffer); } /// Flush the buffer to the screen, it should be called /// every time you want to update. pub fn flush(self: *Self, out: anytype) !void { // clear screen is only needed when buffer is resized if (self.needs_clean) { try out.print("{s}", .{clear.all}); self.needs_clean = false; } const current_buffer = &self.buffers[self.current]; const update_buffer = &self.buffers[1 - self.current]; const updates = try current_buffer.diff(update_buffer); defer updates.deinit(); // hide cursor before rendering try out.print("{s}", .{cursor.hide()}); defer out.print("{s}", .{cursor.show()}) catch {}; for (updates.items) |update| { try out.print("{s}{s}{u}", .{ cursor.goTo(update.x + 1, update.y + 1), update.c.*.style.s(), update.c.*.value }); } // after draw change current buffers self.buffers[self.current].reset(); self.current = 1 - self.current; } }; // TODO: change location pub const Rect = struct { row: usize, col: usize, w: usize, h: usize, }; test "refAll" { std.testing.refAllDecls(@This()); }
src/terminal.zig
const std = @import("std"); var log_file: ?std.fs.File = null; /// This is taken from std.log's example of what /// a logging function might look like pub fn log( comptime level: std.log.Level, comptime scope: @TypeOf(.EnumLiteral), comptime format: []const u8, args: anytype, ) void { if (log_file == null) { log_file = std.fs.cwd().createFile("ztor.log", .{}) catch unreachable; } //const scope_prefix = "(" ++ switch (scope) { // .default => @tagName(scope), // else => return, //} ++ "): "; const scope_prefix = "(" ++ @tagName(scope) ++ "): "; const end_color = "\x1b[0m"; const color = switch (level) { .warn => "\x1b[93m", .err => "\x1b[91m", else => end_color, }; const prefix = "[" ++ @tagName(level) ++ "] " ++ scope_prefix; log_file.?.writer().print(color ++ prefix ++ format ++ "\n" ++ end_color, args) catch return; } /// Given a function and an index returns the type /// of the argument at position index /// e.g. given fn foo(handle: Handle, value: Value) void /// argType(foo, 0) -> Handle /// argType(foo, 1) -> Value pub fn argType(comptime func: anytype, comptime index: usize) type { return @typeInfo(@TypeOf(func)).Fn.args[index].arg_type.?; } /// Useful for translated-c enums where a function /// is expecting `.cimport:x:y.enum.unnamed_enum_Z /// but the values have been translated as e.g. i32s /// to operate on other c functions pub fn castCEnum(comptime c_func: anytype, comptime arg_pos: usize, enum_value: c_int) argType(c_func, arg_pos) { return @intToEnum(argType(c_func, arg_pos), enum_value); } /// Casts a C pointer to a zig pointer including /// align casting properly. Should only be used /// when it's known that the types are abi compatible pub fn cast_from_cptr(comptime T: type, ptr: anytype) T { return @ptrCast(T, @alignCast(@alignOf(T), ptr)); } /// Returns the last item in a slice as a slice of length 1 pub fn slice_back(data: anytype) @TypeOf(data) { return data[data.len - 1 .. data.len]; } /// Returns the first item in a slice as a slice of length 1 pub fn slice_front(data: anytype) @TypeOf(data) { return data[0..1]; } fn is_(comptime T: type, comptime type_enum: @Type(.EnumLiteral)) bool { return switch (@typeInfo(T)) { type_enum => true, .Optional => |o| { return is_(o.child, type_enum); }, else => false, }; } pub fn is_pointer(comptime T: type) bool { return is_(T, .Pointer); }
src/util.zig
const std = @import("std"); var builder: *std.build.Builder = undefined; pub fn build(b: *std.build.Builder) void { builder = b; // Standard target options allows the person running `zig build` to choose // what target to build for. Here we do not override the defaults, which // means any target is allowed, and the default is native. Other options // for restricting supported target set are available. const target = b.standardTargetOptions(.{}); // Standard release options allow the person running `zig build` to select // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. const mode = b.standardReleaseOptions(); const exe = b.addExecutable("wrapper", "wrapper.zig"); exe.setTarget(target); exe.setBuildMode(mode); exe.linkLibC(); exe.addIncludeDir("lua-5.3.4/src"); const lua_c_files = [_][]const u8{ "lapi.c", "lauxlib.c", "lbaselib.c", "lbitlib.c", "lcode.c", "lcorolib.c", "lctype.c", "ldblib.c", "ldebug.c", "ldo.c", "ldump.c", "lfunc.c", "lgc.c", "linit.c", "liolib.c", "llex.c", "lmathlib.c", "lmem.c", "loadlib.c", "lobject.c", "lopcodes.c", "loslib.c", "lparser.c", "lstate.c", "lstring.c", "lstrlib.c", "ltable.c", "ltablib.c", "ltm.c", "lundump.c", "lutf8lib.c", "lvm.c", "lzio.c", }; if(target.os_tag == std.Target.Os.Tag.windows) { const c_flags = [_][]const u8{ "-std=c99", "-O2", "-DLUA_USE_WINDOWS" }; inline for (lua_c_files) |c_file| { exe.addCSourceFile("lua-5.3.4/src/" ++ c_file, &c_flags); } } else { const c_flags = [_][]const u8{ "-std=c99", "-O2", "-DLUA_USE_POSIX", }; inline for (lua_c_files) |c_file| { exe.addCSourceFile("lua-5.3.4/src/" ++ c_file, &c_flags); } } exe.install(); const run_cmd = exe.run(); run_cmd.step.dependOn(b.getInstallStep()); if (b.args) |args| { run_cmd.addArgs(args); } const run_step = b.step("run", "Run the app"); run_step.dependOn(&run_cmd.step); }
build.zig